~ubuntu-branches/ubuntu/precise/xorg-server/precise-updates

« back to all changes in this revision

Viewing changes to hw/xwin/winrandr.c

  • Committer: Package Import Robot
  • Author(s): Christopher James Halse Rogers
  • Date: 2012-01-23 16:09:29 UTC
  • mfrom: (1.1.46) (0.11.34 sid)
  • Revision ID: package-import@ubuntu.com-20120123160929-k4xdb9b7xeesiukp
Tags: 2:1.11.3-0ubuntu8
* debian/patches/224_return_BadWindow_not_BadMatch.diff:
  - Fix the error values of a whole slew of window-related calls.
    Fixes some gnome-settings-daemon aborts in XLib (LP: #903973)

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
  return TRUE;
64
64
}
65
65
 
66
 
 
67
 
/*
68
 
  Copied from the xfree86 DDX
69
 
 
70
 
  Why can't this be in DIX?
71
 
  Does union _Validate vary depending on DDX??
72
 
 */
73
 
static void
74
 
xf86SetRootClip (ScreenPtr pScreen, Bool enable)
75
 
{
76
 
    WindowPtr   pWin = pScreen->root;
77
 
    WindowPtr   pChild;
78
 
    Bool        WasViewable = (Bool)(pWin->viewable);
79
 
    Bool        anyMarked = FALSE;
80
 
    WindowPtr   pLayerWin;
81
 
    BoxRec      box;
82
 
 
83
 
    if (WasViewable)
84
 
    {
85
 
        for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
86
 
        {
87
 
            (void) (*pScreen->MarkOverlappedWindows)(pChild,
88
 
                                                     pChild,
89
 
                                                     &pLayerWin);
90
 
        }
91
 
        (*pScreen->MarkWindow) (pWin);
92
 
        anyMarked = TRUE;
93
 
        if (pWin->valdata)
94
 
        {
95
 
            if (HasBorder (pWin))
96
 
            {
97
 
                RegionPtr       borderVisible;
98
 
 
99
 
                borderVisible = REGION_CREATE(pScreen, NullBox, 1);
100
 
                REGION_SUBTRACT(pScreen, borderVisible,
101
 
                                &pWin->borderClip, &pWin->winSize);
102
 
                pWin->valdata->before.borderVisible = borderVisible;
103
 
            }
104
 
            pWin->valdata->before.resized = TRUE;
105
 
        }
106
 
    }
107
 
 
108
 
    /*
109
 
     * Use REGION_BREAK to avoid optimizations in ValidateTree
110
 
     * that assume the root borderClip can't change well, normally
111
 
     * it doesn't...)
112
 
     */
113
 
    if (enable)
114
 
    {
115
 
        box.x1 = 0;
116
 
        box.y1 = 0;
117
 
        box.x2 = pScreen->width;
118
 
        box.y2 = pScreen->height;
119
 
        REGION_INIT (pScreen, &pWin->winSize, &box, 1);
120
 
        REGION_INIT (pScreen, &pWin->borderSize, &box, 1);
121
 
        if (WasViewable)
122
 
            REGION_RESET(pScreen, &pWin->borderClip, &box);
123
 
        pWin->drawable.width = pScreen->width;
124
 
        pWin->drawable.height = pScreen->height;
125
 
        REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
126
 
    }
127
 
    else
128
 
    {
129
 
        REGION_EMPTY(pScreen, &pWin->borderClip);
130
 
        REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
131
 
    }
132
 
 
133
 
    ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
134
 
 
135
 
    if (WasViewable)
136
 
    {
137
 
        if (pWin->firstChild)
138
 
        {
139
 
            anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild,
140
 
                                                           pWin->firstChild,
141
 
                                                           (WindowPtr *)NULL);
142
 
        }
143
 
        else
144
 
        {
145
 
            (*pScreen->MarkWindow) (pWin);
146
 
            anyMarked = TRUE;
147
 
        }
148
 
 
149
 
 
150
 
        if (anyMarked)
151
 
            (*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
152
 
    }
153
 
 
154
 
    if (WasViewable)
155
 
    {
156
 
        if (anyMarked)
157
 
            (*pScreen->HandleExposures)(pWin);
158
 
        if (anyMarked && pScreen->PostValidateTree)
159
 
            (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther);
160
 
    }
161
 
    if (pWin->realized)
162
 
        WindowsRestructured ();
163
 
    FlushAllOutput ();
164
 
}
165
 
 
166
66
/*
167
67
 
168
68
*/
178
78
  WindowPtr pRoot = pScreen->root;
179
79
 
180
80
  // Prevent screen updates while we change things around
181
 
  xf86SetRootClip(pScreen, FALSE);
 
81
  SetRootClip(pScreen, FALSE);
182
82
 
183
83
  /* Update the screen size as requested */
184
84
  pScreenInfo->dwWidth = width;
205
105
  // does this emit a ConfigureNotify??
206
106
 
207
107
  // Restore the ability to update screen, now with new dimensions
208
 
  xf86SetRootClip(pScreen, TRUE);
 
108
  SetRootClip(pScreen, TRUE);
209
109
 
210
110
  // and arrange for it to be repainted
211
111
  miPaintWindow(pRoot, &pRoot->borderClip,  PW_BACKGROUND);