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 781945 - SIGSEGV dragging window on Wayland when toplevel window set_transient_for is set to another toplevel
SIGSEGV dragging window on Wayland when toplevel window set_transient_for is ...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-04-29 14:50 UTC by Dustin Spicuzza
Modified: 2017-06-02 14:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] wayland: Do not map toplevel utility as popup (1.22 KB, patch)
2017-05-02 09:52 UTC, Olivier Fourdan
committed Details | Review
[PATCH] wayland: fix xdg_surface test in move/resize drag (1.35 KB, patch)
2017-06-02 13:58 UTC, Olivier Fourdan
committed Details | Review

Description Dustin Spicuzza 2017-04-29 14:50:36 UTC
Seems to be triggered when the following is true:
* Toplevel window has set_transient_for(another toplevel window)
* Window GdkTypeHint is set to "utility"
* Dragging the incorrectly configured window

Simple pygobject testcase to trigger this: https://gist.github.com/virtuald/87e64c0610ae0204a2969efc48e7ebb4

Platform is Fedora 25, GTK+ 3.22.12
Comment 1 Christian Stadelmann 2017-04-29 18:03:32 UTC
Truncated backtrace:

  • #0 wl_proxy_marshal
    at src/wayland-client.c line 692
  • #1 zxdg_toplevel_v6_move
    at ../../gdk/wayland/xdg-shell-unstable-v6-client-protocol.h line 1332
  • #2 gdk_wayland_window_begin_move_drag
    at gdkwindow-wayland.c line 3498
  • #3 drag_gesture_update_cb
    at gtkwindow.c line 1621
  • #4 ffi_call_unix64
    at ../src/x86/unix64.S line 76
  • #5 ffi_call
    at ../src/x86/ffi64.c line 525
  • #6 g_cclosure_marshal_generic_va
    at gclosure.c line 1604
  • #7 _g_closure_invoke_va
    at gclosure.c line 867
  • #8 g_signal_emit_valist
    at gsignal.c line 3300
  • #9 g_signal_emit
    at gsignal.c line 3447
  • #10 g_cclosure_marshal_VOID__BOXEDv
    at gmarshal.c line 1950
  • #11 _g_closure_invoke_va
    at gclosure.c line 867
  • #12 g_signal_emit_valist
    at gsignal.c line 3300

Comment 2 Olivier Fourdan 2017-05-02 08:55:30 UTC
In this case here, the window is an xdg_popup which explains why it doesn't have a proxy for move()/resize() because it's not a toplevel.

This is coming from commit 28f011e / bug 759738
Comment 3 Olivier Fourdan 2017-05-02 09:07:44 UTC
Humm, actually, it's older than that, this is coming from commit a4448b7 it seems.

Basically, a "utility" window is translated as a popup if it's not a "temp" window (which is the case here)
Comment 4 Olivier Fourdan 2017-05-02 09:11:58 UTC
Right, still digging, this is actually from commit 1b58cd1 / bug 756780
Comment 5 Olivier Fourdan 2017-05-02 09:52:14 UTC
Created attachment 350853 [details] [review]
[PATCH] wayland: Do not map toplevel utility as popup

Applications can specify the type hint as utility even on toplevel
windows.

When that toplevel is also marked as a transient for another window,
GDK Wayland backend would translate that as an xdg_popup which is not
appropriate.

While utility temp windows should remain mapped as subsurfaces (such as
the ones used by treeviews), regular windows should not translate as
neither a subsurface nor an xdg_popup.
Comment 6 Olivier Fourdan 2017-06-01 12:49:07 UTC
Anyone to do a review of attachment 350853 [details] [review]? Jonas maybe?
Comment 7 Jonas Ådahl 2017-06-02 02:00:41 UTC
Review of attachment 350853 [details] [review]:

Yea, I guess that makes sense, assuming we can rely on the window type to always be used properly. Might be good to fix the miss-use error handling in move/resize code (it checks for xdg_surface, but it should rather check for xdg_toplevel)
Comment 8 Olivier Fourdan 2017-06-02 13:42:12 UTC
Comment on attachment 350853 [details] [review]
[PATCH] wayland: Do not map toplevel utility as popup

attachment 350853 [details] [review] pushed to git master as commit a84fc38 - wayland: Do not map toplevel utility as popup

attachment 350853 [details] [review] pushed to branch gtk-3-22 as commit 63e0515 - wayland: Do not map toplevel utility as popup
Comment 9 Olivier Fourdan 2017-06-02 13:58:57 UTC
Created attachment 353083 [details] [review]
[PATCH] wayland: fix xdg_surface test in move/resize drag

(In reply to Jonas Ådahl from comment #7)
> [...] Might be good to fix the miss-use error handling in move/resize code
> (it checks for xdg_surface, but it should rather check for xdg_toplevel)

begin_resize_drag() and begin_move_drag() check for xdg_surface being
not null, but those apply on xdg_toplevel so they should check for
xdg_toplevel being non-null instead.
Comment 10 Jonas Ådahl 2017-06-02 14:06:40 UTC
Review of attachment 353083 [details] [review]:

lgtm. I wonder why we didn't warn when this happened before; anyway, not to stop this improvement from landing.
Comment 11 Olivier Fourdan 2017-06-02 14:25:47 UTC
Comment on attachment 353083 [details] [review]
[PATCH] wayland: fix xdg_surface test in move/resize drag

attachment 353083 [details] [review] pushed to git master as commit 24f9d29 - wayland: fix xdg_surface test in move/resize drag

attachment 353083 [details] [review] pushed to branch gtk-3-22 as commit 2d41d77 - wayland: fix xdg_surface test in move/resize drag