Bug 116941 - Context menu shows on wrong screen with Wayland session
Summary: Context menu shows on wrong screen with Wayland session
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
6.0.2.1 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Wayland Multimonitor
  Show dependency treegraph
 
Reported: 2018-04-11 12:36 UTC by Kat
Modified: 2018-11-06 08:41 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
photo of problem (5.42 MB, image/png)
2018-04-11 12:36 UTC, Kat
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kat 2018-04-11 12:36:13 UTC
Description:
When I open Calc on the secondary display in GNOME (with Wayland), the context menu opens on the primary display. Other applications (e.g. nautilus) open the context menu in the correct place and I have seen the problem only in Calc so far.

Steps to Reproduce:
1. Open Calc on a secondary display
2. Right click anywhere to get a context menu

Actual Results:  
Context menu opens on primary screen, directly below the cursor.

Expected Results:
Context menu opens on secondary screen, next to the cursor.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.0.2.1.0+
Build ID: 6.0.2-3
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-GB (en_GB.UTF-8); Calc: group


User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0
Comment 1 Kat 2018-04-11 12:36:49 UTC
Created attachment 141285 [details]
photo of problem
Comment 2 Buovjaga 2018-04-23 09:35:36 UTC
To make it clear, you are not seeing this if you run an X session?
Comment 3 Kat 2018-04-24 09:15:05 UTC
(In reply to Buovjaga from comment #2)
> To make it clear, you are not seeing this if you run an X session?

I have not tried it while running an X session.
Comment 4 Buovjaga 2018-04-24 10:21:36 UTC
(In reply to Kat from comment #3)
> (In reply to Buovjaga from comment #2)
> > To make it clear, you are not seeing this if you run an X session?
> 
> I have not tried it while running an X session.

Ok, assuming that your multi-monitor setup is fine with X, it would be nice to hear how the context menu behaves.
Comment 5 Xisco Faulí 2018-05-31 14:40:43 UTC
Hello Kat,
Would you mind trying it in X? it would help us clarify whether it's only a Wayland problem or not...

I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' once you have test it..
Comment 6 blackdout 2018-10-12 23:29:35 UTC
So to respond to the request for information, the context menus do behave properly on Xorg.

To expand, I don't think the context menus respect the window size or window location at all on Wayland.

For example, on Wayland context menus always open down and to the right from where ever is clicked, even if that means they are on another monitor or if they are completely off the screen. I took screenshots, and can provide them if they'd help. 

This problem exists in all components, not just Calc.

Has persisted on many versions for me, but I am currently using Flatpak:

Version: 6.1.2.1
Build ID: 65905a128db06ba48db947242809d14d3f9a93fe
CPU threads: 4; OS: Linux 4.18; UI render: default; VCL: gtk3;
Comment 7 Caolán McNamara 2018-10-13 15:39:49 UTC
what version of gtk3 are we using for the flatpak builds ?

in vcl/unx/gtk/gtksalmenu.cxx we use gtk_menu_popup_at_rect when compiled against gtk >= 3.22.0 to show the menu, while for earlier versions we are using gtk_menu_popup. Knowing which branch is used might help figure out if the blame is on our side.
Comment 8 Maxim Monastirsky 2018-10-13 18:04:55 UTC
(In reply to Caolán McNamara from comment #7)
> in vcl/unx/gtk/gtksalmenu.cxx we use gtk_menu_popup_at_rect when compiled
> against gtk >= 3.22.0 to show the menu, while for earlier versions we are
> using gtk_menu_popup.
Note that the gtk_menu_popup_at_rect work is only present on master by now, it was never backported to stable branches.
Comment 9 Stephan Bergmann 2018-10-15 10:15:56 UTC
(In reply to Caolán McNamara from comment #7)
> what version of gtk3 are we using for the flatpak builds ?

it is based on org.freedesktop.Sdk//1.6, where gtk3 is at 3.22.30 now according to <https://github.com/flatpak/freedesktop-sdk-images/blob/1.6/org.freedesktop.Sdk.json.in#L2129>
Comment 10 blackdout 2018-11-05 22:06:02 UTC
Just wanted to post a follow up, appears that the fix was just pushed out in the last update from Flathub (6.1.3.2). The windows are opening much better. Some are still a little bit off screen, like occasionally the bottom row in Calc, but nothing unworkable like before. 

Thank you.
Comment 11 Xisco Faulí 2018-11-06 08:41:32 UTC
Thanks for retesting with the latest version.
Setting to RESOLVED WORKSFORME as the commit fixing this issue hasn't been identified.