@@ -2422,7 +2422,7 @@ process_mouse_move_resize_grab (MetaDisplay *display,
24222422 * need to remaximize it. In normal cases, we need to do a
24232423 * moveresize now to get the position back to the original.
24242424 */
2425- if (window -> shaken_loose || tile_mode == META_TILE_MAXIMIZED )
2425+ if (window -> saved_maximize || tile_mode == META_TILE_MAXIMIZED )
24262426 meta_window_maximize (window , META_MAXIMIZE_BOTH );
24272427 else if (tile_mode != META_TILE_NONE )
24282428 meta_window_restore_tile (window ,
@@ -2483,13 +2483,29 @@ process_keyboard_move_grab (MetaDisplay *display,
24832483
24842484 if (event -> keyval == CLUTTER_KEY_Escape )
24852485 {
2486+ MetaTileMode tile_mode ;
2487+
2488+ /* Hide the tiling preview if necessary */
2489+ if (display -> preview_tile_mode != META_TILE_NONE )
2490+ meta_display_hide_tile_preview (display );
2491+
2492+ /* Restore the original tile mode */
2493+ tile_mode = display -> grab_tile_mode ;
2494+ window -> tile_monitor_number = display -> grab_tile_monitor_number ;
2495+
24862496 /* End move and restore to original state. If the window was a
24872497 * maximized window that had been "shaken loose" we need to
24882498 * remaximize it. In normal cases, we need to do a moveresize
24892499 * now to get the position back to the original.
24902500 */
2491- if (window -> shaken_loose )
2501+ if (window -> saved_maximize )
24922502 meta_window_maximize (window , META_MAXIMIZE_BOTH );
2503+ else
2504+ if (tile_mode != META_TILE_NONE )
2505+ meta_window_restore_tile (window ,
2506+ tile_mode ,
2507+ display -> grab_initial_window_pos .width ,
2508+ display -> grab_initial_window_pos .height );
24932509 else
24942510 meta_window_move_resize_frame (display -> grab_window ,
24952511 TRUE,
0 commit comments