Reduced lagging begind of windows on slower displays
In certain situations a speedy mouse might generate more move-events than fluxbox can handle: The event queue will fill up faster than the repositioning of the window is finished. The user will experience a window which lags behind the mouse cursor, aka the window-dance. We now check the next event in the queue and postpone the move a little bit so the queue does not fill up that fast.
This commit is contained in:
parent
cfe4a80f86
commit
79fe2fca1d
1 changed files with 7 additions and 1 deletions
|
@ -2393,6 +2393,7 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
|
||||||
Fluxbox::instance()->keys()->doAction(me.type, me.state, m_last_pressed_button, context, &winClient(), me.time);
|
Fluxbox::instance()->keys()->doAction(me.type, me.state, m_last_pressed_button, context, &winClient(), me.time);
|
||||||
|
|
||||||
if (moving) {
|
if (moving) {
|
||||||
|
XEvent e;
|
||||||
|
|
||||||
// Warp to next or previous workspace?, must have moved sideways some
|
// Warp to next or previous workspace?, must have moved sideways some
|
||||||
int moved_x = me.x_root - m_last_resize_x;
|
int moved_x = me.x_root - m_last_resize_x;
|
||||||
|
@ -2428,7 +2429,6 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
|
||||||
if (new_id != cur_id) {
|
if (new_id != cur_id) {
|
||||||
|
|
||||||
// remove motion events from queue to avoid repeated warps
|
// remove motion events from queue to avoid repeated warps
|
||||||
XEvent e;
|
|
||||||
while (XCheckTypedEvent(display, MotionNotify, &e)) {
|
while (XCheckTypedEvent(display, MotionNotify, &e)) {
|
||||||
// might as well update the y-coordinate
|
// might as well update the y-coordinate
|
||||||
m_last_resize_y = e.xmotion.y_root;
|
m_last_resize_y = e.xmotion.y_root;
|
||||||
|
@ -2454,6 +2454,12 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
|
||||||
// dx = current left side, dy = current top
|
// dx = current left side, dy = current top
|
||||||
doSnapping(dx, dy);
|
doSnapping(dx, dy);
|
||||||
|
|
||||||
|
// do not update display if another motion event is already pending
|
||||||
|
if (XCheckTypedEvent(display, MotionNotify, &e)) {
|
||||||
|
XPutBackEvent(display, &e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!screen().doOpaqueMove()) {
|
if (!screen().doOpaqueMove()) {
|
||||||
parent().drawRectangle(screen().rootTheme()->opGC(),
|
parent().drawRectangle(screen().rootTheme()->opGC(),
|
||||||
dx, dy,
|
dx, dy,
|
||||||
|
|
Loading…
Reference in a new issue