mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
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.
This commit is contained in:
parent
d9a2207ebe
commit
f8b2f6ca5c
@ -1,3 +1,11 @@
|
|||||||
|
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.
|
||||||
|
|
||||||
2002-12-19 Ross Burton <ross@burtonini.com>
|
2002-12-19 Ross Burton <ross@burtonini.com>
|
||||||
|
|
||||||
* doc/metacity-theme.dtd: Fix a typo and loosen the requirements
|
* doc/metacity-theme.dtd: Fix a typo and loosen the requirements
|
||||||
|
@ -42,6 +42,9 @@
|
|||||||
#ifdef HAVE_XFREE_XINERAMA
|
#ifdef HAVE_XFREE_XINERAMA
|
||||||
#include <X11/extensions/Xinerama.h>
|
#include <X11/extensions/Xinerama.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_RANDR
|
||||||
|
#include <X11/extensions/Xrandr.h>
|
||||||
|
#endif
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define USE_GDK_DISPLAY
|
#define USE_GDK_DISPLAY
|
||||||
|
36
src/window.c
36
src/window.c
@ -2631,8 +2631,8 @@ meta_window_move_resize_now (MetaWindow *window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
check_maximize_to_xinerama (MetaWindow *window,
|
check_maximize_to_work_area (MetaWindow *window,
|
||||||
const MetaXineramaScreenInfo *xinerama)
|
const MetaRectangle *work_area)
|
||||||
{
|
{
|
||||||
/* If we now fill the screen, maximize.
|
/* If we now fill the screen, maximize.
|
||||||
* the point here is that fill horz + fill vert = maximized
|
* 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);
|
meta_window_get_outer_rect (window, &rect);
|
||||||
|
|
||||||
if ( rect.x >= xinerama->x_origin &&
|
if ( rect.x >= work_area->x &&
|
||||||
rect.y >= xinerama->y_origin &&
|
rect.y >= work_area->y &&
|
||||||
(((xinerama->width - xinerama->x_origin) - rect.width) <
|
(((work_area->width - work_area->x) - rect.width) <
|
||||||
window->size_hints.width_inc) &&
|
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) )
|
window->size_hints.height_inc) )
|
||||||
meta_window_maximize (window);
|
meta_window_maximize (window);
|
||||||
}
|
}
|
||||||
@ -2656,7 +2656,7 @@ check_maximize_to_xinerama (MetaWindow *window,
|
|||||||
void
|
void
|
||||||
meta_window_fill_horizontal (MetaWindow *window)
|
meta_window_fill_horizontal (MetaWindow *window)
|
||||||
{
|
{
|
||||||
const MetaXineramaScreenInfo *xinerama;
|
MetaRectangle work_area;
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
|
|
||||||
meta_window_get_user_position (window, &x, &y);
|
meta_window_get_user_position (window, &x, &y);
|
||||||
@ -2664,12 +2664,10 @@ meta_window_fill_horizontal (MetaWindow *window)
|
|||||||
w = window->rect.width;
|
w = window->rect.width;
|
||||||
h = window->rect.height;
|
h = window->rect.height;
|
||||||
|
|
||||||
xinerama = meta_screen_get_xinerama_for_window (window->screen,
|
meta_window_get_work_area (window, TRUE, &work_area);
|
||||||
window);
|
|
||||||
|
|
||||||
|
x = work_area.x;
|
||||||
x = xinerama->x_origin;
|
w = work_area.width;
|
||||||
w = xinerama->width;
|
|
||||||
|
|
||||||
if (window->frame != NULL)
|
if (window->frame != NULL)
|
||||||
{
|
{
|
||||||
@ -2680,13 +2678,13 @@ meta_window_fill_horizontal (MetaWindow *window)
|
|||||||
meta_window_move_resize (window, TRUE,
|
meta_window_move_resize (window, TRUE,
|
||||||
x, y, w, h);
|
x, y, w, h);
|
||||||
|
|
||||||
check_maximize_to_xinerama (window, xinerama);
|
check_maximize_to_work_area (window, &work_area);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_window_fill_vertical (MetaWindow *window)
|
meta_window_fill_vertical (MetaWindow *window)
|
||||||
{
|
{
|
||||||
const MetaXineramaScreenInfo *xinerama;
|
MetaRectangle work_area;
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
|
|
||||||
meta_window_get_user_position (window, &x, &y);
|
meta_window_get_user_position (window, &x, &y);
|
||||||
@ -2694,12 +2692,10 @@ meta_window_fill_vertical (MetaWindow *window)
|
|||||||
w = window->rect.width;
|
w = window->rect.width;
|
||||||
h = window->rect.height;
|
h = window->rect.height;
|
||||||
|
|
||||||
xinerama = meta_screen_get_xinerama_for_window (window->screen,
|
meta_window_get_work_area (window, TRUE, &work_area);
|
||||||
window);
|
|
||||||
|
|
||||||
|
y = work_area.y;
|
||||||
y = xinerama->y_origin;
|
h = work_area.height;
|
||||||
h = xinerama->height;
|
|
||||||
|
|
||||||
if (window->frame != NULL)
|
if (window->frame != NULL)
|
||||||
{
|
{
|
||||||
@ -2710,7 +2706,7 @@ meta_window_fill_vertical (MetaWindow *window)
|
|||||||
meta_window_move_resize (window, TRUE,
|
meta_window_move_resize (window, TRUE,
|
||||||
x, y, w, h);
|
x, y, w, h);
|
||||||
|
|
||||||
check_maximize_to_xinerama (window, xinerama);
|
check_maximize_to_work_area (window, &work_area);
|
||||||
}
|
}
|
||||||
|
|
||||||
static guint move_resize_idle = 0;
|
static guint move_resize_idle = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user