From 4d7d44c717d291ceab15980691c5a0151fba844d Mon Sep 17 00:00:00 2001 From: John Ralls Date: Tue, 23 Apr 2019 13:43:44 -0700 Subject: [PATCH] Replace obsolete GdkScreen-based method of finding the toplevel at point. With the more current GdkDisplay function. Also separate the if statements with blank lines. --- gdk/quartz/gdkevents-quartz.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c index 8e8f1ef183..04ac6e1f5a 100644 --- a/gdk/quartz/gdkevents-quartz.c +++ b/gdk/quartz/gdkevents-quartz.c @@ -608,16 +608,23 @@ find_toplevel_under_pointer (GdkDisplay *display, info = _gdk_display_get_pointer_info (display, gdk_seat_get_pointer (seat)); toplevel = info->toplevel_under_pointer; + if (!(toplevel && WINDOW_IS_TOPLEVEL (toplevel))) { gint gdk_x = 0, gdk_y = 0; _gdk_quartz_window_nspoint_to_gdk_xy (screen_point, &gdk_x, &gdk_y); - toplevel = _gdk_quartz_window_find_child (_gdk_root, gdk_x, gdk_y, TRUE); + toplevel = gdk_display_get_window_at_pointer (display, &gdk_x, &gdk_y); + + if (toplevel && ! WINDOW_IS_TOPLEVEL (toplevel)) + toplevel = gdk_window_get_toplevel (toplevel); + if (toplevel) info->toplevel_under_pointer = g_object_ref (toplevel); else info->toplevel_under_pointer = NULL; + } + if (toplevel) { get_window_point_from_screen_point (toplevel, screen_point, x, y);