diff options
-rw-r--r-- | mate-panel/panel-multimonitor.c | 18 | ||||
-rw-r--r-- | mate-panel/panel-multimonitor.h | 2 |
2 files changed, 20 insertions, 0 deletions
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); + } +} diff --git a/mate-panel/panel-multimonitor.h b/mate-panel/panel-multimonitor.h index ea262b17..8829a5f3 100644 --- a/mate-panel/panel-multimonitor.h +++ b/mate-panel/panel-multimonitor.h @@ -45,5 +45,7 @@ void panel_multimonitor_is_at_visible_extreme (int monitor_id, gboolean *rightmost, gboolean *topmost, gboolean *bottommost); +void panel_multimonitor_get_bounds (GdkPoint *min, + GdkPoint *max); #endif /* __PANEL_MULTIMONITOR_H__ */ |