From 87fe770a9b17116a44f0d5ed5ed15d40f807a82f Mon Sep 17 00:00:00 2001 From: William Wold Date: Thu, 20 Jun 2019 16:48:57 +0000 Subject: Add panel_multimonitor_get_bounds () --- mate-panel/panel-multimonitor.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'mate-panel/panel-multimonitor.c') diff --git a/mate-panel/panel-multimonitor.c b/mate-panel/panel-multimonitor.c index 1a262746..5d8c63ef 100644 --- a/mate-panel/panel-multimonitor.c +++ b/mate-panel/panel-multimonitor.c @@ -670,3 +670,21 @@ panel_multimonitor_is_at_visible_extreme (int n_monitor, } } +void +panel_multimonitor_get_bounds (GdkPoint *min, + GdkPoint *max) +{ + int i; + + g_return_if_fail (monitor_count > 0); + + min->x = min->y = INT_MAX; + max->x = max->y = INT_MIN; + + for (i = 0; i < monitor_count; i++) { + min->x = MIN (min->x, geometries[i].x); + min->y = MIN (min->y, geometries[i].y); + max->x = MAX (max->x, geometries[i].x + geometries[i].width); + max->y = MAX (max->y, geometries[i].y + geometries[i].height); + } +} -- cgit v1.2.1