GNOME Bugzilla – Bug 728030
Negative local coordinates in wl_data_device.motion
Last modified: 2014-10-06 21:49:33 UTC
Hi, when you run weston-dnd under mutter and drag the flower out of window, you can get negative motion coordinates. Since the motion coordinates are local coordinates in that window, they should be > 0. I think it's because when you drag it out of the window, then it should change focus to background and compute coordinates relatively to the background. But the background has no surface, therefore the focus remains on the window. Here's example output: [817496.385] wl_data_device@8.motion(301879819, -75.000000, 418.000000) [817496.400] -> wl_data_offer@4278190080.accept(10, "application/x-wayland-dnd-flower") [817496.526] wl_data_source@40.target("application/x-wayland-dnd-flower") [817496.534] -> wl_surface@39.attach(wl_buffer@42, 0, 0) [817496.541] -> wl_surface@39.damage(0, 0, 64, 64) [817496.549] -> wl_surface@39.commit() [817519.413] wl_data_device@8.motion(301879851, -75.000000, 419.000000) [817519.438] -> wl_data_offer@4278190080.accept(10, "application/x-wayland-dnd-flower") [817519.629] wl_data_source@40.target("application/x-wayland-dnd-flower") [817519.637] -> wl_surface@39.attach(wl_buffer@42, 0, 0) [817519.645] -> wl_surface@39.damage(0, 0, 64, 64) [817519.652] -> wl_surface@39.commit() [817543.245] wl_data_device@8.motion(301879875, -76.000000, 422.000000) [817543.260] -> wl_data_offer@4278190080.accept(10, "application/x-wayland-dnd-flower") Regards, Marek
Created attachment 287465 [details] [review] wayland: Add emit_crossing argument to meta_wayland_pointer_set_focus() This is TRUE in every place it was previously called.
Created attachment 287466 [details] [review] wayland: Update focus window during DnD motion But don't emit crossing events, since the DnD grab is in effect.
Created attachment 287857 [details] [review] wayland: Add enter/leave methods to the grab vtable This is to make enter/leave behavior dependent on the current grab. These vmethods should take care of what enter/leave means in the grab context, performing any event delivery or client resource management necessary. The code that used to maintain the focus_surface and deliver crossing events to the affected clients has been split into these new vmethods, and used by both the default and popup grab modes. It is now a responsibility of grab implementations to call meta_wayland_pointer_set_focus() on their motion handler if they wish the focus_surface to be up-to-date, and get the enter/leave methods accordingly run.
Created attachment 287858 [details] [review] wayland: Update focus surface during DnD motion events A further cleanup might be to have wl_data_device.enter/leave sent from the corresponding grab methods, but this suffices to have the focus surface properly updated.
This has been fixed with a much less invasive patch. https://git.gnome.org/browse/mutter/commit/?id=9203db0655125347040dc3193e7353d1e945e21e