mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
...
This commit is contained in:
parent
90829a15cc
commit
482640b831
@ -182,7 +182,8 @@ meta_frame_get_flags (MetaFrame *frame)
|
||||
if (frame->window->has_move_func)
|
||||
flags |= META_FRAME_ALLOWS_MOVE;
|
||||
|
||||
if (frame->window->has_resize_func)
|
||||
if (frame->window->has_resize_func &&
|
||||
!frame->window->maximized)
|
||||
{
|
||||
if (frame->window->size_hints.min_width <
|
||||
frame->window->size_hints.max_width)
|
||||
|
26
src/frames.c
26
src/frames.c
@ -719,29 +719,35 @@ meta_frames_manage_window (MetaFrames *frames,
|
||||
while (i < 4)
|
||||
{
|
||||
int result;
|
||||
|
||||
result = XGrabButton (gdk_display, i, Mod1Mask,
|
||||
xwindow, False,
|
||||
ButtonPressMask | ButtonReleaseMask |
|
||||
PointerMotionMask | PointerMotionHintMask,
|
||||
GrabModeAsync, GrabModeAsync,
|
||||
False, None);
|
||||
|
||||
gdk_error_trap_push ();
|
||||
XGrabButton (gdk_display, i, Mod1Mask,
|
||||
xwindow, False,
|
||||
ButtonPressMask | ButtonReleaseMask |
|
||||
PointerMotionMask | PointerMotionHintMask,
|
||||
GrabModeAsync, GrabModeAsync,
|
||||
False, None);
|
||||
XSync (gdk_display, False);
|
||||
result = gdk_error_trap_pop ();
|
||||
|
||||
if (result != Success)
|
||||
meta_warning ("Failed to grab button %d with Mod1Mask for frame 0x%lx error code %d\n",
|
||||
i, xwindow, result);
|
||||
|
||||
#if 0
|
||||
|
||||
#if 1
|
||||
/* This is just for debugging, since I end up moving
|
||||
* the Xnest otherwise ;-)
|
||||
*/
|
||||
gdk_error_trap_push ();
|
||||
result = XGrabButton (gdk_display, i, ControlMask,
|
||||
xwindow, False,
|
||||
ButtonPressMask | ButtonReleaseMask |
|
||||
PointerMotionMask | PointerMotionHintMask,
|
||||
GrabModeAsync, GrabModeAsync,
|
||||
False, None);
|
||||
|
||||
XSync (gdk_display, False);
|
||||
result = gdk_error_trap_pop ();
|
||||
|
||||
if (result != Success)
|
||||
meta_warning ("Failed to grab button %d with ControlMask for frame 0x%lx error code %d\n",
|
||||
i, xwindow, result);
|
||||
|
@ -16,7 +16,7 @@ fi
|
||||
|
||||
if test -z "$ONLY_WM"; then
|
||||
Xnest -ac :1 -scrns $SCREENS -geometry 640x400 -bw 15 &
|
||||
usleep 100000
|
||||
usleep 500000
|
||||
|
||||
if test $CLIENTS != 0; then
|
||||
for I in `seq 1 $CLIENTS`; do
|
||||
|
65
src/window.c
65
src/window.c
@ -3300,8 +3300,11 @@ constrain_position (MetaWindow *window,
|
||||
{
|
||||
int nw_x, nw_y;
|
||||
int se_x, se_y;
|
||||
|
||||
/* find furthest northwest corner */
|
||||
int offscreen_w, offscreen_h;
|
||||
|
||||
/* find furthest northwest point the window can occupy,
|
||||
* to disallow moving titlebar off the top or left
|
||||
*/
|
||||
nw_x = window->screen->active_workspace->workarea.x;
|
||||
nw_y = window->screen->active_workspace->workarea.y;
|
||||
if (window->frame)
|
||||
@ -3310,18 +3313,36 @@ constrain_position (MetaWindow *window,
|
||||
nw_y += fgeom->top_height;
|
||||
}
|
||||
|
||||
/* don't allow moving titlebar off the top or left */
|
||||
if (x < nw_x)
|
||||
x = nw_x;
|
||||
if (y < nw_y)
|
||||
y = nw_y;
|
||||
|
||||
/* keep titlebar on bottom right as well (but not entire window) */
|
||||
/* find bottom-right corner of workarea */
|
||||
se_x = window->screen->active_workspace->workarea.x +
|
||||
window->screen->active_workspace->workarea.width;
|
||||
se_y = window->screen->active_workspace->workarea.y +
|
||||
window->screen->active_workspace->workarea.height;
|
||||
|
||||
/* if the window's size exceeds the screen size,
|
||||
* we allow it to go off the top/left far enough
|
||||
* to get the right/bottom edges onscreen.
|
||||
*/
|
||||
offscreen_w = nw_x + window->rect.width;
|
||||
offscreen_h = nw_y + window->rect.height;
|
||||
if (window->frame)
|
||||
{
|
||||
offscreen_w += fgeom->right_width;
|
||||
offscreen_h += fgeom->bottom_height;
|
||||
}
|
||||
|
||||
offscreen_w = offscreen_w - se_x;
|
||||
offscreen_h = offscreen_h - se_y;
|
||||
|
||||
/* Now change NW limit to reflect amount offscreen in SE direction */
|
||||
if (offscreen_w > 0)
|
||||
nw_x -= offscreen_w;
|
||||
if (offscreen_h > 0)
|
||||
nw_y -= offscreen_h;
|
||||
|
||||
/* Convert se_x, se_y to the most bottom-right position
|
||||
* the window can occupy
|
||||
*/
|
||||
if (window->frame)
|
||||
{
|
||||
#define TITLEBAR_LENGTH_ONSCREEN 10
|
||||
@ -3329,11 +3350,35 @@ constrain_position (MetaWindow *window,
|
||||
se_y -= fgeom->top_height;
|
||||
}
|
||||
|
||||
/* If we have a micro-screen or huge frames maybe nw/se got
|
||||
* swapped
|
||||
*/
|
||||
if (nw_x > se_x)
|
||||
{
|
||||
int tmp = nw_x;
|
||||
nw_x = se_x;
|
||||
se_x = tmp;
|
||||
}
|
||||
|
||||
if (nw_y > se_y)
|
||||
{
|
||||
int tmp = nw_y;
|
||||
nw_y = se_y;
|
||||
se_y = tmp;
|
||||
}
|
||||
|
||||
/* Clamp window to the given positions */
|
||||
if (x < nw_x)
|
||||
x = nw_x;
|
||||
if (y < nw_y)
|
||||
y = nw_y;
|
||||
|
||||
if (x > se_x)
|
||||
x = se_x;
|
||||
if (y > se_y)
|
||||
y = se_y;
|
||||
|
||||
|
||||
/* If maximized, force the exact position */
|
||||
if (window->maximized)
|
||||
{
|
||||
if (x != nw_x)
|
||||
|
Loading…
Reference in New Issue
Block a user