window: Replace meta_window_resize_with_gravity with a frame-rect variant

More low-hanging fruit for our window geometry cleanups...
This commit is contained in:
Jasper St. Pierre
2014-05-20 18:28:56 -04:00
parent 43762da9d3
commit 1c94df2553
5 changed files with 32 additions and 48 deletions

View File

@@ -2166,6 +2166,7 @@ process_keyboard_resize_grab (MetaDisplay *display,
MetaWindow *window,
ClutterKeyEvent *event)
{
MetaRectangle frame_rect;
gboolean handled;
int height_inc;
int width_inc;
@@ -2202,6 +2203,10 @@ process_keyboard_resize_grab (MetaDisplay *display,
width = window->rect.width;
height = window->rect.height;
meta_window_get_frame_rect (window, &frame_rect);
width = frame_rect.width;
height = frame_rect.height;
gravity = meta_resize_gravity_from_grab_op (display->grab_op);
smart_snap = (event->modifier_state & CLUTTER_SHIFT_MASK) != 0;
@@ -2359,18 +2364,13 @@ process_keyboard_resize_grab (MetaDisplay *display,
if (handled)
{
MetaRectangle old_rect;
meta_topic (META_DEBUG_KEYBINDINGS,
"Computed new window size due to keypress: "
"%dx%d, gravity %s\n",
width, height, meta_gravity_to_string (gravity));
old_rect = window->rect; /* Don't actually care about x,y */
/* Do any edge resistance/snapping */
meta_window_edge_resistance_for_resize (window,
old_rect.width,
old_rect.height,
&width,
&height,
gravity,
@@ -2378,15 +2378,11 @@ process_keyboard_resize_grab (MetaDisplay *display,
smart_snap,
TRUE);
/* We don't need to update unless the specified width and height
* are actually different from what we had before.
*/
if (window->rect.width != width || window->rect.height != height)
meta_window_resize_with_gravity (window,
TRUE,
width,
height,
gravity);
meta_window_resize_frame_with_gravity (window,
TRUE,
width,
height,
gravity);
meta_window_update_keyboard_resize (window, FALSE);
}