|
1 | 1 | #include "picking.h"
|
2 | 2 | #include "wm.h"
|
| 3 | +#include "mainloop.h" |
3 | 4 |
|
4 | 5 | GLuint picking_fb;
|
5 | 6 |
|
@@ -69,7 +70,8 @@ void pick(int x, int y, int *winx, int *winy, Item **item, Item **parent_item) {
|
69 | 70 | view_pick(picking_fb, view, x, y, winx, winy, item, parent_item);
|
70 | 71 | }
|
71 | 72 |
|
72 |
| -void raw_motion_detected(void *data, xcb_query_pointer_reply_t *reply, xcb_generic_error_t *error) { |
| 73 | +static Bool processing_raw_motion_detected = False; |
| 74 | +void raw_motion_detected_load(void *data, xcb_query_pointer_reply_t *reply, xcb_generic_error_t *error) { |
73 | 75 | mouse.root = reply->root;
|
74 | 76 | mouse.win = reply->child;
|
75 | 77 | mouse.root_x = reply->root_x;
|
@@ -108,4 +110,12 @@ void raw_motion_detected(void *data, xcb_query_pointer_reply_t *reply, xcb_gener
|
108 | 110 | DEBUG("position", "Point %d,%d -> NONE\n", mouse.root_x, mouse.root_y);
|
109 | 111 | }
|
110 | 112 | trigger_draw();
|
| 113 | + processing_raw_motion_detected = False; |
| 114 | +} |
| 115 | + |
| 116 | +void raw_motion_detected(void) { |
| 117 | + if (processing_raw_motion_detected) return; |
| 118 | + processing_raw_motion_detected = True; |
| 119 | + xcb_query_pointer_cookie_t query_pointer_cookie = xcb_query_pointer(xcb_display, root); |
| 120 | + MAINLOOP_XCB_DEFER(query_pointer_cookie, &raw_motion_detected_load, NULL); |
111 | 121 | }
|
0 commit comments