mirror of
https://github.com/elementary/gala.git
synced 2024-12-18 14:51:51 +03:00
workspaceview: clean up initial_configuration
This commit is contained in:
parent
c830c38da1
commit
4ba3bc0519
@ -92,12 +92,13 @@ namespace Gala
|
|||||||
{
|
{
|
||||||
screen.workareas_changed.disconnect (initial_configuration);
|
screen.workareas_changed.disconnect (initial_configuration);
|
||||||
|
|
||||||
//remove everything except for the first
|
var workspaces = screen.get_workspaces ().copy ();
|
||||||
for (var i=1;i<screen.get_workspaces ().length ();i++) {
|
|
||||||
screen.remove_workspace (screen.get_workspaces ().nth_data (i), screen.get_display ().get_current_time ());
|
|
||||||
}
|
|
||||||
|
|
||||||
var thumb = new WorkspaceThumb (screen.get_workspaces ().nth_data (0));
|
//remove everything except for the first
|
||||||
|
for (var i = 1; i < workspaces.length (); i++)
|
||||||
|
screen.remove_workspace (workspaces.nth_data (i), screen.get_display ().get_current_time ());
|
||||||
|
|
||||||
|
var thumb = new WorkspaceThumb (workspaces.nth_data (0));
|
||||||
thumb.clicked.connect (hide);
|
thumb.clicked.connect (hide);
|
||||||
thumb.closed.connect (remove_workspace);
|
thumb.closed.connect (remove_workspace);
|
||||||
thumb.window_on_last.connect (add_workspace);
|
thumb.window_on_last.connect (add_workspace);
|
||||||
@ -106,8 +107,8 @@ namespace Gala
|
|||||||
|
|
||||||
//if mutter missed something, just add it..
|
//if mutter missed something, just add it..
|
||||||
if (screen.n_workspaces != 1) {
|
if (screen.n_workspaces != 1) {
|
||||||
for (var i=1;i<screen.get_workspaces ().length ();i++) {
|
for (var i = 1; i < workspaces.length (); i++) {
|
||||||
thumb = new WorkspaceThumb (screen.get_workspaces ().nth_data (i));
|
thumb = new WorkspaceThumb (workspaces.nth_data (i));
|
||||||
thumb.clicked.connect (hide);
|
thumb.clicked.connect (hide);
|
||||||
thumb.closed.connect (remove_workspace);
|
thumb.closed.connect (remove_workspace);
|
||||||
thumb.window_on_last.connect (add_workspace);
|
thumb.window_on_last.connect (add_workspace);
|
||||||
@ -117,7 +118,7 @@ namespace Gala
|
|||||||
}
|
}
|
||||||
|
|
||||||
//if there went something wrong, we need to get the system back rolling
|
//if there went something wrong, we need to get the system back rolling
|
||||||
if (screen.n_workspaces == 1 && Utils.get_n_windows (screen.get_workspaces ().nth_data (0)) != 0)
|
if (screen.n_workspaces == 1 && Utils.get_n_windows (workspaces.nth_data (0)) != 0)
|
||||||
add_workspace ();
|
add_workspace ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user