[gtk+/gtk-3-14] Fix mispositioned window menu in hi-dpi
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-14] Fix mispositioned window menu in hi-dpi
- Date: Thu, 23 Oct 2014 02:58:01 +0000 (UTC)
commit 79e7934eb3d85058f91742a7062afa9ebba5edb4
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Oct 22 22:49:31 2014 -0400
Fix mispositioned window menu in hi-dpi
We always want to send the position in device pixels,
so apply the window scale before sending them out.
https://bugzilla.gnome.org/show_bug.cgi?id=738955
gdk/x11/gdkwindow-x11.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index fa40f0d..c41e595 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -5685,6 +5685,7 @@ static gboolean
gdk_x11_window_show_window_menu (GdkWindow *window,
GdkEvent *event)
{
+ GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
GdkDisplay *display = GDK_WINDOW_DISPLAY (window);
GdkDevice *device;
int device_id;
@@ -5717,8 +5718,8 @@ gdk_x11_window_show_window_menu (GdkWindow *window,
xclient.window = GDK_WINDOW_XID (window);
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_GTK_SHOW_WINDOW_MENU");
xclient.data.l[0] = device_id;
- xclient.data.l[1] = x_root;
- xclient.data.l[2] = y_root;
+ xclient.data.l[1] = x_root * impl->window_scale;
+ xclient.data.l[2] = y_root * impl->window_scale;
xclient.format = 32;
XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XROOTWIN (window), False,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]