GNOME Bugzilla – Bug 759222
MetaWaylandDataDevice: Don't set surface offset as anchor offset
Last modified: 2016-01-19 13:34:38 UTC
This fixes the mutter side of bug 759168.
Created attachment 316995 [details] [review] MetaWaylandDataDevice: Don't set surface offset as anchor offset Since we are using the surface actor to draw the DND icon, the offset is already accounted for by MetaSurfaceActorWayland, and passing the surface position offset would effectively double the actual offset, causing the icon to be misplaced. This patch always sets the anchor offset to (0, 0) when the icon is a Wayland surface, and lets the surface actor deal with the offsetting.
Comment on attachment 316995 [details] [review] MetaWaylandDataDevice: Don't set surface offset as anchor offset Looks mostly good, I definitely didn't notice the offset was already set in the surface. It seems like all of meta_wayland_data_device_update_dnd_surface() is superfluous then, though.
(In reply to Carlos Garnacho from comment #2) > Comment on attachment 316995 [details] [review] [review] > MetaWaylandDataDevice: Don't set surface offset as anchor offset > > Looks mostly good, I definitely didn't notice the offset was already set in > the surface. It seems like all of > meta_wayland_data_device_update_dnd_surface() is superfluous then, though. Is there more stuff related to this to remove? Like the "anchor-x/y" in MetaFeedbackActor? Is the feedback used only for Wayland client surfaces, or are there non-wl_surface based icons that needs the offset?
Created attachment 317809 [details] [review] MetaWaylandDataDevice: Don't set surface offset as anchor offset Since we are using the surface actor to draw the DND icon, the offset is already accounted for by MetaSurfaceActorWayland, and passing the surface position offset would effectively double the actual offset, causing the icon to be misplaced. This patch always sets the anchor offset to (0, 0) when the icon is a Wayland surface, and lets the surface actor deal with the offsetting.
(In reply to Jonas Ådahl from comment #3) > (In reply to Carlos Garnacho from comment #2) > > Comment on attachment 316995 [details] [review] [review] [review] > > MetaWaylandDataDevice: Don't set surface offset as anchor offset > > > > Looks mostly good, I definitely didn't notice the offset was already set in > > the surface. It seems like all of > > meta_wayland_data_device_update_dnd_surface() is superfluous then, though. > > Is there more stuff related to this to remove? Like the "anchor-x/y" in > MetaFeedbackActor? Is the feedback used only for Wayland client surfaces, or > are there non-wl_surface based icons that needs the offset? anchor-x/y was also added with the patches in bug #732367 in mind, where the feedback actors were actually a subclass of MetaFeedbackActor. I need to go back to reworking that, but if I make the actors StWidget as was last suggested, then anchor-x/y is debatable too. It could perhaps be done in a separate commit, which can be reverted if turns out necessary.
Comment on attachment 317809 [details] [review] MetaWaylandDataDevice: Don't set surface offset as anchor offset Looks good!
Ended up pushing this one. Attachment 317809 [details] pushed as bcdda50 - MetaWaylandDataDevice: Don't set surface offset as anchor offset