[Wayland-bugs] [Bug 741066] New: DnD fails on touch

gtk+ (bugzilla.gnome.org) bugzilla at gnome.org
Wed Dec 3 06:17:13 PST 2014


https://bugzilla.gnome.org/show_bug.cgi?id=741066
  gtk+ | Backend: Wayland | 3.14.x

           Summary: DnD fails on touch
    Classification: Platform
           Product: gtk+
           Version: 3.14.x
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: Backend: Wayland
        AssignedTo: gtk-bugs at gtk.org
        ReportedBy: jonnylamb at gnome.org
         QAContact: gtk-bugs at gtk.org
                CC: rob at robster.org.uk, carlosg at gnome.org,
                    wayland-bugs at lists.freedesktop.org
     GNOME version: ---


DnD on touch with no mouse connected can't work for a few reasons.

At first these two messages were appearing in the log:

(gtk3-demo:3443): Gdk-CRITICAL **: gdk_wayland_window_get_wl_surface: assertion
'GDK_IS_WAYLAND_WINDOW (window)' failed
(gtk3-demo:3443): Gdk-ERROR **: error marshalling arguments for start_drag
(signature ?oo?ou): null value passed for arg 1

The latter is obviously caused by the former so I got a backtrace for the first
critical (sorry about broken debug symbols):

#0  0x2b50f434 in raise (sig=5) at
../nptl/sysdeps/unix/sysv/linux/pt-raise.c:46
#1  0x2b3df5d8 in g_logv (log_domain=0x2b09f09a "Gdk",
log_level=G_LOG_LEVEL_CRITICAL, 
    format=<optimized out>, args=...) at gmessages.c:1041
#2  0x2b3df658 in g_log (log_domain=<optimized out>, log_level=<optimized out>, 
    format=0x2b422563 "%s: assertion '%s' failed") at gmessages.c:1079
#3  0x2b3df680 in g_return_if_fail_warning (log_domain=<optimized out>,
pretty_function=<optimized out>, 
    expression=<optimized out>) at gmessages.c:1088
#4  0x2b09dac0 in gdk_wayland_window_get_wl_surface () from
/usr/lib/libgdk-3.so.0
#5  0x2b097f08 in _gdk_wayland_window_drag_begin () from /usr/lib/libgdk-3.so.0
#6  0x2b08e49c in gdk_drag_begin_for_device () from /usr/lib/libgdk-3.so.0
#7  0x2ade7bf0 in gtk_drag_begin_internal () from /usr/lib/libgtk-3.so.0
#8  0x2adebef0 in gtk_drag_source_event_cb () from /usr/lib/libgtk-3.so.0
#9  0x2ac994d8 in _gtk_marshal_BOOLEAN__BOXED () from /usr/lib/libgtk-3.so.0
#10 0x2b360da4 in g_closure_invoke (closure=0x26f7c8, return_value=0x7ef335e0,
n_param_values=2, 
    param_values=0x7ef33628, invocation_hint=0x7ef335cc) at gclosure.c:768
#11 0x2b371a60 in signal_emit_unlocked_R (node=0xf7958, detail=725177564,
instance=0x26edf8, 
    emission_return=0x7ef335e0, instance_and_params=0x7ef33628) at
gsignal.c:3553
#12 0x2b376ed8 in g_signal_emit_valist (instance=<optimized out>,
signal_id=<optimized out>, detail=0, 
    var_args=...) at gsignal.c:3319
#13 0x2b377164 in g_signal_emit (instance=<optimized out>, signal_id=<optimized
out>, detail=0)
    at gsignal.c:3365
#14 0x2adbaf0c in gtk_widget_real_touch_event () from /usr/lib/libgtk-3.so.0
#15 0x2ac995c0 in _gtk_marshal_BOOLEAN__BOXEDv () from /usr/lib/libgtk-3.so.0
#16 0x2b35f130 in g_type_class_meta_marshalv (closure=0xf7810,
return_value=<optimized out>, 
    instance=<optimized out>, args=..., marshal_data=0x17c, n_params=1,
param_types=0xf7828)
    at gclosure.c:988
#17 0x2b360fd4 in _g_closure_invoke_va (closure=0xf7810, return_value=0x26edf8,
instance=0x26edf8, args=..., 
    n_params=1, param_types=0xf7828) at gclosure.c:831
#18 0x2b376958 in g_signal_emit_valist (instance=<optimized out>,
signal_id=<optimized out>, detail=0, 
    var_args=...) at gsignal.c:3218
#19 0x2b377164 in g_signal_emit (instance=<optimized out>, signal_id=<optimized
out>, detail=0)
    at gsignal.c:3365
#20 0x2adbea34 in gtk_widget_event_internal.part.25 () from
/usr/lib/libgtk-3.so.0
#21 0x2ac96c70 in propagate_event () from /usr/lib/libgtk-3.so.0
#22 0x2ac98954 in gtk_main_do_event () from /usr/lib/libgtk-3.so.0
#23 0x2b07c85c in _gdk_event_emit () from /usr/lib/libgdk-3.so.0
#24 0x2b098210 in gdk_event_source_dispatch () from /usr/lib/libgdk-3.so.0
#25 0x2b3d8de8 in g_main_dispatch (context=0x12c580) at gmain.c:3064
#26 g_main_context_dispatch (context=0x12c580) at gmain.c:3663
#27 0x2b3d90d0 in g_main_context_iterate (dispatch=1, block=<optimized out>,
context=0x12c580, 
    self=<optimized out>) at gmain.c:3734
#28 g_main_context_iterate (context=0x12c580, block=<optimized out>,
dispatch=1, self=<optimized out>)
    at gmain.c:3671
#29 0x2b3d9174 in g_main_context_iteration (context=0x12c580, may_block=1) at
gmain.c:3795
#30 0x2b2c1c40 in g_application_run (application=0xf5878, argc=<optimized out>,
argv=0x7ef33d14)
    at gapplication.c:2282
#31 0x0001583c in main ()

The problem is in the implementation of
gdk_wayland_device_window_at_position(), which relies on the GdkWindow*
GdkWaylandDeviceData.pointer_focus being set.

I wrote a patch to try and use a touch if there is one present, which stops the
crash and gives me the correct return value in my specific case, but probably
isn't a great general pupose fix.

After that, it segfaults again because of the lack of
GdkWaylandDeviceData.drop_context which is set when we get the capabilities of
the wl_seat, but only if we have a pointer. I tried fixing that by creating a
drag context based on the touch device we have. This stops any futher crashers
and errors but DnD still doesn't really work properly.

I don't really know these components too well so I thought I'd just open a bug
with my findings and hope someone else has some better ideas.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the wayland-bugs mailing list