diff options
Diffstat (limited to 'xorg-server/dix/window.c')
-rw-r--r-- | xorg-server/dix/window.c | 161 |
1 files changed, 82 insertions, 79 deletions
diff --git a/xorg-server/dix/window.c b/xorg-server/dix/window.c index 99b3e0a13..6932157d1 100644 --- a/xorg-server/dix/window.c +++ b/xorg-server/dix/window.c @@ -827,16 +827,16 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w, } if (SubSend(pParent)) { - xEvent event = { - .u.createNotify.window = wid, - .u.createNotify.parent = pParent->drawable.id, - .u.createNotify.x = x, - .u.createNotify.y = y, - .u.createNotify.width = w, - .u.createNotify.height = h, - .u.createNotify.borderWidth = bw, - .u.createNotify.override = pWin->overrideRedirect - }; + xEvent event; memset(&event, 0, sizeof(xEvent)); + event.u.createNotify.window = wid; + event.u.createNotify.parent = pParent->drawable.id; + event.u.createNotify.x = x; + event.u.createNotify.y = y; + event.u.createNotify.width = w; + event.u.createNotify.height = h; + event.u.createNotify.borderWidth = bw; + event.u.createNotify.override = pWin->overrideRedirect; + event.u.u.type = CreateNotify; DeliverEvents(pParent, &event, 1, NullWindow); } @@ -924,7 +924,9 @@ CrushTree(WindowPtr pWin) while (1) { pParent = pChild->parent; if (SubStrSend(pChild, pParent)) { - xEvent event = { .u.u.type = DestroyNotify }; + xEvent event; + memset(&event, 0, sizeof(xEvent)); + event.u.u.type = DestroyNotify; event.u.destroyNotify.window = pChild->drawable.id; DeliverEvents(pChild, &event, 1, NullWindow); } @@ -966,7 +968,9 @@ DeleteWindow(pointer value, XID wid) pParent = pWin->parent; if (wid && pParent && SubStrSend(pWin, pParent)) { - xEvent event = { .u.u.type = DestroyNotify }; + xEvent event; + memset(&event, 0, sizeof(xEvent)); + event.u.u.type = DestroyNotify; event.u.destroyNotify.window = pWin->drawable.id; DeliverEvents(pWin, &event, 1, NullWindow); } @@ -1351,12 +1355,12 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) CheckWindowOptionalNeed(pChild); } - xE = (xEvent) { - .u.colormap.window = pWin->drawable.id, - .u.colormap.colormap = cmap, - .u.colormap.new = xTrue, - .u.colormap.state = IsMapInstalled(cmap, pWin) - }; + + xE.u.colormap.window = pWin->drawable.id; + xE.u.colormap.colormap = cmap; + xE.u.colormap.new = xTrue; + xE.u.colormap.state = IsMapInstalled(cmap, pWin); + xE.u.u.type = ColormapNotify; DeliverEvents(pWin, &xE, 1, NullWindow); } @@ -1744,11 +1748,11 @@ ResizeChildrenWinSize(WindowPtr pWin, int dx, int dy, int dw, int dh) GravityTranslate(cwsx, cwsy, cwsx - dx, cwsy - dy, dw, dh, pSib->winGravity, &cwsx, &cwsy); if (cwsx != pSib->origin.x || cwsy != pSib->origin.y) { - xEvent event = { - .u.gravity.window = pSib->drawable.id, - .u.gravity.x = cwsx - wBorderWidth(pSib), - .u.gravity.y = cwsy - wBorderWidth(pSib) - }; + xEvent event; + event.u.gravity.window = pSib->drawable.id; + event.u.gravity.x = cwsx - wBorderWidth(pSib); + event.u.gravity.y = cwsy - wBorderWidth(pSib); + event.u.u.type = GravityNotify; DeliverEvents(pSib, &event, 1, NullWindow); pSib->origin.x = cwsx; @@ -2173,17 +2177,17 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) pSib = pWin->nextSib; if ((!pWin->overrideRedirect) && (RedirectSend(pParent))) { - xEvent event = { - .u.configureRequest.window = pWin->drawable.id, - .u.configureRequest.sibling = (mask & CWSibling) ? sibwid : None, - .u.configureRequest.x = x, - .u.configureRequest.y = y, - .u.configureRequest.width = w, - .u.configureRequest.height = h, - .u.configureRequest.borderWidth = bw, - .u.configureRequest.valueMask = mask, - .u.configureRequest.parent = pParent->drawable.id - }; + xEvent event; memset(&event, 0, sizeof(xEvent)); + event.u.configureRequest.window = pWin->drawable.id; + event.u.configureRequest.sibling = (mask & CWSibling) ? sibwid : None; + event.u.configureRequest.x = x; + event.u.configureRequest.y = y; + event.u.configureRequest.width = w; + event.u.configureRequest.height = h; + event.u.configureRequest.borderWidth = bw; + event.u.configureRequest.valueMask = mask; + event.u.configureRequest.parent = pParent->drawable.id; + event.u.u.type = ConfigureRequest; event.u.u.detail = (mask & CWStackMode) ? smode : Above; #ifdef PANORAMIX @@ -2202,11 +2206,11 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) if (size_change && ((pWin->eventMask | wOtherEventMasks(pWin)) & ResizeRedirectMask)) { - xEvent eventT = { - .u.resizeRequest.window = pWin->drawable.id, - .u.resizeRequest.width = w, - .u.resizeRequest.height = h - }; + xEvent eventT; memset(&eventT, 0, sizeof(xEvent)); + eventT.u.resizeRequest.window = pWin->drawable.id; + eventT.u.resizeRequest.width = w; + eventT.u.resizeRequest.height = h; + eventT.u.u.type = ResizeRequest; if (MaybeDeliverEventsToClient(pWin, &eventT, 1, ResizeRedirectMask, client) == 1) { @@ -2258,16 +2262,16 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) } if (SubStrSend(pWin, pParent)) { - xEvent event = { - .u.configureNotify.window = pWin->drawable.id, - .u.configureNotify.aboveSibling = pSib ? pSib->drawable.id : None, - .u.configureNotify.x = x, - .u.configureNotify.y = y, - .u.configureNotify.width = w, - .u.configureNotify.height = h, - .u.configureNotify.borderWidth = bw, - .u.configureNotify.override = pWin->overrideRedirect - }; + xEvent event; memset(&event, 0, sizeof(xEvent)); + event.u.configureNotify.window = pWin->drawable.id; + event.u.configureNotify.aboveSibling = pSib ? pSib->drawable.id : None; + event.u.configureNotify.x = x; + event.u.configureNotify.y = y; + event.u.configureNotify.width = w; + event.u.configureNotify.height = h; + event.u.configureNotify.borderWidth = bw; + event.u.configureNotify.override = pWin->overrideRedirect; + event.u.u.type = ConfigureNotify; #ifdef PANORAMIX if (!noPanoramiXExtension && (!pParent || !pParent->parent)) { @@ -2347,13 +2351,12 @@ CirculateWindow(WindowPtr pParent, int direction, ClientPtr client) return Success; } - event = (xEvent) { - .u.circulate.window = pWin->drawable.id, - .u.circulate.parent = pParent->drawable.id, - .u.circulate.event = pParent->drawable.id, - .u.circulate.place = (direction == RaiseLowest) ? - PlaceOnTop : PlaceOnBottom, - }; + + event.u.circulate.window = pWin->drawable.id; + event.u.circulate.parent = pParent->drawable.id; + event.u.circulate.event = pParent->drawable.id; + event.u.circulate.place = (direction == RaiseLowest) ? + PlaceOnTop : PlaceOnBottom; if (RedirectSend(pParent)) { event.u.u.type = CirculateRequest; @@ -2406,13 +2409,13 @@ ReparentWindow(WindowPtr pWin, WindowPtr pParent, if (WasMapped) UnmapWindow(pWin, FALSE); - event = (xEvent) { - .u.reparent.window = pWin->drawable.id, - .u.reparent.parent = pParent->drawable.id, - .u.reparent.x = x, - .u.reparent.y = y, - .u.reparent.override = pWin->overrideRedirect - }; + memset(&event, 0, sizeof(xEvent)); + event.u.reparent.window = pWin->drawable.id; + event.u.reparent.parent = pParent->drawable.id; + event.u.reparent.x = x; + event.u.reparent.y = y; + event.u.reparent.override = pWin->overrideRedirect; + event.u.u.type = ReparentNotify; #ifdef PANORAMIX if (!noPanoramiXExtension && !pParent->parent) { @@ -2508,10 +2511,10 @@ RealizeTree(WindowPtr pWin) static Bool MaybeDeliverMapRequest(WindowPtr pWin, WindowPtr pParent, ClientPtr client) { - xEvent event = { - .u.mapRequest.window = pWin->drawable.id, - .u.mapRequest.parent = pParent->drawable.id - }; + xEvent event; memset(&event, 0, sizeof(event)); + event.u.mapRequest.window = pWin->drawable.id; + event.u.mapRequest.parent = pParent->drawable.id; + event.u.u.type = MapRequest; return MaybeDeliverEventsToClient(pParent, &event, 1, @@ -2522,10 +2525,10 @@ MaybeDeliverMapRequest(WindowPtr pWin, WindowPtr pParent, ClientPtr client) static void DeliverMapNotify(WindowPtr pWin) { - xEvent event = { - .u.mapNotify.window = pWin->drawable.id, - .u.mapNotify.override = pWin->overrideRedirect, - }; + xEvent event; memset(&event, 0, sizeof(event)); + event.u.mapNotify.window = pWin->drawable.id; + event.u.mapNotify.override = pWin->overrideRedirect; + event.u.u.type = MapNotify; DeliverEvents(pWin, &event, 1, NullWindow); } @@ -2715,10 +2718,10 @@ UnrealizeTree(WindowPtr pWin, Bool fromConfigure) static void DeliverUnmapNotify(WindowPtr pWin, Bool fromConfigure) { - xEvent event = { - .u.unmapNotify.window = pWin->drawable.id, - .u.unmapNotify.fromConfigure = fromConfigure - }; + xEvent event; memset(&event, 0, sizeof(event)); + event.u.unmapNotify.window = pWin->drawable.id; + event.u.unmapNotify.fromConfigure = fromConfigure; + event.u.u.type = UnmapNotify; DeliverEvents(pWin, &event, 1, NullWindow); } @@ -2984,10 +2987,10 @@ SendVisibilityNotify(WindowPtr pWin) } #endif - event = (xEvent) { - .u.visibility.window = pWin->drawable.id, - .u.visibility.state = visibility - }; + memset(&event, 0, sizeof(xEvent)); + event.u.visibility.window = pWin->drawable.id; + event.u.visibility.state = visibility; + event.u.u.type = VisibilityNotify; DeliverEvents(pWin, &event, 1, NullWindow); } |