window: Remove some overcomplicated uses of meta_window_move_resize
Replace them with meta_window_move_frame, since that's all we need to do.
This commit is contained in:
parent
3f1b6ddc8f
commit
21991a7edb
@ -2636,22 +2636,14 @@ handle_move_to_center (MetaDisplay *display,
|
|||||||
{
|
{
|
||||||
MetaRectangle work_area;
|
MetaRectangle work_area;
|
||||||
MetaRectangle frame_rect;
|
MetaRectangle frame_rect;
|
||||||
int orig_x, orig_y;
|
|
||||||
int frame_width, frame_height;
|
|
||||||
|
|
||||||
meta_window_get_work_area_all_monitors (window, &work_area);
|
meta_window_get_work_area_all_monitors (window, &work_area);
|
||||||
meta_window_get_frame_rect (window, &frame_rect);
|
meta_window_get_frame_rect (window, &frame_rect);
|
||||||
meta_window_get_position (window, &orig_x, &orig_y);
|
|
||||||
|
|
||||||
frame_width = (window->frame ? window->frame->child_x : 0);
|
meta_window_move_frame (window,
|
||||||
frame_height = (window->frame ? window->frame->child_y : 0);
|
TRUE,
|
||||||
|
work_area.x + (work_area.width - frame_rect.width ) / 2,
|
||||||
meta_window_move_resize (window,
|
work_area.y + (work_area.height - frame_rect.height) / 2);
|
||||||
TRUE,
|
|
||||||
work_area.x + (work_area.width +frame_width -frame_rect.width )/2,
|
|
||||||
work_area.y + (work_area.height+frame_height-frame_rect.height)/2,
|
|
||||||
window->rect.width,
|
|
||||||
window->rect.height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -5328,7 +5328,6 @@ meta_window_shove_titlebar_onscreen (MetaWindow *window)
|
|||||||
MetaRectangle frame_rect;
|
MetaRectangle frame_rect;
|
||||||
GList *onscreen_region;
|
GList *onscreen_region;
|
||||||
int horiz_amount, vert_amount;
|
int horiz_amount, vert_amount;
|
||||||
int newx, newy;
|
|
||||||
|
|
||||||
g_return_if_fail (!window->override_redirect);
|
g_return_if_fail (!window->override_redirect);
|
||||||
|
|
||||||
@ -5360,14 +5359,7 @@ meta_window_shove_titlebar_onscreen (MetaWindow *window)
|
|||||||
0,
|
0,
|
||||||
-vert_amount);
|
-vert_amount);
|
||||||
|
|
||||||
newx = frame_rect.x + window->frame->child_x;
|
meta_window_move_frame (window, FALSE, frame_rect.x, frame_rect.y);
|
||||||
newy = frame_rect.y + window->frame->child_y;
|
|
||||||
meta_window_move_resize (window,
|
|
||||||
FALSE,
|
|
||||||
newx,
|
|
||||||
newy,
|
|
||||||
window->rect.width,
|
|
||||||
window->rect.height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
Loading…
Reference in New Issue
Block a user