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 765448 - Gear menu appears in the wrong place on Wayland
Gear menu appears in the wrong place on Wayland
Status: RESOLVED FIXED
Product: gnome-disk-utility
Classification: Core
Component: Disks UI
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-disk-utility-maint
gnome-disk-utility-maint
Depends on:
Blocks:
 
 
Reported: 2016-04-23 01:17 UTC by Kim Mason
Modified: 2016-05-02 18:07 UTC
See Also:
GNOME target: ---
GNOME version: 3.19/3.20


Attachments
Screenshot of incorrect menu placement under Wayland. (863.73 KB, image/png)
2016-04-23 01:17 UTC, Kim Mason
  Details
[PATCH] gduwindow: Attach popup menu to the window (1.07 KB, patch)
2016-05-02 09:29 UTC, Olivier Fourdan
none Details | Review
[PATCH] gduwindow: Attach popup menu to the window (1.22 KB, patch)
2016-05-02 16:35 UTC, Olivier Fourdan
committed Details | Review

Description Kim Mason 2016-04-23 01:17:11 UTC
Created attachment 326583 [details]
Screenshot of incorrect menu placement under Wayland.

The gear menu appears outside of the application (i.e. not near the gear button) on Wayland, but in the correct place on X11. See attached images.

Operating System: Fedora 24 Alpha

Details from about dialog:

gnome-disk-utility 3.20.1
UDisks 2.1.7 (built against 2.1.7)
Comment 1 Christian Stadelmann 2016-04-30 10:30:40 UTC
I'm seeing the same issue on Fedora 24 Alpha. Additionally, some warnings are printed to cli:

Gdk-Message: Window 0x55b6e25cfa10 is a temporary window without parent, application will not be able to position it on screen.
Gdk-Message: Window 0x55b6e25cfa10 is a temporary window without parent, application will not be able to position it on screen.

(gnome-disks:5974): Gdk-WARNING **: Couldn't map as window 0x55b6e25cfa10 as popup because it doesn't have a parent

This shows up every time I open the gear menu. I suggest using a GtkPopover for this menu anyway.
Comment 2 Olivier Fourdan 2016-05-02 09:29:06 UTC
Created attachment 327137 [details] [review]
[PATCH] gduwindow: Attach popup menu to the window

For Wayland surfaces to be placed, they need to be subsurfaces, thus requiring a parent surface.

Attach the generic menu to the corresponding toplevel widget so that the popup menu can be placed where expected.
Comment 3 Michael Catanzaro 2016-05-02 15:31:35 UTC
Review of attachment 327137 [details] [review]:

Thanks Oliver!

::: src/disks/gduwindow.c
@@ +3472,3 @@
   update_all (window);
 
+  gtk_menu_attach_to_widget (window->generic_menu, GTK_WIDGET(window), NULL);

Need a space before the opening parenthesis here:

GTK_WIDGET (window)
Comment 4 Olivier Fourdan 2016-05-02 16:06:37 UTC
Review of attachment 327137 [details] [review]:

Ah nope, my bad, attachment 327137 [details] [review] still needs work, I'll post an updated version...
Comment 5 Olivier Fourdan 2016-05-02 16:35:51 UTC
Created attachment 327162 [details] [review]
[PATCH] gduwindow: Attach popup menu to the window

Updated patch:
v2: Attach the menu to the top level only once in gdu_window_constructed(), fix space before parenthesis
Comment 6 Olivier Fourdan 2016-05-02 16:56:45 UTC
Comment on attachment 327162 [details] [review]
[PATCH] gduwindow: Attach popup menu to the window

attachment 327162 [details] [review] pushed as commit 9cf88e6 - gduwindow: Attach popup menu to the window
Comment 7 Olivier Fourdan 2016-05-02 16:57:54 UTC
Thanks, I pushed it to master, should I push it to 3.20 as well? Or do you want to do it when you'll make a new release for 3.20.x?
Comment 8 Michael Catanzaro 2016-05-02 18:07:46 UTC
(In reply to Olivier Fourdan from comment #7)
> Thanks, I pushed it to master, should I push it to 3.20 as well? Or do you
> want to do it when you'll make a new release for 3.20.x?

I've cherry-picked it just now. Thanks!