Thu Jan 12 17:09:18 2006 Søren Sandmann <sandmann@redhat.com>
Add new functions to enable and disable events on Map and Unmap. Use them here to make sure Composite redirect doesn't cause Map/UnmapNotify events that would confuse window managers.
This commit is contained in:
parent
847d83ec3c
commit
c2dedf4d17
|
@ -1,3 +1,12 @@
|
||||||
|
Thu Jan 12 17:09:18 2006 Søren Sandmann <sandmann@redhat.com>
|
||||||
|
|
||||||
|
* include/window.[ch]: Add new functions to enable and disable
|
||||||
|
events on Map and Unmap.
|
||||||
|
|
||||||
|
* composite/compalloc.c: Use them here to make sure Composite
|
||||||
|
redirect doesn't cause Map/UnmapNotify events that would confuse
|
||||||
|
window managers.
|
||||||
|
|
||||||
2006-01-11 Ian Romanick <idr@us.ibm.com>
|
2006-01-11 Ian Romanick <idr@us.ibm.com>
|
||||||
|
|
||||||
reviewed by: airlied, krh
|
reviewed by: airlied, krh
|
||||||
|
|
|
@ -101,7 +101,11 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
if (wasMapped)
|
if (wasMapped)
|
||||||
|
{
|
||||||
|
DisableMapUnmapEvents (pWin);
|
||||||
UnmapWindow (pWin, FALSE);
|
UnmapWindow (pWin, FALSE);
|
||||||
|
EnableMapUnmapEvents (pWin);
|
||||||
|
}
|
||||||
|
|
||||||
REGION_NULL (pScreen, &cw->borderClip);
|
REGION_NULL (pScreen, &cw->borderClip);
|
||||||
cw->update = CompositeRedirectAutomatic;
|
cw->update = CompositeRedirectAutomatic;
|
||||||
|
@ -135,7 +139,9 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update)
|
||||||
{
|
{
|
||||||
Bool overrideRedirect = pWin->overrideRedirect;
|
Bool overrideRedirect = pWin->overrideRedirect;
|
||||||
pWin->overrideRedirect = TRUE;
|
pWin->overrideRedirect = TRUE;
|
||||||
|
DisableMapUnmapEvents (pWin);
|
||||||
MapWindow (pWin, pClient);
|
MapWindow (pWin, pClient);
|
||||||
|
EnableMapUnmapEvents (pWin);
|
||||||
pWin->overrideRedirect = overrideRedirect;
|
pWin->overrideRedirect = overrideRedirect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +175,11 @@ compFreeClientWindow (WindowPtr pWin, XID id)
|
||||||
if (!cw->clients)
|
if (!cw->clients)
|
||||||
{
|
{
|
||||||
if (wasMapped)
|
if (wasMapped)
|
||||||
|
{
|
||||||
|
DisableMapUnmapEvents (pWin);
|
||||||
UnmapWindow (pWin, FALSE);
|
UnmapWindow (pWin, FALSE);
|
||||||
|
EnableMapUnmapEvents (pWin);
|
||||||
|
}
|
||||||
|
|
||||||
if (pWin->redirectDraw)
|
if (pWin->redirectDraw)
|
||||||
compFreePixmap (pWin);
|
compFreePixmap (pWin);
|
||||||
|
@ -193,7 +203,9 @@ compFreeClientWindow (WindowPtr pWin, XID id)
|
||||||
{
|
{
|
||||||
Bool overrideRedirect = pWin->overrideRedirect;
|
Bool overrideRedirect = pWin->overrideRedirect;
|
||||||
pWin->overrideRedirect = TRUE;
|
pWin->overrideRedirect = TRUE;
|
||||||
|
DisableMapUnmapEvents (pWin);
|
||||||
MapWindow (pWin, clients[CLIENT_ID(id)]);
|
MapWindow (pWin, clients[CLIENT_ID(id)]);
|
||||||
|
EnableMapUnmapEvents (pWin);
|
||||||
pWin->overrideRedirect = overrideRedirect;
|
pWin->overrideRedirect = overrideRedirect;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
27
dix/window.c
27
dix/window.c
|
@ -2728,7 +2728,7 @@ MapWindow(register WindowPtr pWin, ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
pWin->mapped = TRUE;
|
pWin->mapped = TRUE;
|
||||||
if (SubStrSend(pWin, pParent))
|
if (SubStrSend(pWin, pParent) && MapUnmapEventsEnabled(pWin))
|
||||||
{
|
{
|
||||||
event.u.u.type = MapNotify;
|
event.u.u.type = MapNotify;
|
||||||
event.u.mapNotify.window = pWin->drawable.id;
|
event.u.mapNotify.window = pWin->drawable.id;
|
||||||
|
@ -2983,7 +2983,7 @@ UnmapWindow(register WindowPtr pWin, Bool fromConfigure)
|
||||||
|
|
||||||
if ((!pWin->mapped) || (!(pParent = pWin->parent)))
|
if ((!pWin->mapped) || (!(pParent = pWin->parent)))
|
||||||
return(Success);
|
return(Success);
|
||||||
if (SubStrSend(pWin, pParent))
|
if (SubStrSend(pWin, pParent) && MapUnmapEventsEnabled(pWin))
|
||||||
{
|
{
|
||||||
event.u.u.type = UnmapNotify;
|
event.u.u.type = UnmapNotify;
|
||||||
event.u.unmapNotify.window = pWin->drawable.id;
|
event.u.unmapNotify.window = pWin->drawable.id;
|
||||||
|
@ -3285,6 +3285,29 @@ SendVisibilityNotify(WindowPtr pWin)
|
||||||
DeliverEvents(pWin, &event, 1, NullWindow);
|
DeliverEvents(pWin, &event, 1, NullWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static WindowPtr windowDisableMapUnmapEvents;
|
||||||
|
|
||||||
|
void
|
||||||
|
DisableMapUnmapEvents(WindowPtr pWin)
|
||||||
|
{
|
||||||
|
assert (windowDisableMapUnmapEvents == NULL);
|
||||||
|
|
||||||
|
windowDisableMapUnmapEvents = pWin;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EnableMapUnmapEvents(WindowPtr pWin)
|
||||||
|
{
|
||||||
|
assert (windowDisableMapUnmapEvents != NULL);
|
||||||
|
|
||||||
|
windowDisableMapUnmapEvents = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
MapUnmapEventsEnabled(WindowPtr pWin)
|
||||||
|
{
|
||||||
|
return pWin != windowDisableMapUnmapEvents;
|
||||||
|
}
|
||||||
|
|
||||||
#define RANDOM_WIDTH 32
|
#define RANDOM_WIDTH 32
|
||||||
|
|
||||||
|
|
|
@ -262,4 +262,11 @@ extern RegionPtr CreateBoundingShape(
|
||||||
extern RegionPtr CreateClipShape(
|
extern RegionPtr CreateClipShape(
|
||||||
WindowPtr /* pWin */ );
|
WindowPtr /* pWin */ );
|
||||||
|
|
||||||
|
extern void DisableMapUnmapEvents(
|
||||||
|
WindowPtr /* pWin */ );
|
||||||
|
extern void EnableMapUnmapEvents(
|
||||||
|
WindowPtr /* pWin */ );
|
||||||
|
extern Bool MapUnmapEventsEnabled(
|
||||||
|
WindowPtr /* pWin */ );
|
||||||
|
|
||||||
#endif /* WINDOW_H */
|
#endif /* WINDOW_H */
|
||||||
|
|
Loading…
Reference in New Issue