mirror of
https://github.com/brl/mutter.git
synced 2025-02-02 14:53:03 +00:00
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 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_frame_rect (window, &frame_rect);
|
||||
meta_window_get_position (window, &orig_x, &orig_y);
|
||||
|
||||
frame_width = (window->frame ? window->frame->child_x : 0);
|
||||
frame_height = (window->frame ? window->frame->child_y : 0);
|
||||
|
||||
meta_window_move_resize (window,
|
||||
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);
|
||||
meta_window_move_frame (window,
|
||||
TRUE,
|
||||
work_area.x + (work_area.width - frame_rect.width ) / 2,
|
||||
work_area.y + (work_area.height - frame_rect.height) / 2);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -5328,7 +5328,6 @@ meta_window_shove_titlebar_onscreen (MetaWindow *window)
|
||||
MetaRectangle frame_rect;
|
||||
GList *onscreen_region;
|
||||
int horiz_amount, vert_amount;
|
||||
int newx, newy;
|
||||
|
||||
g_return_if_fail (!window->override_redirect);
|
||||
|
||||
@ -5360,14 +5359,7 @@ meta_window_shove_titlebar_onscreen (MetaWindow *window)
|
||||
0,
|
||||
-vert_amount);
|
||||
|
||||
newx = frame_rect.x + window->frame->child_x;
|
||||
newy = frame_rect.y + window->frame->child_y;
|
||||
meta_window_move_resize (window,
|
||||
FALSE,
|
||||
newx,
|
||||
newy,
|
||||
window->rect.width,
|
||||
window->rect.height);
|
||||
meta_window_move_frame (window, FALSE, frame_rect.x, frame_rect.y);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
Loading…
x
Reference in New Issue
Block a user