From d646069bae5f650897d803f4d9a41c49b39652d8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 12 Mar 2018 14:21:14 +0100 Subject: [PATCH] Compress motion events --- openbox/moveresize.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/openbox/moveresize.c b/openbox/moveresize.c index d12a64de..b8435012 100644 --- a/openbox/moveresize.c +++ b/openbox/moveresize.c @@ -951,9 +951,22 @@ gboolean moveresize_event(XEvent *e) } } else if (e->type == MotionNotify) { if (moving) { + XEvent ce; + ObtXQueueWindowType wt; + + wt.window = e->xmotion.window; + wt.type = MotionNotify; + while (xqueue_remove_local(&ce, xqueue_match_window_type, &wt)) { + e->xmotion.x = ce.xmotion.x; + e->xmotion.y = ce.xmotion.y; + e->xmotion.x_root = ce.xmotion.x_root; + e->xmotion.y_root = ce.xmotion.y_root; + } + cur_x = start_cx + e->xmotion.x_root - start_x; cur_y = start_cy + e->xmotion.y_root - start_y; do_move(FALSE, 0); + XSync(obt_display, FALSE); do_edge_warp(e->xmotion.x_root, e->xmotion.y_root); } else { gint dw, dh; -- 2.34.1