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 776055 - window menu misplaced with HiDPI
window menu misplaced with HiDPI
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2016-12-13 18:45 UTC by Lionel Landwerlin
Modified: 2017-01-03 07:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Issue (1.16 MB, video/webm)
2016-12-13 18:45 UTC, Lionel Landwerlin
  Details
gtk window menu bug (image) (126.39 KB, image/png)
2016-12-18 05:46 UTC, Mohammed Sadiq
  Details
wayland/xdg-shell: Scale window menu coordinates (1.55 KB, patch)
2016-12-30 12:52 UTC, Jonas Ådahl
committed Details | Review

Description Lionel Landwerlin 2016-12-13 18:45:14 UTC
Created attachment 341907 [details]
Issue

On HiDPI screens, the window's menu is misplaced (not under the mouse position).
It appears to be roughly the right position divided by 2, which would make sense. We probably missing scale factor somewhere in either gnome-shell or mutter.
Comment 1 Lionel Landwerlin 2016-12-14 01:31:16 UTC
This is actually a Gtk+ issue.
Comment 2 Lionel Landwerlin 2016-12-14 01:32:14 UTC
Note that to reproduce you have to press the Ctrl key and right click on the titlebar of an application.
Comment 3 Mohammed Sadiq 2016-12-18 05:46:43 UTC
Created attachment 342135 [details]
gtk window menu bug (image)

This happens in non HiDPI screens too.

How to reproduce:
1. open some application (say, gedit) -> Right click on some titlebar item that can be clicked (eg: menu button, close button, etc).
Comment 4 Jonas Ådahl 2016-12-19 10:49:57 UTC
The bug is in mutter, so moving it there.
Comment 5 Lionel Landwerlin 2016-12-28 15:53:23 UTC
Just for the record, I infered this was a Gtk+ issue because this menu seems to be triggered by the app, because it's a reaction to a click on the titlebar (I might be wrong). Even though the menu is drawn by mutter, the event and requests to draw the menu are set by Gtk+.
Comment 6 Jonas Ådahl 2016-12-29 09:03:15 UTC
(In reply to Lionel Landwerlin from comment #5)
> Just for the record, I infered this was a Gtk+ issue because this menu seems
> to be triggered by the app, because it's a reaction to a click on the
> titlebar (I might be wrong). Even though the menu is drawn by mutter, the
> event and requests to draw the menu are set by Gtk+.

You are correct! GTK+ does open the menu, but it is mutter/gnome-shell who draws it. I took quick look and determined that GTK+ did it correctly, and mutter did not, which is why I moved it. Thanks for the report either way!
Comment 7 Jonas Ådahl 2016-12-30 12:52:59 UTC
Created attachment 342624 [details] [review]
wayland/xdg-shell: Scale window menu coordinates

When the monitor the surface is on has a scale other than 1, the
coordinate of the window menu popup position needs to be scaled, as it
is reported in logical pixels, while the stage is still in physical
pixels.
Comment 8 Rui Matos 2017-01-02 12:43:18 UTC
Review of attachment 342624 [details] [review]:

indeed
Comment 9 Jonas Ådahl 2017-01-03 07:29:29 UTC
Attachment 342624 [details] pushed as 81b1192 - wayland/xdg-shell: Scale window menu coordinates