diff options
author | William Wold <[email protected]> | 2019-06-20 16:48:57 +0000 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-06-24 15:50:45 +0200 |
commit | 87fe770a9b17116a44f0d5ed5ed15d40f807a82f (patch) | |
tree | 83b0846255cd4894fcec3a34e311a3558acc3596 | |
parent | 2cdd4ea85f21db8ec7409e2fa3c3009bd123bd4b (diff) | |
download | mate-panel-87fe770a9b17116a44f0d5ed5ed15d40f807a82f.tar.bz2 mate-panel-87fe770a9b17116a44f0d5ed5ed15d40f807a82f.tar.xz |
Add panel_multimonitor_get_bounds ()
-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__ */ |