mirror of
https://github.com/labwc/labwc.git
synced 2026-03-15 05:33:53 -04:00
cursor: Make update_pressed_surface() no-op except during grabs
This matches Weston behavior more closely and fixes Firefox context menus.
This commit is contained in:
parent
f37a3ffa86
commit
6164ba73ff
1 changed files with 12 additions and 4 deletions
16
src/cursor.c
16
src/cursor.c
|
|
@ -257,11 +257,19 @@ update_pressed_surface(struct seat *seat, struct cursor_context *ctx)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* In most cases, we don't want to leave one surface and enter
|
* In most cases, we don't want to leave one surface and enter
|
||||||
* another while a button is pressed. However, GTK/Wayland
|
* another while a button is pressed. We only do so when
|
||||||
* menus (implemented as XDG popups) do need the leave/enter
|
* (1) there is a pointer grab active (e.g. XDG popup grab) and
|
||||||
* events to work properly. To cover this case, we allow
|
* (2) both surfaces belong to the same XDG toplevel.
|
||||||
* leave/enter events between XDG popups and their toplevel.
|
*
|
||||||
|
* GTK/Wayland menus are known to use an XDG popup grab and to
|
||||||
|
* rely on the leave/enter events to work properly. Firefox
|
||||||
|
* context menus (in contrast) do not use an XDG popup grab and
|
||||||
|
* do not work properly if we send leave/enter events.
|
||||||
*/
|
*/
|
||||||
|
if (seat->seat->pointer_state.grab ==
|
||||||
|
seat->seat->pointer_state.default_grab) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (seat->pressed.surface && ctx->surface != seat->pressed.surface) {
|
if (seat->pressed.surface && ctx->surface != seat->pressed.surface) {
|
||||||
struct wlr_surface *toplevel = get_toplevel(ctx->surface);
|
struct wlr_surface *toplevel = get_toplevel(ctx->surface);
|
||||||
if (toplevel && toplevel == seat->pressed.toplevel) {
|
if (toplevel && toplevel == seat->pressed.toplevel) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue