Skip to content

Commit bdcc47b

Browse files
authored
CassiaWindowList v2.4.5: Avoids 'destroy()' errors (#7933)
* CassiaWindowList v2.4.5: Avoids 'destroy()' errors * CassiaWindowList v2.4.5: Avoids 'paint()' errors
1 parent feb20b0 commit bdcc47b

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

CassiaWindowList@klangman/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 2.4.5
4+
5+
* Avoids 'destroy()' errors.
6+
37
## 2.4.4
48

59
* Fix an exception when the "Automatic focus change when leaving the panel" option is enabled. You could get a exception if you leave the panel while hovering an idle pinned button. Thanks to [claudiux](https://github.com/claudiux) for reporting the problem!

CassiaWindowList@klangman/files/CassiaWindowList@klangman/6.4/applet.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -618,12 +618,12 @@ function destroyHoverPeekClone(hoverClone, delayId, time, instant=false) {
618618
Mainloop.source_remove(delayId);
619619
}
620620
}
621-
if (hoverClone) {
621+
if (hoverClone != null) {
622622
if (!instant && time) {
623-
Tweener.addTween(hoverClone, {time: time, transition: 'easeOutQuad', opacity: 0, onComplete: () => {global.overlay_group.remove_child(hoverClone); hoverClone.destroy();}});
623+
Tweener.addTween(hoverClone, {time: time, transition: 'easeOutQuad', opacity: 0, onComplete: () => {global.overlay_group.remove_child(hoverClone); try { hoverClone.destroy(); } catch(e) {} }});
624624
} else {
625625
global.overlay_group.remove_child(hoverClone);
626-
hoverClone.destroy();
626+
try { hoverClone.destroy(); } catch(e) {}
627627
}
628628
}
629629
return null;
@@ -1036,7 +1036,7 @@ class ThumbnailMenuItem extends PopupMenu.PopupBaseMenuItem {
10361036
this.actor.hide();
10371037
this.actor.set_width(-1);
10381038
this._menu._inHiding = false;
1039-
this.destroy();
1039+
try {this.destroy();} catch(e) {}
10401040
})
10411041
});
10421042
} else {
@@ -1051,14 +1051,14 @@ class ThumbnailMenuItem extends PopupMenu.PopupBaseMenuItem {
10511051
this.actor.hide();
10521052
this.actor.set_width(-1);
10531053
this._menu._inHiding = false;
1054-
this.destroy();
1054+
try {this.destroy();} catch(e) {}
10551055
})
10561056
});
10571057
}
10581058
} else {
10591059
this.actor.hide();
10601060
this._menu._inHiding = false;
1061-
this.destroy();
1061+
try {this.destroy();} catch(e) {}
10621062
}
10631063
}
10641064

@@ -1236,7 +1236,7 @@ class ThumbnailMenu extends PopupMenu.PopupMenu {
12361236

12371237
_clearDragPlaceholder() {
12381238
if (this._dragPlaceholder) {
1239-
this._dragPlaceholder.actor.destroy();
1239+
try{this._dragPlaceholder.actor.destroy();} catch(e) {}
12401240
this._dragPlaceholder = undefined;
12411241
this._dragPlaceholderPos = undefined;
12421242
}
@@ -1477,6 +1477,8 @@ class WindowListButton {
14771477
track_hover: false, can_focus: true, reactive: true});
14781478
this.actor._delegate = this;
14791479

1480+
this._labelNumberBox = new St.BoxLayout();
1481+
14801482
this._shrukenLabel = false;
14811483
this._minLabelSize = -1;
14821484
this._lableWidth = 0;
@@ -1502,7 +1504,7 @@ class WindowListButton {
15021504
this._iconBin._delegate = this;
15031505
this._iconBox.add_actor(this._iconBin);
15041506

1505-
this._labelNumberBox = new St.BoxLayout();
1507+
//~ this._labelNumberBox = new St.BoxLayout();
15061508
this._labelNumberBin = new St.Bin({
15071509
important: true, style_class: "grouped-window-list-badge", x_align: St.Align.MIDDLE, y_align: St.Align.MIDDLE});
15081510
this._labelNumber = new St.Label({style_class: "grouped-window-list-number-label"});
@@ -4252,7 +4254,7 @@ class Workspace {
42524254
let index = this._appButtons.indexOf(appButton);
42534255
if (index >= 0) {
42544256
this._appButtons.splice(index, 1);
4255-
appButton.destroy();
4257+
try{appButton.destroy();} catch(e) {}
42564258
}
42574259
}
42584260

@@ -4668,7 +4670,7 @@ class Workspace {
46684670
appButton.updateView();
46694671
}
46704672
}
4671-
this.actor.queue_relayout();
4673+
try{this.actor.queue_relayout();} catch(e) {}
46724674
}
46734675

46744676
_updateFocus() {
@@ -4905,7 +4907,7 @@ class Workspace {
49054907

49064908
_clearDragPlaceholder() {
49074909
if (this._dragPlaceholder) {
4908-
this._dragPlaceholder.actor.destroy();
4910+
try{this._dragPlaceholder.actor.destroy();} catch(e) {};
49094911
this._dragPlaceholder = undefined;
49104912
this._dragPlaceholderPos = undefined;
49114913
}
@@ -4986,10 +4988,10 @@ class Workspace {
49864988
this._settings.setValue("pinned-apps", pinSetting);
49874989

49884990
for (let i = this._appButtons.length - 1; i >= 0; i--) {
4989-
this._appButtons[i].destroy();
4991+
try{this._appButtons[i].destroy();} catch(e) {};
49904992
}
49914993
this._appButtons = null;
4992-
this.actor.destroy();
4994+
try{this.actor.destroy();} catch(e) {}
49934995
}
49944996

49954997
// Find the application with the most Buttons
@@ -5822,7 +5824,7 @@ class WindowList extends Applet.Applet {
58225824
let window = global.display.get_focus_window();
58235825
let currentWs = global.screen.get_active_workspace_index();
58245826
//log( `Global, focus changed to ${window.get_title()} for ws ${currentWs}` );
5825-
this._workspaces[currentWs]._updateFocus();
5827+
try {this._workspaces[currentWs]._updateFocus();} catch(e) {}
58265828
}
58275829

58285830
on_applet_removed_from_panel() {
@@ -5911,7 +5913,7 @@ class WindowList extends Applet.Applet {
59115913
this._workspaces[i]._wsNum = i;
59125914
}
59135915

5914-
workspace.destroy();
5916+
try{workspace.destroy();} catch(e) {}
59155917
}
59165918
}
59175919

CassiaWindowList@klangman/files/CassiaWindowList@klangman/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"max-instances": -1,
66
"multiversion": true,
77
"role": "panellauncher",
8-
"version": "2.4.4",
8+
"version": "2.4.5",
99
"author": "klangman"
1010
}

0 commit comments

Comments
 (0)