summaryrefslogtreecommitdiff
path: root/gdk/gdkdevice.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-01-03 17:42:35 +0100
committerBenjamin Otte <otte@redhat.com>2011-01-03 17:44:24 +0100
commitae7e5fc2d19445ba55832888adcc7c24aeb17323 (patch)
tree1763812b97fea6cd415eb16e9997ff6f132e343f /gdk/gdkdevice.c
parent6c39cade165d023630d7694e499021088a995634 (diff)
downloadgtk+-ae7e5fc2d19445ba55832888adcc7c24aeb17323.tar.gz
gdk: Simplify code
Move a previous vfunc into the only caller.
Diffstat (limited to 'gdk/gdkdevice.c')
-rw-r--r--gdk/gdkdevice.c46
1 files changed, 13 insertions, 33 deletions
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index bd529cbe89..1b772bae3b 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -443,36 +443,6 @@ gdk_device_get_position (GdkDevice *device,
*y = tmp_y;
}
-static GdkWindow *
-gdk_display_real_get_window_at_device_position (GdkDisplay *display,
- GdkDevice *device,
- gint *win_x,
- gint *win_y)
-{
- GdkWindow *window;
- gint x, y;
-
- window = _gdk_device_window_at_position (device, &x, &y, NULL, FALSE);
-
- /* This might need corrections, as the native window returned
- may contain client side children */
- if (window)
- {
- double xx, yy;
-
- window = _gdk_window_find_descendant_at (window,
- x, y,
- &xx, &yy);
- x = floor (xx + 0.5);
- y = floor (yy + 0.5);
- }
-
- *win_x = x;
- *win_y = y;
-
- return window;
-}
-
/**
* gdk_device_get_window_at_position:
* @device: pointer #GdkDevice to query info to.
@@ -493,16 +463,26 @@ gdk_device_get_window_at_position (GdkDevice *device,
gint *win_x,
gint *win_y)
{
- GdkDisplay *display;
gint tmp_x, tmp_y;
GdkWindow *window;
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
- display = gdk_device_get_display (device);
+ window = _gdk_device_window_at_position (device, &tmp_x, &tmp_y, NULL, FALSE);
+
+ /* This might need corrections, as the native window returned
+ may contain client side children */
+ if (window)
+ {
+ double xx, yy;
- window = gdk_display_real_get_window_at_device_position (display, device, &tmp_x, &tmp_y);
+ window = _gdk_window_find_descendant_at (window,
+ tmp_x, tmp_y,
+ &xx, &yy);
+ tmp_x = floor (xx + 0.5);
+ tmp_y = floor (yy + 0.5);
+ }
if (win_x)
*win_x = tmp_x;