dix: Factor out MaybeDeliverMapRequest
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
dab7a1ec7f
commit
63843cb700
40
dix/window.c
40
dix/window.c
|
@ -2529,6 +2529,20 @@ MapUnmapEventsEnabled(WindowPtr pWin)
|
||||||
return pWin != windowDisableMapUnmapEvents;
|
return pWin != windowDisableMapUnmapEvents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Bool
|
||||||
|
MaybeDeliverMapRequest(WindowPtr pWin, WindowPtr pParent, ClientPtr client)
|
||||||
|
{
|
||||||
|
xEvent event = {
|
||||||
|
.u.mapRequest.window = pWin->drawable.id,
|
||||||
|
.u.mapRequest.parent = pParent->drawable.id
|
||||||
|
};
|
||||||
|
event.u.u.type = MapRequest;
|
||||||
|
|
||||||
|
return MaybeDeliverEventsToClient(pParent, &event, 1,
|
||||||
|
SubstructureRedirectMask,
|
||||||
|
client) == 1;
|
||||||
|
}
|
||||||
|
|
||||||
/*****
|
/*****
|
||||||
* MapWindow
|
* MapWindow
|
||||||
* If some other client has selected SubStructureReDirect on the parent
|
* If some other client has selected SubStructureReDirect on the parent
|
||||||
|
@ -2557,18 +2571,9 @@ MapWindow(WindowPtr pWin, ClientPtr client)
|
||||||
if ((pParent = pWin->parent)) {
|
if ((pParent = pWin->parent)) {
|
||||||
Bool anyMarked;
|
Bool anyMarked;
|
||||||
|
|
||||||
if ((!pWin->overrideRedirect) && (RedirectSend(pParent))) {
|
if ((!pWin->overrideRedirect) && (RedirectSend(pParent)))
|
||||||
xEvent event = {
|
if (MaybeDeliverMapRequest(pWin, pParent, client))
|
||||||
.u.mapRequest.window = pWin->drawable.id,
|
|
||||||
.u.mapRequest.parent = pParent->drawable.id
|
|
||||||
};
|
|
||||||
event.u.u.type = MapRequest;
|
|
||||||
|
|
||||||
if (MaybeDeliverEventsToClient(pParent, &event, 1,
|
|
||||||
SubstructureRedirectMask,
|
|
||||||
client) == 1)
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
|
||||||
|
|
||||||
pWin->mapped = TRUE;
|
pWin->mapped = TRUE;
|
||||||
if (SubStrSend(pWin, pParent) && MapUnmapEventsEnabled(pWin)) {
|
if (SubStrSend(pWin, pParent) && MapUnmapEventsEnabled(pWin)) {
|
||||||
|
@ -2640,18 +2645,9 @@ MapSubwindows(WindowPtr pParent, ClientPtr client)
|
||||||
anyMarked = FALSE;
|
anyMarked = FALSE;
|
||||||
for (pWin = pParent->firstChild; pWin; pWin = pWin->nextSib) {
|
for (pWin = pParent->firstChild; pWin; pWin = pWin->nextSib) {
|
||||||
if (!pWin->mapped) {
|
if (!pWin->mapped) {
|
||||||
if (parentRedirect && !pWin->overrideRedirect) {
|
if (parentRedirect && !pWin->overrideRedirect)
|
||||||
xEvent event = {
|
if (MaybeDeliverMapRequest(pWin, pParent, client))
|
||||||
.u.mapRequest.window = pWin->drawable.id,
|
|
||||||
.u.mapRequest.parent = pParent->drawable.id
|
|
||||||
};
|
|
||||||
event.u.u.type = MapRequest;
|
|
||||||
|
|
||||||
if (MaybeDeliverEventsToClient(pParent, &event, 1,
|
|
||||||
SubstructureRedirectMask,
|
|
||||||
client) == 1)
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
pWin->mapped = TRUE;
|
pWin->mapped = TRUE;
|
||||||
if (parentNotify || StrSend(pWin)) {
|
if (parentNotify || StrSend(pWin)) {
|
||||||
|
|
Loading…
Reference in New Issue