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 728030 - Negative local coordinates in wl_data_device.motion
Negative local coordinates in wl_data_device.motion
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
git master
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2014-04-11 11:00 UTC by Marek Chalupa
Modified: 2014-10-06 21:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: Add emit_crossing argument to meta_wayland_pointer_set_focus() (5.46 KB, patch)
2014-09-30 15:34 UTC, Carlos Garnacho
none Details | Review
wayland: Update focus window during DnD motion (951 bytes, patch)
2014-09-30 15:34 UTC, Carlos Garnacho
none Details | Review
wayland: Add enter/leave methods to the grab vtable (8.68 KB, patch)
2014-10-06 15:11 UTC, Carlos Garnacho
none Details | Review
wayland: Update focus surface during DnD motion events (1.03 KB, patch)
2014-10-06 15:11 UTC, Carlos Garnacho
none Details | Review

Description Marek Chalupa 2014-04-11 11:00:38 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
Comment 1 Carlos Garnacho 2014-09-30 15:34:39 UTC
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.
Comment 2 Carlos Garnacho 2014-09-30 15:34:43 UTC
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.
Comment 3 Carlos Garnacho 2014-10-06 15:11:25 UTC
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.
Comment 4 Carlos Garnacho 2014-10-06 15:11:30 UTC
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.
Comment 5 Jasper St. Pierre (not reading bugmail) 2014-10-06 21:49:33 UTC
This has been fixed with a much less invasive patch.

https://git.gnome.org/browse/mutter/commit/?id=9203db0655125347040dc3193e7353d1e945e21e