GNOME Bugzilla – Bug 765474
Wayland: Dialogs without transient parent crash the inspector
Last modified: 2016-04-26 12:38:52 UTC
Created attachment 326602 [details] Testcase While it appears to be working, it will crash as soon as one tries to start the Inspector.
Created attachment 326722 [details] C code I am not very familiar with vala (I think I even disable vala at build time because of some issues in the past) so I tried with this C code instead (which I reckon should be similar), when started with: GTK_DEBUG=interactive ./dialog I get: (dialog:8492): Gdk-WARNING **: Error 22 (Invalid argument) dispatching to Wayland display. Is that the same problem you have? If so, it's a protocol error: [1238417.613] xdg_surface@26.configure(957, 547, array, 121) [1238417.634] -> xdg_surface@26.set_window_geometry(26, 23, 957, 547) [1238417.650] -> xdg_surface@26.ack_configure(121) [1238417.657] -> xdg_surface@28.set_parent(xdg_surface@26) [1238417.666] wl_keyboard@22.modifiers(123, 64, 0, 0, 0) [1238417.690] wl_keyboard@22.enter(123, wl_surface@20, array) [1238417.706] wl_data_device@18.selection(nil) [1238417.717] gtk_primary_selection_device@17.selection(nil) [1238417.967] wl_display@1.error(wl_display@1, 1, "invalid arguments for xdg_surface@28.set_parent") (dialog:8595): Gdk-WARNING **: Error 22 (Invalid argument) dispatching to Wayland display.
mutter (rightfully) complains because it doesn't "know" that object: (gnome-shell:7781): mutter-WARNING **: WL: unknown object (26), message set_parent(?o)
(In reply to Olivier Fourdan from comment #1) > Created attachment 326722 [details] > C code > > I am not very familiar with vala (I think I even disable vala at build time > because of some issues in the past) so I tried with this C code instead > (which I reckon should be similar), when started with: > > GTK_DEBUG=interactive ./dialog > > I get: > > (dialog:8492): Gdk-WARNING **: Error 22 (Invalid argument) dispatching to > Wayland display. > > Is that the same problem you have? Yes indeed. I have a fix; one moment.
Created attachment 326724 [details] [review] wayland: Clean up naming of GdkWaylandDisplay pointers The naming of pointers to GdkWaylandDisplay's were inconsistent. Running the following commands in gtk+/gdk/wayland illustrate the inconsistency: $ grep -r '\<display_wayland\>' *.[ch] | wc -l 195 $ grep -r '\<wayland_display\>' *.[ch] | wc -l 81 This patch renames all occurrences of "wayland_display" to "display_wayland". This is also consistent with naming in the X11 backend. A couple of whitespace changes were done as well in places where the rename was already done, that added line breaks to long lines that stood out.
Created attachment 326725 [details] [review] wayland: Track orphaned dialogs per display Don't track all orphaned dialogs globally, as mixing them up with each other would in most cases trigger errors when we try to pass bogus values to Wayland requests.
(In reply to Olivier Fourdan from comment #1) > Created attachment 326722 [details] > C code > > I am not very familiar with vala (I think I even disable vala at build time > because of some issues in the past) so I tried with this C code instead > (which I reckon should be similar) Sorry, that test case resulted as part of a much more complex one in vala, I should have written a small C sample. That would've been similar to your C code, yes.
Comment on attachment 326725 [details] [review] wayland: Track orphaned dialogs per display Makes sense.
Comment on attachment 326724 [details] [review] wayland: Clean up naming of GdkWaylandDisplay pointers Conflicts will be funky with my local seat refactor branch, thanks for doing this anyway :), much needed.
Attachment 326724 [details] pushed as cb73bec - wayland: Clean up naming of GdkWaylandDisplay pointers Attachment 326725 [details] pushed as 145b626 - wayland: Track orphaned dialogs per display