diff options
author | Thomas James Alexander Thurman <tthurman@src.gnome.org> | 2008-11-17 02:57:20 +0000 |
---|---|---|
committer | Thomas James Alexander Thurman <tthurman@src.gnome.org> | 2008-11-17 02:57:20 +0000 |
commit | a06d96316e046e5298a54b8eff13081560ca0cda (patch) | |
tree | 62986a55b2550421fc9074c545563551d6746ec5 /src/core/boxes.c | |
parent | 6e8c233d6a5f7232186c225748e4620af784f948 (diff) | |
download | metacity-a06d96316e046e5298a54b8eff13081560ca0cda.tar.gz |
This change adds support for the new _NET_WM_FULLSCREEN_MONITORS
property and client message. This allows client applications to request
that a fullscreen window cover more than one monitor.
* src/include/boxes.h:
* src/core/boxes.c: Add meta_rectangle_union
* src/core/window-private.h:
* src/core/window.c:
(meta_window_new_with_attrs, meta_window_free, set_net_wm_state,
meta_window_update_fullscreen_monitors, meta_window_client_message): Add
MetaWindow property to store fullscreen monitors field, update
_NET_WM_FULLSCREEN_MONITORS property on windows, and handle client
message.
* src/core/atomnames.h: Add _NET_WM_FULLSCREEN_MONITORS atom.
* src/core/constraints.c (setup_constraint_info): If
_NET_WM_FULLSCREEN_MONITORS is interesting, use the data stored in
MetaWindow::fullscreen_monitors to determine the fullscreen area instead
of the basic xinerama_info area.
svn path=/trunk/; revision=4021
Diffstat (limited to 'src/core/boxes.c')
-rw-r--r-- | src/core/boxes.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/core/boxes.c b/src/core/boxes.c index 21a9e2be..139f1736 100644 --- a/src/core/boxes.c +++ b/src/core/boxes.c @@ -197,6 +197,40 @@ meta_rectangle_equal (const MetaRectangle *src1, (src1->height == src2->height)); } +void +meta_rectangle_union (const MetaRectangle *rect1, + const MetaRectangle *rect2, + MetaRectangle *dest) +{ + int dest_x, dest_y; + int dest_w, dest_h; + + dest_x = rect1->x; + dest_y = rect1->y; + dest_w = rect1->width; + dest_h = rect1->height; + + if (rect2->x < dest_x) + { + dest_w += dest_x - rect2->x; + dest_x = rect2->x; + } + if (rect2->y < dest_y) + { + dest_h += dest_y - rect2->y; + dest_y = rect2->y; + } + if (rect2->x + rect2->width > dest_x + dest_w) + dest_w = rect2->x + rect2->width - dest_x; + if (rect2->y + rect2->height > dest_y + dest_h) + dest_h = rect2->y + rect2->height - dest_y; + + dest->x = dest_x; + dest->y = dest_y; + dest->width = dest_w; + dest->height = dest_h; +} + gboolean meta_rectangle_overlap (const MetaRectangle *rect1, const MetaRectangle *rect2) |