diff options
| author | Dana Jansens <danakj@orodu.net> | 2010-04-28 12:57:51 -0400 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2010-04-28 12:58:42 -0400 |
| commit | 55b84316bb699fa530efe78d75ae8e1d57c1b57f (patch) | |
| tree | 4991974287c7adfdea0680b5d96d42a01c40a97a /obt/display.c | |
| parent | 029628087fa0090e7c3b1598786a1bf1712e0db9 (diff) | |
make an event queue for X events. the queue's min size is 16 XEvents (~3k)
Diffstat (limited to 'obt/display.c')
| -rw-r--r-- | obt/display.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/obt/display.c b/obt/display.c index 37b12157..8b06cbfc 100644 --- a/obt/display.c +++ b/obt/display.c @@ -20,6 +20,7 @@ #include "obt/prop.h" #include "obt/internal.h" #include "obt/keyboard.h" +#include "obt/xqueue.h" #ifdef HAVE_STRING_H # include <string.h> @@ -31,6 +32,10 @@ # include <unistd.h> #endif +/* from xqueue.c */ +extern void xqueue_init(void); +extern void xqueue_destroy(void); + Display* obt_display = NULL; gboolean obt_display_error_occured = FALSE; @@ -116,13 +121,19 @@ gboolean obt_display_open(const char *display_name) } g_free(n); + if (obt_display) + xqueue_init(); + return obt_display != NULL; } void obt_display_close(void) { obt_keyboard_shutdown(); - if (obt_display) XCloseDisplay(obt_display); + if (obt_display) { + xqueue_destroy(); + XCloseDisplay(obt_display); + } } static gint xerror_handler(Display *d, XErrorEvent *e) |
