summaryrefslogtreecommitdiff
path: root/gdk/win32/gdkdevice-win32.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2017-08-08 19:45:09 -0400
committerMatthias Clasen <mclasen@redhat.com>2017-08-11 15:45:24 -0400
commit9859f8f69f004dd16c2fc54614c121c5852226b6 (patch)
treeb273418a33395cf03fdc56b8b4beb8bcf21bda66 /gdk/win32/gdkdevice-win32.c
parentc409fca703cd5e8c90b2843aa2613b34405284b9 (diff)
downloadgtk+-9859f8f69f004dd16c2fc54614c121c5852226b6.tar.gz
Allow passing a NULL window to gdk_device_query_state
Interpret NULL as "root window" here - we only have one screen nowadays, so there is no choice involved, and this will let us avoid dealing with the root window in the fontend code.
Diffstat (limited to 'gdk/win32/gdkdevice-win32.c')
-rw-r--r--gdk/win32/gdkdevice-win32.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/gdk/win32/gdkdevice-win32.c b/gdk/win32/gdkdevice-win32.c
index 190372de2d..fa74db6a75 100644
--- a/gdk/win32/gdkdevice-win32.c
+++ b/gdk/win32/gdkdevice-win32.c
@@ -100,7 +100,6 @@ get_current_mask (void)
static void
gdk_device_win32_query_state (GdkDevice *device,
GdkWindow *window,
- GdkWindow **root_window,
GdkWindow **child_window,
gdouble *root_x,
gdouble *root_y,
@@ -108,12 +107,12 @@ gdk_device_win32_query_state (GdkDevice *device,
gdouble *win_y,
GdkModifierType *mask)
{
- GdkScreen *screen;
POINT point;
HWND hwnd, hwndc;
GdkWindowImplWin32 *impl;
- screen = gdk_window_get_screen (window);
+ if (window == NULL)
+ window = gdk_get_default_root_window ();
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
hwnd = GDK_WINDOW_HWND (window);
@@ -133,7 +132,7 @@ gdk_device_win32_query_state (GdkDevice *device,
if (win_y)
*win_y = point.y / impl->window_scale;
- if (window == gdk_screen_get_root_window (screen))
+ if (window == gdk_get_default_root_window ())
{
if (win_x)
*win_x += _gdk_offset_x;
@@ -158,9 +157,6 @@ gdk_device_win32_query_state (GdkDevice *device,
*child_window = NULL; /* Direct child unknown to gdk */
}
- if (root_window)
- *root_window = gdk_screen_get_root_window (screen);
-
if (mask)
*mask = get_current_mask ();
}