diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-03-25 20:26:59 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-03-26 18:12:55 -0400 |
commit | 7e4707642adc0152fdb9fb6d6aa6d01c605bebbf (patch) | |
tree | b92aed97146fa77b2cbc31a22ddf1c4aaf058af2 /gtk/gtkwindow.c | |
parent | 8dece0e940f52974114782ff25e8b95902a1b374 (diff) | |
download | gtk+-7e4707642adc0152fdb9fb6d6aa6d01c605bebbf.tar.gz |
gtk: Stop using gdk_device_get_position
We should always use the double variant of this api.
Diffstat (limited to 'gtk/gtkwindow.c')
-rw-r--r-- | gtk/gtkwindow.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 6a91dc6009..71be75328a 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -7261,13 +7261,13 @@ static GdkMonitor * get_monitor_containing_pointer (GtkWindow *window) { GtkWindowPrivate *priv = gtk_window_get_instance_private (window); - gint px, py; + double px, py; GdkDevice *pointer; pointer = gdk_seat_get_pointer (gdk_display_get_default_seat (priv->display)); - gdk_device_get_position (pointer, &px, &py); + gdk_device_get_position_double (pointer, &px, &py); - return gdk_display_get_monitor_at_point (priv->display, px, py); + return gdk_display_get_monitor_at_point (priv->display, round (px), round (py)); } static void @@ -7428,15 +7428,15 @@ gtk_window_compute_configure_request (GtkWindow *window, GdkRectangle area; GdkDevice *pointer; GdkMonitor *monitor; - gint px, py; + double px, py; pointer = gdk_seat_get_pointer (gdk_display_get_default_seat (priv->display)); - gdk_device_get_position (pointer, &px, &py); - monitor = gdk_display_get_monitor_at_point (priv->display, px, py); + gdk_device_get_position_double (pointer, &px, &py); + monitor = gdk_display_get_monitor_at_point (priv->display, round (px), round (py)); - x = px - w / 2; - y = py - h / 2; + x = round (px) - w / 2; + y = round (py) - h / 2; /* Clamp onto current monitor, ignoring _NET_WM_STRUT and * WM decorations. |