[gtk/wip/matthiasc/popup2: 105/108] gdk: Stop using gdk_surface_get_device_position
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/popup2: 105/108] gdk: Stop using gdk_surface_get_device_position
- Date: Mon, 25 Mar 2019 21:02:15 +0000 (UTC)
commit ae1f73f2806a0d652cb0d3b46453a9cd718150fe
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Mar 25 08:32:10 2019 -0400
gdk: Stop using gdk_surface_get_device_position
Use the double variant instead.
gdk/wayland/gdksurface-wayland.c | 9 +++++++--
gdk/win32/gdkdevice-win32.c | 8 ++++----
2 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index c4d2643256..1f4cfbafb0 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -2441,8 +2441,13 @@ gdk_wayland_surface_map (GdkSurface *surface)
* position of the device that holds the grab.
*/
if (impl->position_method == POSITION_METHOD_NONE && grab_device)
- gdk_surface_get_device_position (transient_for, grab_device,
- &surface->x, &surface->y, NULL);
+ {
+ double px, py;
+ gdk_surface_get_device_position_double (transient_for, grab_device,
+ &px, &py, NULL);
+ surface->x = round (px);
+ surface->y = round (py);
+ }
}
else
{
diff --git a/gdk/win32/gdkdevice-win32.c b/gdk/win32/gdkdevice-win32.c
index 49549e19ba..6e878c7a82 100644
--- a/gdk/win32/gdkdevice-win32.c
+++ b/gdk/win32/gdkdevice-win32.c
@@ -45,14 +45,14 @@ gdk_device_win32_get_state (GdkDevice *device,
gdouble *axes,
GdkModifierType *mask)
{
- gint x_int, y_int;
+ double x, y;
- gdk_surface_get_device_position (window, device, &x_int, &y_int, mask);
+ gdk_surface_get_device_position_double (window, device, &x, &y, mask);
if (axes)
{
- axes[0] = x_int;
- axes[1] = y_int;
+ axes[0] = round (x);
+ axes[1] = round (y);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]