diff options
author | Matthias Clasen <mclasen@redhat.com> | 2017-08-08 19:45:09 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-08-11 15:45:24 -0400 |
commit | 9859f8f69f004dd16c2fc54614c121c5852226b6 (patch) | |
tree | b273418a33395cf03fdc56b8b4beb8bcf21bda66 /gdk/win32/gdkdevice-win32.c | |
parent | c409fca703cd5e8c90b2843aa2613b34405284b9 (diff) | |
download | gtk+-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.c | 10 |
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 (); } |