Skip to content

Commit 8685a65

Browse files
committed
fix(hotArea): implement debounce timer cleanup to prevent lingering triggers
1 parent 252a61e commit 8685a65

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

src/modules/dock/hotArea.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ export class DockHotArea extends St.Widget {
4949

5050
this.connectObject('enter-event', () => {
5151
if (this._triggerAllowed) {
52+
this._clearDebounceTimer();
53+
5254
this._pointerDwellTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, HOT_AREA_DEBOUNCE_TIMEOUT, () => {
5355
this.emit('triggered');
5456
this._pointerDwellTimeoutId = 0;
@@ -86,11 +88,7 @@ export class DockHotArea extends St.Widget {
8688
override destroy(): void {
8789
global.display.disconnectObject(this);
8890
this._destroyBarrier();
89-
90-
if (this._pointerDwellTimeoutId) {
91-
GLib.source_remove(this._pointerDwellTimeoutId);
92-
this._pointerDwellTimeoutId = 0;
93-
}
91+
this._clearDebounceTimer();
9492

9593
this._pressureBarrier?.disconnectObject?.(this);
9694
this._pressureBarrier?.destroy?.();
@@ -128,4 +126,11 @@ export class DockHotArea extends St.Widget {
128126
this._horizontalBarrier.destroy();
129127
this._horizontalBarrier = null;
130128
}
129+
130+
private _clearDebounceTimer(): void {
131+
if (this._pointerDwellTimeoutId) {
132+
GLib.source_remove(this._pointerDwellTimeoutId);
133+
this._pointerDwellTimeoutId = 0;
134+
}
135+
}
131136
}

0 commit comments

Comments
 (0)