mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
cursor: More reliably clear "pressed" status of mouse bindings
The "pressed" status of the mouse button is stored per-binding, and the first binding activated causes us to break out of the loop that cleared the "pressed" status -- as a result, some statused weren't cleared when another binding was activated. The bug could be seen when clicking the maximize button on a window and then moving the mouse: the DRAG action would continue to move the window (unmaximizing it) even though the mouse button was no longer held.
This commit is contained in:
parent
7f8b7f0a56
commit
4e3a03586a
1 changed files with 9 additions and 5 deletions
14
src/cursor.c
14
src/cursor.c
|
|
@ -481,10 +481,8 @@ handle_release_mousebinding(struct view *view, struct server *server,
|
||||||
case MOUSE_ACTION_RELEASE:
|
case MOUSE_ACTION_RELEASE:
|
||||||
break;
|
break;
|
||||||
case MOUSE_ACTION_CLICK:
|
case MOUSE_ACTION_CLICK:
|
||||||
if (mousebind->pressed_in_context) {
|
if (mousebind->pressed_in_context)
|
||||||
mousebind->pressed_in_context = false;
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
default:
|
default:
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -493,8 +491,14 @@ handle_release_mousebinding(struct view *view, struct server *server,
|
||||||
activated_any_frame |= mousebind->context == LAB_SSD_FRAME;
|
activated_any_frame |= mousebind->context == LAB_SSD_FRAME;
|
||||||
action(view, server, &mousebind->actions, resize_edges);
|
action(view, server, &mousebind->actions, resize_edges);
|
||||||
}
|
}
|
||||||
/* For the drag events */
|
}
|
||||||
mousebind->pressed_in_context = false;
|
/*
|
||||||
|
* Clear "pressed" status for all bindings of this mouse button,
|
||||||
|
* regardless of whether activated or not
|
||||||
|
*/
|
||||||
|
wl_list_for_each(mousebind, &rc.mousebinds, link) {
|
||||||
|
if (mousebind->button == button)
|
||||||
|
mousebind->pressed_in_context = false;
|
||||||
}
|
}
|
||||||
return activated_any && activated_any_frame;
|
return activated_any && activated_any_frame;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue