mirror of
https://github.com/brl/mutter.git
synced 2025-07-06 10:59:51 +00:00
Only consider the bottom of the titlebar a resize control; I keep
2002-01-27 Havoc Pennington <hp@pobox.com> * src/frames.c (get_control): Only consider the bottom of the titlebar a resize control; I keep accidentally resizing windows instead of activating them. Also, give south resizing priority over north, if the window is so small the active regions overlap * src/theme.c: add MetaTheme, get MetaFrameStyleSet into a usable state * src/common.h: move window type back to window.h, decided not to use it on frame side (MetaFrameType): add this instead
This commit is contained in:

committed by
Havoc Pennington

parent
5b4e9c01cc
commit
b52ee424e4
57
src/frames.c
57
src/frames.c
@ -2101,28 +2101,19 @@ get_control (MetaFrames *frames,
|
||||
|
||||
if (has_vert || has_horiz)
|
||||
{
|
||||
if (y < fgeom.top_height && x < RESIZE_EXTENDS)
|
||||
{
|
||||
if (has_vert && has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_NW;
|
||||
else if (has_vert)
|
||||
return META_FRAME_CONTROL_RESIZE_N;
|
||||
else
|
||||
return META_FRAME_CONTROL_RESIZE_W;
|
||||
int bottom_of_titlebar;
|
||||
|
||||
}
|
||||
else if (y < fgeom.top_height && x >= (fgeom.width - RESIZE_EXTENDS))
|
||||
{
|
||||
if (has_vert && has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_NE;
|
||||
else if (has_vert)
|
||||
return META_FRAME_CONTROL_RESIZE_N;
|
||||
else
|
||||
return META_FRAME_CONTROL_RESIZE_E;
|
||||
bottom_of_titlebar = fgeom.title_rect.y + fgeom.title_rect.height;
|
||||
|
||||
}
|
||||
else if (y >= (fgeom.height - fgeom.bottom_height - RESIZE_EXTENDS) &&
|
||||
x >= (fgeom.width - fgeom.right_width - RESIZE_EXTENDS))
|
||||
if (y < bottom_of_titlebar)
|
||||
goto noresize;
|
||||
|
||||
/* South resize always has priority over north resize,
|
||||
* in case of overlap.
|
||||
*/
|
||||
|
||||
if (y >= (fgeom.height - fgeom.bottom_height - RESIZE_EXTENDS) &&
|
||||
x >= (fgeom.width - fgeom.right_width - RESIZE_EXTENDS))
|
||||
{
|
||||
if (has_vert && has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_SE;
|
||||
@ -2141,16 +2132,36 @@ get_control (MetaFrames *frames,
|
||||
else
|
||||
return META_FRAME_CONTROL_RESIZE_W;
|
||||
}
|
||||
else if (y < fgeom.top_height)
|
||||
else if (y < (fgeom.top_height + RESIZE_EXTENDS) &&
|
||||
x < RESIZE_EXTENDS)
|
||||
{
|
||||
if (has_vert)
|
||||
if (has_vert && has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_NW;
|
||||
else if (has_vert)
|
||||
return META_FRAME_CONTROL_RESIZE_N;
|
||||
else
|
||||
return META_FRAME_CONTROL_RESIZE_W;
|
||||
}
|
||||
else if (y < (fgeom.top_height + RESIZE_EXTENDS) &&
|
||||
x >= (fgeom.width - RESIZE_EXTENDS))
|
||||
{
|
||||
if (has_vert && has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_NE;
|
||||
else if (has_vert)
|
||||
return META_FRAME_CONTROL_RESIZE_N;
|
||||
else
|
||||
return META_FRAME_CONTROL_RESIZE_E;
|
||||
}
|
||||
else if (y >= (fgeom.height - fgeom.bottom_height - RESIZE_EXTENDS))
|
||||
{
|
||||
if (has_vert)
|
||||
return META_FRAME_CONTROL_RESIZE_S;
|
||||
}
|
||||
else if (y >= bottom_of_titlebar && y < fgeom.top_height)
|
||||
{
|
||||
if (has_vert)
|
||||
return META_FRAME_CONTROL_RESIZE_N;
|
||||
}
|
||||
else if (x <= fgeom.left_width)
|
||||
{
|
||||
if (has_horiz)
|
||||
@ -2162,6 +2173,8 @@ get_control (MetaFrames *frames,
|
||||
return META_FRAME_CONTROL_RESIZE_E;
|
||||
}
|
||||
}
|
||||
|
||||
noresize:
|
||||
|
||||
return META_FRAME_CONTROL_NONE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user