mirror of
https://github.com/elementary/gala.git
synced 2024-09-11 15:15:39 +03:00
WorkspaceManager: Make cleanup private
Also make sure to only call it if there is no freeze ongoing.
This commit is contained in:
parent
d61501b070
commit
196d2498a2
@ -105,7 +105,6 @@ namespace Gala {
|
||||
}
|
||||
|
||||
workspace_manager.thaw_remove ();
|
||||
workspace_manager.cleanup ();
|
||||
}
|
||||
|
||||
// Code ported from KWin present windows effect
|
||||
|
@ -239,14 +239,16 @@ namespace Gala {
|
||||
* Temporarily disables removing workspaces when they are empty
|
||||
*/
|
||||
public void freeze_remove () {
|
||||
remove_freeze_count++;
|
||||
GLib.AtomicInt.inc (ref remove_freeze_count);
|
||||
}
|
||||
|
||||
/**
|
||||
* Undo the effect of freeze_remove()
|
||||
*/
|
||||
public void thaw_remove () {
|
||||
remove_freeze_count--;
|
||||
if (GLib.AtomicInt.dec_and_test (ref remove_freeze_count)) {
|
||||
cleanup ();
|
||||
}
|
||||
|
||||
assert (remove_freeze_count >= 0);
|
||||
}
|
||||
@ -256,7 +258,7 @@ namespace Gala {
|
||||
* be removed. Particularly useful in conjunction with freeze/thaw_remove to
|
||||
* cleanup after an operation that required stable workspace/window indices
|
||||
*/
|
||||
public void cleanup () {
|
||||
private void cleanup () {
|
||||
if (!Meta.Prefs.get_dynamic_workspaces ()) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user