From 1318cd3faf3087ec5f86e558c9966874bb4166d5 Mon Sep 17 00:00:00 2001 From: Dor Askayo Date: Sat, 11 Jun 2022 12:50:02 +0300 Subject: [PATCH] window: Allow checking if a window covers a rect This is just a small function to improve the readability of the code. Part-of: --- src/core/window-private.h | 3 +++ src/core/window.c | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/src/core/window-private.h b/src/core/window-private.h index ed1b60a43..2a6c6a799 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -707,6 +707,9 @@ void meta_window_get_session_geometry (MetaWindow *window, int *width, int *height); +gboolean meta_window_geometry_contains_rect (MetaWindow *window, + MtkRectangle *rect); + void meta_window_update_appears_focused (MetaWindow *window); void meta_window_set_focused_internal (MetaWindow *window, diff --git a/src/core/window.c b/src/core/window.c index 3bdd2e451..198cc09cf 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -4281,6 +4281,14 @@ meta_window_get_session_geometry (MetaWindow *window, window->size_hints.height_inc; } +gboolean +meta_window_geometry_contains_rect (MetaWindow *window, + MtkRectangle *rect) +{ + return mtk_rectangle_contains_rect (&window->rect, + rect); +} + /** * meta_window_get_buffer_rect: * @window: a #MetaWindow