mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
window: Add meta_window_untile()
It does the same as the untile keyboard shortcut does, i.e. handles going back to saved maximized state. It's split out to be able to be tested by the stacking tests. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1171
This commit is contained in:
parent
449cbe153b
commit
668eb318c7
@ -3302,15 +3302,7 @@ handle_toggle_tiled (MetaDisplay *display,
|
||||
if ((META_WINDOW_TILED_LEFT (window) && mode == META_TILE_LEFT) ||
|
||||
(META_WINDOW_TILED_RIGHT (window) && mode == META_TILE_RIGHT))
|
||||
{
|
||||
window->tile_monitor_number = window->saved_maximize ? window->monitor->number
|
||||
: -1;
|
||||
window->tile_mode = window->saved_maximize ? META_TILE_MAXIMIZED
|
||||
: META_TILE_NONE;
|
||||
|
||||
if (window->saved_maximize)
|
||||
meta_window_maximize (window, META_MAXIMIZE_BOTH);
|
||||
else
|
||||
meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
|
||||
meta_window_untile (window);
|
||||
}
|
||||
else if (meta_window_can_tile_side_by_side (window))
|
||||
{
|
||||
|
@ -646,6 +646,9 @@ void meta_window_unmanage (MetaWindow *window,
|
||||
void meta_window_unmanage_on_idle (MetaWindow *window);
|
||||
void meta_window_queue (MetaWindow *window,
|
||||
guint queuebits);
|
||||
META_EXPORT_TEST
|
||||
void meta_window_untile (MetaWindow *window);
|
||||
|
||||
META_EXPORT_TEST
|
||||
void meta_window_tile (MetaWindow *window,
|
||||
MetaTileMode mode);
|
||||
|
@ -3124,6 +3124,22 @@ update_edge_constraints (MetaWindow *window)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_untile (MetaWindow *window)
|
||||
{
|
||||
window->tile_monitor_number =
|
||||
window->saved_maximize ? window->monitor->number
|
||||
: -1;
|
||||
window->tile_mode =
|
||||
window->saved_maximize ? META_TILE_MAXIMIZED
|
||||
: META_TILE_NONE;
|
||||
|
||||
if (window->saved_maximize)
|
||||
meta_window_maximize (window, META_MAXIMIZE_BOTH);
|
||||
else
|
||||
meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_tile (MetaWindow *window,
|
||||
MetaTileMode tile_mode)
|
||||
|
Loading…
Reference in New Issue
Block a user