Skip to content

Commit 7612038

Browse files
committed
Add a comment explaining removed > added
1 parent 779c036 commit 7612038

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Widgets/WindowOverview.vala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ public class Gala.WindowOverview : ActorTarget, RootTarget, ActivatableComponent
171171
}
172172

173173
private void on_items_changed (ListModel model, uint pos, uint removed, uint added) {
174+
// Check removed > added to make sure we only close once when the last window is removed
175+
// This avoids an inifinite loop since closing will sort the windows which also triggers this signal
174176
if (is_opened () && removed > added && model.get_n_items () == 0) {
175177
close ();
176178
}

0 commit comments

Comments
 (0)