dix: Factor out DeliverUnmapNotify
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
d20cc0fca4
commit
387b1ac33c
31
dix/window.c
31
dix/window.c
|
@ -2737,6 +2737,17 @@ UnrealizeTree(WindowPtr pWin, Bool fromConfigure)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
DeliverUnmapNotify(WindowPtr pWin, Bool fromConfigure)
|
||||||
|
{
|
||||||
|
xEvent event = {
|
||||||
|
.u.unmapNotify.window = pWin->drawable.id,
|
||||||
|
.u.unmapNotify.fromConfigure = fromConfigure
|
||||||
|
};
|
||||||
|
event.u.u.type = UnmapNotify;
|
||||||
|
DeliverEvents(pWin, &event, 1, NullWindow);
|
||||||
|
}
|
||||||
|
|
||||||
/*****
|
/*****
|
||||||
* UnmapWindow
|
* UnmapWindow
|
||||||
* If the window is already unmapped, this request has no effect.
|
* If the window is already unmapped, this request has no effect.
|
||||||
|
@ -2755,14 +2766,8 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure)
|
||||||
|
|
||||||
if ((!pWin->mapped) || (!(pParent = pWin->parent)))
|
if ((!pWin->mapped) || (!(pParent = pWin->parent)))
|
||||||
return Success;
|
return Success;
|
||||||
if (SubStrSend(pWin, pParent) && MapUnmapEventsEnabled(pWin)) {
|
if (SubStrSend(pWin, pParent) && MapUnmapEventsEnabled(pWin))
|
||||||
xEvent event = {
|
DeliverUnmapNotify(pWin, fromConfigure);
|
||||||
.u.unmapNotify.window = pWin->drawable.id,
|
|
||||||
.u.unmapNotify.fromConfigure = fromConfigure
|
|
||||||
};
|
|
||||||
event.u.u.type = UnmapNotify;
|
|
||||||
DeliverEvents(pWin, &event, 1, NullWindow);
|
|
||||||
}
|
|
||||||
if (wasViewable && !fromConfigure) {
|
if (wasViewable && !fromConfigure) {
|
||||||
pWin->valdata = UnmapValData;
|
pWin->valdata = UnmapValData;
|
||||||
(*pScreen->MarkOverlappedWindows) (pWin, pWin->nextSib, &pLayerWin);
|
(*pScreen->MarkOverlappedWindows) (pWin, pWin->nextSib, &pLayerWin);
|
||||||
|
@ -2813,14 +2818,8 @@ UnmapSubwindows(WindowPtr pWin)
|
||||||
|
|
||||||
for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) {
|
for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) {
|
||||||
if (pChild->mapped) {
|
if (pChild->mapped) {
|
||||||
if (parentNotify || StrSend(pChild)) {
|
if (parentNotify || StrSend(pChild))
|
||||||
xEvent event = {
|
DeliverUnmapNotify(pChild, xFalse);
|
||||||
.u.unmapNotify.window = pChild->drawable.id,
|
|
||||||
.u.unmapNotify.fromConfigure = xFalse
|
|
||||||
};
|
|
||||||
event.u.u.type = UnmapNotify;
|
|
||||||
DeliverEvents(pChild, &event, 1, NullWindow);
|
|
||||||
}
|
|
||||||
if (pChild->viewable) {
|
if (pChild->viewable) {
|
||||||
pChild->valdata = UnmapValData;
|
pChild->valdata = UnmapValData;
|
||||||
anyMarked = TRUE;
|
anyMarked = TRUE;
|
||||||
|
|
Loading…
Reference in New Issue