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 736840 - keyboard/pointer: Calculate the serial once per event
keyboard/pointer: Calculate the serial once per event
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2014-09-17 23:56 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2014-09-18 15:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
keyboard/pointer: Calculate the serial once per event (3.91 KB, patch)
2014-09-17 23:56 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
keyboard/pointer: Calculate the serial once per event (3.82 KB, patch)
2014-09-18 00:05 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review

Description Jasper St. Pierre (not reading bugmail) 2014-09-17 23:56:43 UTC
This is something I noticed when trying out totem under nested Wayland.
Comment 1 Jasper St. Pierre (not reading bugmail) 2014-09-17 23:56:45 UTC
Created attachment 286426 [details] [review]
keyboard/pointer: Calculate the serial once per event

Some applications, like totem, create keyboard/pointer objects from the
same client, and expect it to work. We made this work a while ago, but
due to an oversight in the code, we increment the serial on button press
for every resource that we need to send events to.

Since operations like move/resize use the grab serial of the devices to
determine whether the operation is exact, we need to make sure the same
serial goes to all devices.

Restructure the code so that all that's in the resource loop is the
sending of the event -- all the calculation that's needed happens
outside.

This fixes moving / resizing the Totem window not working sometimes.
Comment 2 Jasper St. Pierre (not reading bugmail) 2014-09-18 00:05:38 UTC
Created attachment 286427 [details] [review]
keyboard/pointer: Calculate the serial once per event

Some applications, like totem, create keyboard/pointer objects from the
same client, and expect it to work. We made this work a while ago, but
due to an oversight in the code, we increment the serial on button press
for every resource that we need to send events to.

Since operations like move/resize use the grab serial of the devices to
determine whether the operation is exact, we need to make sure the same
serial goes to all devices.

Restructure the code so that all that's in the resource loop is the
sending of the event -- all the calculation that's needed happens
outside.

This fixes moving / resizing the Totem window not working sometimes.



--

Attaching a simpler patch that might be easier to review.
Comment 3 Rui Matos 2014-09-18 15:08:24 UTC
Review of attachment 286427 [details] [review]:

Looks fine and since this only touches wayland code paths and we haven't declared wayland sessions "stable" there can't be regressions and thus I think this can go in despite the code freeze.