Disable top resizing for attached modal dialogs, for real this time

https://bugzilla.gnome.org/show_bug.cgi?id=657795
This commit is contained in:
Jasper St. Pierre 2011-09-01 12:17:26 -04:00
parent 7ba6503e9b
commit d6b528a955

View File

@ -2648,6 +2648,7 @@ get_control (MetaFrames *frames,
MetaFrameFlags flags; MetaFrameFlags flags;
MetaFrameType type; MetaFrameType type;
gboolean has_vert, has_horiz; gboolean has_vert, has_horiz;
gboolean has_north_resize;
cairo_rectangle_int_t client; cairo_rectangle_int_t client;
meta_frames_calc_geometry (frames, frame, &fgeom); meta_frames_calc_geometry (frames, frame, &fgeom);
@ -2671,12 +2672,13 @@ get_control (MetaFrames *frames,
META_CORE_GET_FRAME_TYPE, &type, META_CORE_GET_FRAME_TYPE, &type,
META_CORE_GET_END); META_CORE_GET_END);
has_north_resize = (type != META_FRAME_TYPE_ATTACHED);
has_vert = (flags & META_FRAME_ALLOWS_VERTICAL_RESIZE) != 0; has_vert = (flags & META_FRAME_ALLOWS_VERTICAL_RESIZE) != 0;
has_horiz = (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE) != 0; has_horiz = (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE) != 0;
if (POINT_IN_RECT (x, y, fgeom.title_rect)) if (POINT_IN_RECT (x, y, fgeom.title_rect))
{ {
if (has_vert && y <= TOP_RESIZE_HEIGHT && (type != META_FRAME_TYPE_ATTACHED)) if (has_vert && y <= TOP_RESIZE_HEIGHT && has_north_resize)
return META_FRAME_CONTROL_RESIZE_N; return META_FRAME_CONTROL_RESIZE_N;
else else
return META_FRAME_CONTROL_TITLE; return META_FRAME_CONTROL_TITLE;
@ -2739,13 +2741,13 @@ get_control (MetaFrames *frames,
{ {
if (has_vert && has_horiz) if (has_vert && has_horiz)
return META_FRAME_CONTROL_RESIZE_SW; return META_FRAME_CONTROL_RESIZE_SW;
else if (has_vert) else if (has_vert && has_north_resize)
return META_FRAME_CONTROL_RESIZE_S; return META_FRAME_CONTROL_RESIZE_S;
else if (has_horiz) else if (has_horiz)
return META_FRAME_CONTROL_RESIZE_W; return META_FRAME_CONTROL_RESIZE_W;
} }
else if (y < (fgeom.borders.invisible.top + RESIZE_EXTENDS) && else if (y < (fgeom.borders.invisible.top + RESIZE_EXTENDS) &&
x <= (fgeom.borders.total.left + RESIZE_EXTENDS)) x <= (fgeom.borders.total.left + RESIZE_EXTENDS) && has_north_resize)
{ {
if (has_vert && has_horiz) if (has_vert && has_horiz)
return META_FRAME_CONTROL_RESIZE_NW; return META_FRAME_CONTROL_RESIZE_NW;
@ -2755,7 +2757,7 @@ get_control (MetaFrames *frames,
return META_FRAME_CONTROL_RESIZE_W; return META_FRAME_CONTROL_RESIZE_W;
} }
else if (y < (fgeom.borders.invisible.top + RESIZE_EXTENDS) && else if (y < (fgeom.borders.invisible.top + RESIZE_EXTENDS) &&
x >= (fgeom.width - fgeom.borders.total.right - RESIZE_EXTENDS)) x >= (fgeom.width - fgeom.borders.total.right - RESIZE_EXTENDS) && has_north_resize)
{ {
if (has_vert && has_horiz) if (has_vert && has_horiz)
return META_FRAME_CONTROL_RESIZE_NE; return META_FRAME_CONTROL_RESIZE_NE;
@ -2766,7 +2768,7 @@ get_control (MetaFrames *frames,
} }
else if (y < (fgeom.borders.invisible.top + TOP_RESIZE_HEIGHT)) else if (y < (fgeom.borders.invisible.top + TOP_RESIZE_HEIGHT))
{ {
if (has_vert) if (has_vert && has_north_resize)
return META_FRAME_CONTROL_RESIZE_N; return META_FRAME_CONTROL_RESIZE_N;
} }
else if (y >= (fgeom.height - fgeom.borders.total.bottom - RESIZE_EXTENDS)) else if (y >= (fgeom.height - fgeom.borders.total.bottom - RESIZE_EXTENDS))