From fc79bd1c4af4bce121a313cc2777b414c838a73c Mon Sep 17 00:00:00 2001 From: Omar Zeidan Date: Sat, 30 Dec 2017 06:45:08 +0100 Subject: Restructured monitor keybinds and adjust save_rect --- src/core/keybindings.c | 43 +++++++++++++------------------------------ 1 file changed, 13 insertions(+), 30 deletions(-) (limited to 'src/core/keybindings.c') diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 11b8daf4..a141e2c1 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -2680,37 +2680,20 @@ handle_move_to_monitor (MetaDisplay *display, XEvent *event, MetaKeyBinding *binding) { - MetaScreenDirection move_direction = binding->handler->data; - MetaXineramaScreenInfo* current; - MetaXineramaScreenInfo* neighbour; - MetaRectangle current_window_rect; - int new_x; - int new_y; + const MetaScreenDirection move_direction = binding->handler->data; + const MetaXineramaScreenInfo* current; + const MetaXineramaScreenInfo* neighbour; - - current = meta_screen_get_xinerama_for_window(screen, window); - neighbour = meta_screen_get_xinerama_neighbor(screen, current->number, move_direction); - - if(neighbour == NULL || - current->number == neighbour->number) - return; - - if(META_WINDOW_TILED (window)) - { - window->tile_monitor_number = neighbour->number; - return; - } - - meta_window_get_client_root_coords(window, ¤t_window_rect); - - new_x = current_window_rect.x - current->rect.x + neighbour->rect.x; - new_y = current_window_rect.y - current->rect.y + neighbour->rect.y; - /* target_rect.width = window->rect.width; */ - /* target_rect.height = window->rect.height; */ - /* Maybe do some resizing? */ - - meta_window_move(window, TRUE, new_x, new_y); - + current = meta_screen_get_xinerama_for_window(screen, window); + neighbour = meta_screen_get_xinerama_neighbor(screen, current->number, move_direction); + + if(neighbour == NULL || + current->number == neighbour->number) + return; + + meta_window_move_to_monitor(window, + current, + neighbour); } static gboolean -- cgit v1.2.1