]> Dogcows Code - chaz/openbox/blobdiff - openbox/moveresize.c
make an event queue for X events. the queue's min size is 16 XEvents (~3k)
[chaz/openbox] / openbox / moveresize.c
index cb0d21018f0252123ea4e63ea175431930436975..8ee88fcfc02e30cddbf06f868b8fb2f7f0fd8988 100644 (file)
@@ -32,6 +32,7 @@
 #include "obrender/render.h"
 #include "obrender/theme.h"
 #include "obt/display.h"
+#include "obt/xqueue.h"
 #include "obt/prop.h"
 #include "obt/keyboard.h"
 
@@ -672,7 +673,8 @@ static void move_with_keys(KeySym sym, guint state)
     XSync(obt_display, FALSE);
     {
         XEvent ce;
-        while (XCheckTypedEvent(obt_display, MotionNotify, &ce));
+        while (xqueue_remove_local(&ce, xqueue_match_type,
+                                   GINT_TO_POINTER(MotionNotify)));
     }
     screen_pointer_pos(&px, &py);
 
@@ -831,7 +833,8 @@ static void resize_with_keys(KeySym sym, guint state)
     XSync(obt_display, FALSE);
     {
         XEvent ce;
-        while (XCheckTypedEvent(obt_display, MotionNotify, &ce));
+        while (xqueue_remove_local(&ce, xqueue_match_type,
+                                   GINT_TO_POINTER(MotionNotify)));
     }
     screen_pointer_pos(&px, &py);
 
This page took 0.021191 seconds and 4 git commands to generate.