summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-01-03 19:06:53 +0000
committerHavoc Pennington <hp@src.gnome.org>2003-01-03 19:06:53 +0000
commitf8b2f6ca5cf8dbba02feacf5036c0ff46bbd027f (patch)
tree523618a897f70453253b16b567bbebd9b6c7872c /src
parentd9a2207ebe6cbdac1f2d0608a757d29bb8351c46 (diff)
downloadmetacity-f8b2f6ca5cf8dbba02feacf5036c0ff46bbd027f.tar.gz
include the Xrandr header file
2003-01-03 Havoc Pennington <hp@redhat.com> * src/display.c: include the Xrandr header file * src/window.c (meta_window_fill_horizontal) (meta_window_fill_vertical): maximize to work area, not entire screen. doh.
Diffstat (limited to 'src')
-rw-r--r--src/display.c3
-rw-r--r--src/window.c38
2 files changed, 20 insertions, 21 deletions
diff --git a/src/display.c b/src/display.c
index 38bbd849..b32ad425 100644
--- a/src/display.c
+++ b/src/display.c
@@ -42,6 +42,9 @@
#ifdef HAVE_XFREE_XINERAMA
#include <X11/extensions/Xinerama.h>
#endif
+#ifdef HAVE_RANDR
+#include <X11/extensions/Xrandr.h>
+#endif
#include <string.h>
#define USE_GDK_DISPLAY
diff --git a/src/window.c b/src/window.c
index 594af4b3..f6fcaca8 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2631,8 +2631,8 @@ meta_window_move_resize_now (MetaWindow *window)
}
static void
-check_maximize_to_xinerama (MetaWindow *window,
- const MetaXineramaScreenInfo *xinerama)
+check_maximize_to_work_area (MetaWindow *window,
+ const MetaRectangle *work_area)
{
/* If we now fill the screen, maximize.
* the point here is that fill horz + fill vert = maximized
@@ -2644,11 +2644,11 @@ check_maximize_to_xinerama (MetaWindow *window,
meta_window_get_outer_rect (window, &rect);
- if ( rect.x >= xinerama->x_origin &&
- rect.y >= xinerama->y_origin &&
- (((xinerama->width - xinerama->x_origin) - rect.width) <
+ if ( rect.x >= work_area->x &&
+ rect.y >= work_area->y &&
+ (((work_area->width - work_area->x) - rect.width) <
window->size_hints.width_inc) &&
- (((xinerama->height - xinerama->y_origin) - rect.height) <
+ (((work_area->height - work_area->y) - rect.height) <
window->size_hints.height_inc) )
meta_window_maximize (window);
}
@@ -2656,7 +2656,7 @@ check_maximize_to_xinerama (MetaWindow *window,
void
meta_window_fill_horizontal (MetaWindow *window)
{
- const MetaXineramaScreenInfo *xinerama;
+ MetaRectangle work_area;
int x, y, w, h;
meta_window_get_user_position (window, &x, &y);
@@ -2664,12 +2664,10 @@ meta_window_fill_horizontal (MetaWindow *window)
w = window->rect.width;
h = window->rect.height;
- xinerama = meta_screen_get_xinerama_for_window (window->screen,
- window);
-
-
- x = xinerama->x_origin;
- w = xinerama->width;
+ meta_window_get_work_area (window, TRUE, &work_area);
+
+ x = work_area.x;
+ w = work_area.width;
if (window->frame != NULL)
{
@@ -2680,26 +2678,24 @@ meta_window_fill_horizontal (MetaWindow *window)
meta_window_move_resize (window, TRUE,
x, y, w, h);
- check_maximize_to_xinerama (window, xinerama);
+ check_maximize_to_work_area (window, &work_area);
}
void
meta_window_fill_vertical (MetaWindow *window)
{
- const MetaXineramaScreenInfo *xinerama;
+ MetaRectangle work_area;
int x, y, w, h;
meta_window_get_user_position (window, &x, &y);
w = window->rect.width;
h = window->rect.height;
-
- xinerama = meta_screen_get_xinerama_for_window (window->screen,
- window);
+ meta_window_get_work_area (window, TRUE, &work_area);
- y = xinerama->y_origin;
- h = xinerama->height;
+ y = work_area.y;
+ h = work_area.height;
if (window->frame != NULL)
{
@@ -2710,7 +2706,7 @@ meta_window_fill_vertical (MetaWindow *window)
meta_window_move_resize (window, TRUE,
x, y, w, h);
- check_maximize_to_xinerama (window, xinerama);
+ check_maximize_to_work_area (window, &work_area);
}
static guint move_resize_idle = 0;