From 4ede6129e3e3a8e2d3a8cc1b566e97f0e89d3a50 Mon Sep 17 00:00:00 2001 From: lenemter Date: Wed, 18 Dec 2024 22:53:09 +0300 Subject: [PATCH] Add comment on exclude --- lib/Utils.vala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Utils.vala b/lib/Utils.vala index 5dfbe2c53..e66f014ac 100644 --- a/lib/Utils.vala +++ b/lib/Utils.vala @@ -266,10 +266,15 @@ namespace Gala { /** * Get the number of toplevel windows on a workspace excluding those that are - * on all workspaces + * on all workspaces. + * + * We need `exclude` here because on Meta.Workspace.window_removed + * the windows gets removed from workspace's internal window list but not display's window list + * which Meta.Workspace uses for Meta.Workspace.list_windows (). * * @param workspace The workspace on which to count the windows * @param exclude a window to not count + * */ public static uint get_n_windows (Meta.Workspace workspace, bool on_primary = false, Meta.Window? exclude = null) { var n = 0;