summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-06-08 06:07:21 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-06-08 06:07:21 +0000
commit2b780e5486221f5b33017b09de6ae7228252e071 (patch)
tree63c257511726995d29fac9a82bfa46b4dd5b3eca /src/window.c
parent9e8800561e0f8c00a342a8f77289030c0590e1fb (diff)
downloadmetacity-2b780e5486221f5b33017b09de6ae7228252e071.tar.gz
metacity-2b780e5486221f5b33017b09de6ae7228252e071.tar.bz2
short-circuit the "only one xinerama" case, and use outer rect of window
2002-06-08 Havoc Pennington <hp@pobox.com> * src/screen.c (meta_screen_get_xinerama_for_window): short-circuit the "only one xinerama" case, and use outer rect of window instead of window->rect, so we get root window coords. * src/theme.c (meta_frame_layout_get_borders): if fullscreen all frame edges are zero-width. * src/frame.c (meta_frame_get_flags): init fullscreen flag. * src/common.h (enum): add META_FRAME_FULLSCREEN frame flag * src/place.c: fix up calls to meta_window_get_work_area * src/window.c (meta_window_get_work_area): add an arg for whether the work area is for the screen or the xinerama subscreen. (constrain_position): fix up calls to meta_window_get_work_area (constrain_size): ditto * src/screen.c (meta_screen_new): add METACITY_DEBUG_XINERAMA environment variable which simulates xinerama on a single head.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c45
1 files changed, 30 insertions, 15 deletions
diff --git a/src/window.c b/src/window.c
index ca26a25..d9a238a 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4983,7 +4983,7 @@ constrain_size (MetaWindow *window,
#define FLOOR(value, base) ( ((int) ((value) / (base))) * (base) )
- meta_window_get_work_area (window, &work_area);
+ meta_window_get_work_area (window, TRUE, &work_area);
/* Get the allowed size ranges, considering maximized, etc. */
if (window->fullscreen)
@@ -5112,11 +5112,7 @@ constrain_position (MetaWindow *window,
int y,
int *new_x,
int *new_y)
-{
- MetaRectangle work_area;
-
- meta_window_get_work_area (window, &work_area);
-
+{
/* frame member variables should NEVER be used in here, only
* MetaFrameGeometry
*/
@@ -5160,6 +5156,10 @@ constrain_position (MetaWindow *window,
}
else if (window->maximized)
{
+ MetaRectangle work_area;
+
+ meta_window_get_work_area (window, TRUE, &work_area);
+
x = work_area.x;
y = work_area.y;
if (window->frame)
@@ -5183,6 +5183,9 @@ constrain_position (MetaWindow *window,
int nw_x, nw_y;
int se_x, se_y;
int offscreen_w, offscreen_h;
+ MetaRectangle work_area;
+
+ meta_window_get_work_area (window, FALSE, &work_area);
/* (FIXME instead of TITLEBAR_LENGTH_ONSCREEN, get the actual
* size of the menu control?).
@@ -5676,25 +5679,37 @@ meta_window_set_gravity (MetaWindow *window,
void
meta_window_get_work_area (MetaWindow *window,
+ gboolean for_current_xinerama,
MetaRectangle *area)
{
MetaRectangle space_area;
GList *tmp;
- const MetaXineramaScreenInfo *xinerama;
int left_strut;
int right_strut;
int top_strut;
int bottom_strut;
- xinerama = meta_screen_get_xinerama_for_window (window->screen,
- window);
-
- left_strut = xinerama->x_origin;
- right_strut = window->screen->width - xinerama->width - xinerama->x_origin;
- top_strut = xinerama->y_origin;
- bottom_strut = window->screen->height - xinerama->height - xinerama->y_origin;
-
+ if (for_current_xinerama)
+ {
+ const MetaXineramaScreenInfo *xinerama;
+
+ xinerama = meta_screen_get_xinerama_for_window (window->screen,
+ window);
+
+ left_strut = xinerama->x_origin;
+ right_strut = window->screen->width - xinerama->width - xinerama->x_origin;
+ top_strut = xinerama->y_origin;
+ bottom_strut = window->screen->height - xinerama->height - xinerama->y_origin;
+ }
+ else
+ {
+ left_strut = 0;
+ right_strut = 0;
+ top_strut = 0;
+ bottom_strut = 0;
+ }
+
tmp = meta_window_get_workspaces (window);
while (tmp != NULL)