After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 738888 - wayland clients receive the button release event finishing a window drag
wayland clients receive the button release event finishing a window drag
Status: RESOLVED OBSOLETE
Product: mutter
Classification: Core
Component: wayland
git master
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2014-10-20 17:48 UTC by Carlos Garnacho
Modified: 2021-07-05 13:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
core: end-of-grab button releases must be consumed by the window (1.08 KB, patch)
2014-10-20 17:55 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2014-10-20 17:48:07 UTC
AFAIK the compositor is supposed to consume the whole motion/motion/.../release events after xdg_surface.move()/resize(), or at least it used to do. Right now the motion events are consumed, but the button release makes it to the client, possibly triggering further actions after the window drag finished.
Comment 1 Carlos Garnacho 2014-10-20 17:55:03 UTC
Created attachment 288975 [details] [review]
core: end-of-grab button releases must be consumed by the window

Returning FALSE here gets the button release event propagated to the
client on wayland, which is unexpected after xdg_surface.move/resize()
have been called.
Comment 2 Jasper St. Pierre (not reading bugmail) 2014-10-21 18:48:00 UTC
Review of attachment 288975 [details] [review]:

Hm, it seems I added this in https://git.gnome.org/browse/mutter/commit/?id=a5cca52

If you're seeing problems with it, let's try this for now, but we need to make sure Xwayland doesn't get stuck with it.
Comment 3 Carlos Garnacho 2014-10-23 14:52:40 UTC
(In reply to comment #2)
> Review of attachment 288975 [details] [review]:
> 
> Hm, it seems I added this in
> https://git.gnome.org/browse/mutter/commit/?id=a5cca52
> 
> If you're seeing problems with it, let's try this for now, 

Yeah, gdk/wayland is aware/dependent on this behavior since long ago:

commit eedd1ec92f6c035c00f4deaef748173f0ed36f06
Author: Rob Bradford <rob@linux.intel.com>
Date:   Mon Jan 9 16:00:14 2012 +0000

    wayland: Make the resize and move functions use gdk_device_ungrab
    
    Now that grab and ungrab vfuncs are implemented on GdkDevice then we can use
    gdk_device_ungrab to break the implicit grab created by the button press that
    triggered the resize and move.

So this brings side effects, like closing popovers that were opened before dragging, etc.

> but we need to make
> sure Xwayland doesn't get stuck with it.

Hmm, it indeed does... although AFAICS what X11 clients would be expecting here is a XI_Leave/LeaveNotify event with (XI)NotifyGrab mode when the compositor grabs the device, or maybe even a fake grab somewhere else. I guess mutter is responsible to do this.

I will push the patch and look into this, I'm leaving the bug open at the moment.
Comment 4 Carlos Garnacho 2014-10-23 14:55:00 UTC
Comment on attachment 288975 [details] [review]
core: end-of-grab button releases must be consumed by the window

Attachment 288975 [details] pushed as 8819d9c - core: end-of-grab button releases must be consumed by the window
Comment 5 GNOME Infrastructure Team 2021-07-05 13:50:36 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/mutter/-/issues/

Thank you for your understanding and your help.