diff --git a/ChangeLog b/ChangeLog index 85709831c..b7ea7109b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-01-03 Havoc Pennington + + * 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. + 2002-12-19 Ross Burton * doc/metacity-theme.dtd: Fix a typo and loosen the requirements diff --git a/src/display.c b/src/display.c index 38bbd849e..b32ad425f 100644 --- a/src/display.c +++ b/src/display.c @@ -42,6 +42,9 @@ #ifdef HAVE_XFREE_XINERAMA #include #endif +#ifdef HAVE_RANDR +#include +#endif #include #define USE_GDK_DISPLAY diff --git a/src/window.c b/src/window.c index 594af4b37..f6fcaca85 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;