diff --git a/src/core/display.c b/src/core/display.c index 017d5415a..34ad38330 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -1344,23 +1344,7 @@ window_raise_with_delay_callback (void *data) */ if (meta_stack_get_top (window->screen->stack) != window) { - int x, y, root_x, root_y; - Window root, child; - MetaRectangle frame_rect; - unsigned int mask; - gboolean same_screen; - gboolean point_in_window; - - meta_error_trap_push (window->display); - same_screen = XQueryPointer (window->display->xdisplay, - window->xwindow, - &root, &child, - &root_x, &root_y, &x, &y, &mask); - meta_error_trap_pop (window->display); - - meta_window_get_frame_rect (window, &frame_rect); - point_in_window = POINT_IN_RECT (root_x, root_y, frame_rect); - if (same_screen && point_in_window) + if (meta_window_has_pointer (window)) meta_window_raise (window); else meta_topic (META_DEBUG_FOCUS, diff --git a/src/core/window-private.h b/src/core/window-private.h index 5970db184..4aa8da94b 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -702,4 +702,6 @@ void meta_window_grab_op_ended (MetaWindow *window, MetaGrabOp op); void meta_window_set_alive (MetaWindow *window, gboolean is_alive); +gboolean meta_window_has_pointer (MetaWindow *window); + #endif diff --git a/src/core/window.c b/src/core/window.c index 438368392..a38422c43 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -7663,8 +7663,8 @@ window_has_pointer_x11 (MetaWindow *window) return meta_display_lookup_x_window (display, child) == window; } -static gboolean -window_has_pointer (MetaWindow *window) +gboolean +meta_window_has_pointer (MetaWindow *window) { if (meta_is_wayland_compositor ()) return window_has_pointer_wayland (window); @@ -7696,7 +7696,7 @@ window_focus_on_pointer_rest_callback (gpointer data) return TRUE; } - if (!window_has_pointer (window)) + if (!meta_window_has_pointer (window)) goto out; timestamp = meta_display_get_current_time_roundtrip (display);