Skip to content

Commit

Permalink
Increase corner resize regions.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtwebster committed Dec 7, 2013
1 parent 6f67cf3 commit 0f2afcf
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/ui/frames.c
Original file line number Diff line number Diff line change
Expand Up @@ -2506,6 +2506,8 @@ control_rect (MetaFrameControl control,
}

#define TOP_RESIZE_HEIGHT 4
#define CORNER_SIZE_MULT 2

static MetaFrameControl
get_control (MetaFrames *frames,
MetaUIFrame *frame,
Expand Down Expand Up @@ -2597,8 +2599,8 @@ get_control (MetaFrames *frames,
* in case of overlap.
*/

if (y >= (fgeom.height - fgeom.borders.total.bottom) &&
x >= (fgeom.width - fgeom.borders.total.right))
if (y >= (fgeom.height - fgeom.borders.total.bottom * CORNER_SIZE_MULT) &&
x >= (fgeom.width - fgeom.borders.total.right * CORNER_SIZE_MULT))
{
if ((has_vert && has_horiz) || (has_bottom && has_right))
return META_FRAME_CONTROL_RESIZE_SE;
Expand All @@ -2607,8 +2609,8 @@ get_control (MetaFrames *frames,
else if (has_right)
return META_FRAME_CONTROL_RESIZE_E;
}
else if (y >= (fgeom.height - fgeom.borders.total.bottom) &&
x <= fgeom.borders.total.left)
else if (y >= (fgeom.height - fgeom.borders.total.bottom * CORNER_SIZE_MULT) &&
x <= fgeom.borders.total.left * CORNER_SIZE_MULT)
{
if ((has_vert && has_horiz) || (has_bottom && has_left))
return META_FRAME_CONTROL_RESIZE_SW;
Expand All @@ -2617,8 +2619,8 @@ get_control (MetaFrames *frames,
else if (has_left)
return META_FRAME_CONTROL_RESIZE_W;
}
else if (y < (fgeom.borders.invisible.top) &&
x <= fgeom.borders.total.left && has_north_resize)
else if (y < (fgeom.borders.invisible.top * CORNER_SIZE_MULT) &&
(x <= fgeom.borders.total.left * CORNER_SIZE_MULT) && has_north_resize)
{
if ((has_vert && has_horiz) || (has_top && has_left))
return META_FRAME_CONTROL_RESIZE_NW;
Expand All @@ -2627,8 +2629,8 @@ get_control (MetaFrames *frames,
else if (has_left)
return META_FRAME_CONTROL_RESIZE_W;
}
else if (y < (fgeom.borders.invisible.top) &&
x >= fgeom.width - fgeom.borders.total.right && has_north_resize)
else if (y < (fgeom.borders.invisible.top * CORNER_SIZE_MULT) &&
x >= (fgeom.width - fgeom.borders.total.right * CORNER_SIZE_MULT) && has_north_resize)
{
if ((has_vert && has_horiz) || (has_top && has_right))
return META_FRAME_CONTROL_RESIZE_NE;
Expand Down

0 comments on commit 0f2afcf

Please sign in to comment.