GNOME Bugzilla – Bug 736840
keyboard/pointer: Calculate the serial once per event
Last modified: 2014-09-18 15:19:19 UTC
This is something I noticed when trying out totem under nested Wayland.
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.
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.
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.