diff --git a/src/core/window-private.h b/src/core/window-private.h index ad1dd5a86..8d2d4a020 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -912,4 +912,8 @@ void meta_window_clear_queued (MetaWindow *window); void meta_window_update_layout (MetaWindow *window); +gboolean meta_window_calculate_bounds (MetaWindow *window, + int *bounds_width, + int *bounds_height); + #endif diff --git a/src/core/window.c b/src/core/window.c index 4a0c6242e..595177b9a 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -8555,3 +8555,29 @@ meta_window_get_alive (MetaWindow *window) { return window->is_alive; } + +gboolean +meta_window_calculate_bounds (MetaWindow *window, + int *bounds_width, + int *bounds_height) +{ + MetaLogicalMonitor *main_monitor; + + main_monitor = meta_window_get_main_logical_monitor (window); + if (main_monitor) + { + MetaRectangle work_area; + + meta_window_get_work_area_for_logical_monitor (window, + main_monitor, + &work_area); + + *bounds_width = work_area.width; + *bounds_height = work_area.height; + return TRUE; + } + else + { + return FALSE; + } +}