]> Dogcows Code - chaz/openbox/blobdiff - obt/display.c
make an event queue for X events. the queue's min size is 16 XEvents (~3k)
[chaz/openbox] / obt / display.c
index 37b1215737bf1117e3dc95dcd7839a65d76bcb01..8b06cbfcf6cac47d213fe5a7ec33f12e6fbd1359 100644 (file)
@@ -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>
 #  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)
This page took 0.025278 seconds and 4 git commands to generate.