diff options
author | David Reveman <davidr@novell.com> | 2008-10-08 12:32:23 -0400 |
---|---|---|
committer | David Reveman <davidr@novell.com> | 2008-10-30 03:37:50 -0400 |
commit | b72d8f40376708428b0c2a227c08b9d7466783cb (patch) | |
tree | b7a9ed979840c7644ca9d53553225bd0d092218d /hw/dmx | |
parent | 9106ea0d2ba0ae4ab945dee7464f864f7bc4e49c (diff) |
Add DMXRequest type.
Diffstat (limited to 'hw/dmx')
-rw-r--r-- | hw/dmx/dmx.h | 9 | ||||
-rw-r--r-- | hw/dmx/dmxscrinit.c | 30 | ||||
-rw-r--r-- | hw/dmx/dmxscrinit.h | 4 |
3 files changed, 41 insertions, 2 deletions
diff --git a/hw/dmx/dmx.h b/hw/dmx/dmx.h index d761159c8..8e0e98f75 100644 --- a/hw/dmx/dmx.h +++ b/hw/dmx/dmx.h @@ -98,6 +98,15 @@ typedef struct _DMXQueue { DMXSequence **tail; } DMXQueue; +typedef void (*ReplyProcPtr) (ScreenPtr pScreen, + unsigned int sequence, + xcb_generic_reply_t *reply); + +typedef struct _DMXRequest { + DMXSequence base; + ReplyProcPtr reply; +} DMXRequest; + typedef struct _DMXPropTrans { const char *name; const char *format; diff --git a/hw/dmx/dmxscrinit.c b/hw/dmx/dmxscrinit.c index a6cff0807..cc95ad73a 100644 --- a/hw/dmx/dmxscrinit.c +++ b/hw/dmx/dmxscrinit.c @@ -291,6 +291,9 @@ dmxScreenEventCheckSelection (ScreenPtr pScreen, xcb_destroy_notify_event_t *xdestroy = (xcb_destroy_notify_event_t *) event; + if (dmxSelectionDestroyNotify (pScreen, xdestroy->window)) + return TRUE; + if (xdestroy->window != dmxScreen->selectionOwner) return FALSE; @@ -853,7 +856,8 @@ dmxBEDispatch (ScreenPtr pScreen) xcb_generic_error_t *error; void *reply; - dmxScreen->inDispatch++; + assert (dmxScreen->inDispatch == FALSE); + dmxScreen->inDispatch = TRUE; while ((event = xcb_poll_for_event (dmxScreen->connection))) { @@ -959,7 +963,7 @@ dmxBEDispatch (ScreenPtr pScreen) dmxScreen->broken = TRUE; } - dmxScreen->inDispatch--; + dmxScreen->inDispatch = FALSE; } static void @@ -1509,3 +1513,25 @@ dmxClearQueue (DMXQueue *q) q->tail = &q->head; } + +Bool +dmxAddRequest (DMXQueue *q, + ReplyProcPtr reply, + unsigned long sequence) +{ + DMXRequest *r; + + r = malloc (sizeof (DMXRequest)); + if (!r) + return FALSE; + + r->base.sequence = sequence; + r->base.next = 0; + r->reply = reply; + + *(q->tail) = &r->base; + q->tail = &r->base.next; + + return TRUE; +} + diff --git a/hw/dmx/dmxscrinit.h b/hw/dmx/dmxscrinit.h index d92dd4064..ab90e4034 100644 --- a/hw/dmx/dmxscrinit.h +++ b/hw/dmx/dmxscrinit.h @@ -52,4 +52,8 @@ extern void dmxBEDispatch (ScreenPtr pScreen); extern Bool dmxAddSequence (DMXQueue *q, unsigned long sequence); extern void dmxClearQueue (DMXQueue *q); +extern Bool dmxAddRequest (DMXQueue *q, + ReplyProcPtr reply, + unsigned long sequence); + #endif /* DMXSCRINIT_H */ |