summaryrefslogtreecommitdiff
path: root/src/xmenu.c
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2017-07-16 16:42:26 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2017-07-17 16:58:57 +0200
commit4198b4d985db77ad6ae372fa048250e93de5013c (patch)
tree7f2744d0b5cac4d4e1915c1c8abaa0bfa5a2c7fb /src/xmenu.c
parent8729634c511cd564353ff17eb6dc06e87d081035 (diff)
downloademacs-4198b4d985db77ad6ae372fa048250e93de5013c.tar.gz
Get positions of menus and tooltips right on HiDPI
* src/gtkutil.c (xg_get_scale): New function. (xg_show_tooltip): Use it. * src/xmenu.c (create_and_show_popup_menu): Put menus in the right place.
Diffstat (limited to 'src/xmenu.c')
-rw-r--r--src/xmenu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/xmenu.c b/src/xmenu.c
index 6c8a0c506cc..64df151b289 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1271,6 +1271,11 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv,
/* Child of win. */
&dummy_window);
+#ifdef HAVE_GTK3
+ /* Use window scaling factor to adjust position for hidpi screens. */
+ x /= xg_get_scale (f);
+ y /= xg_get_scale (f);
+#endif
unblock_input ();
popup_x_y.x = x;
popup_x_y.y = y;