diff options
author | David Reveman <davidr@novell.com> | 2008-10-08 12:28:18 -0400 |
---|---|---|
committer | David Reveman <davidr@novell.com> | 2008-10-30 03:37:50 -0400 |
commit | 16ba3806651f80bae6ef057a6cc738725e1591ba (patch) | |
tree | b3461970c6caa5e0658a17862ddb37abd85fe20a | |
parent | f3c585f6969d7b155264d554b5b2639f8ed5a975 (diff) |
Detect selection window destuction.
-rw-r--r-- | hw/dmx/dmxselection.c | 29 | ||||
-rw-r--r-- | hw/dmx/dmxselection.h | 4 |
2 files changed, 31 insertions, 2 deletions
diff --git a/hw/dmx/dmxselection.c b/hw/dmx/dmxselection.c index 700be95c2..4acaf43b7 100644 --- a/hw/dmx/dmxselection.c +++ b/hw/dmx/dmxselection.c @@ -453,7 +453,9 @@ dmxSelectionNotify (ScreenPtr pScreen, if (cookie.sequence) { - const uint32_t value = XCB_EVENT_MASK_PROPERTY_CHANGE; + const uint32_t value = + XCB_EVENT_MASK_STRUCTURE_NOTIFY | + XCB_EVENT_MASK_PROPERTY_CHANGE; dmxUnhookSelection (s, &convHead, &convTail); @@ -494,6 +496,27 @@ dmxSelectionNotify (ScreenPtr pScreen, } Bool +dmxSelectionDestroyNotify (ScreenPtr pScreen, + Window window) +{ + DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; + DMXSelection *s; + + for (s = reqHead; s; s = s->next) + if (s->value[pScreen->myNum].out == window && + s->property == dmxScreen->incrAtom) + break; + + if (s) + { + dmxSelectionDeleteReq (dmxUnhookSelection (s, &reqHead, &reqTail)); + return TRUE; + } + + return FALSE; +} + +Bool dmxSelectionPropertyNotify (ScreenPtr pScreen, Window window, int state, @@ -1278,7 +1301,9 @@ dmxProcSendEvent (ClientPtr client) if (property == dmxScreen->incrAtom) { - const uint32_t value = XCB_EVENT_MASK_PROPERTY_CHANGE; + const uint32_t value = + XCB_EVENT_MASK_STRUCTURE_NOTIFY | + XCB_EVENT_MASK_PROPERTY_CHANGE; xcb_change_window_attributes (dmxScreen->connection, s->requestor, diff --git a/hw/dmx/dmxselection.h b/hw/dmx/dmxselection.h index ac807adf0..0d4b0f0d3 100644 --- a/hw/dmx/dmxselection.h +++ b/hw/dmx/dmxselection.h @@ -53,6 +53,10 @@ dmxSelectionPropertyNotify (ScreenPtr pScreen, Time xTime); Bool +dmxSelectionDestroyNotify (ScreenPtr pScreen, + Window requestor); + +Bool dmxSelectionPropertyReplyCheck (ScreenPtr pScreen, unsigned int sequence, xcb_generic_reply_t *reply); |