Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WorkspaceManager: avoid using Meta.WorkspaceManager.list_workspaces #2243

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/WorkspaceManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,14 @@ public class Gala.WorkspaceManager : Object {

unowned Meta.WorkspaceManager manager = wm.get_display ().get_workspace_manager ();

foreach (var workspace in manager.get_workspaces ()) {
var last_index = manager.get_n_workspaces () - 1;
var n_workspaces = manager.n_workspaces;
var last_index = n_workspaces - 1;
for (var i = 0; i < n_workspaces; i++) {
lenemter marked this conversation as resolved.
Show resolved Hide resolved
unowned var workspace = manager.get_workspace_by_index (i);
if (workspace == null) {
continue;
}

if (Utils.get_n_windows (workspace) == 0 && workspace.index () != last_index) {
lenemter marked this conversation as resolved.
Show resolved Hide resolved
remove_workspace (workspace);
lenemter marked this conversation as resolved.
Show resolved Hide resolved
}
Expand Down
Loading