Skip to content

Commit

Permalink
windowManager.js: Fix cleanup of WorkspaceOsd instances.
Browse files Browse the repository at this point in the history
The monitor index is being passed, but can't be assumed to be
the array index also. Track by key/values instead.

ref: https://bugzilla.redhat.com/show_bug.cgi?id=2341980
  • Loading branch information
mtwebster committed Jan 24, 2025
1 parent d52e9c0 commit c451c0d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions js/ui/windowManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ var WindowManager = class WindowManager {
this._dimmedWindows = [];
this._animationBlockCount = 0;
this._switchData = null;
this._workspaceOsds = [];
this._workspaceOsds = {};

this._cinnamonwm.connect('kill-window-effects', (cinnamonwm, actor) => {
this._unminimizeWindowDone(cinnamonwm, actor);
Expand Down Expand Up @@ -1322,12 +1322,11 @@ var WindowManager = class WindowManager {
}

_showWorkspaceOSDForMonitor(index, currentWorkspaceIndex) {
if (this._workspaceOsds[index] == null) {
if (this._workspaceOsds[index] === undefined) {
let osd = new WorkspaceOsd.WorkspaceOsd(index);
this._workspaceOsds.push(osd);
this._workspaceOsds[index] = osd;
osd.connect('destroy', () => {
this._workspaceOsds[index] = null;
this._workspaceOsds.splice(index, 1);
this._workspaceOsds[index] = undefined;
});
}

Expand Down

0 comments on commit c451c0d

Please sign in to comment.