diff --git a/strata@edu4rdshl.dev/extension.js b/strata@edu4rdshl.dev/extension.js index f0bccf2..33fac70 100644 --- a/strata@edu4rdshl.dev/extension.js +++ b/strata@edu4rdshl.dev/extension.js @@ -65,9 +65,6 @@ export default class StrataExtension extends Extension { _excludedApps = []; _pendingSignalId = null; - /** @type {boolean} Re-entrancy guard for signal processing */ - _busy = false; - /** @type {Set} Pending GLib.idle_add source IDs to flush on disable. */ _idleSources = new Set(); @@ -211,6 +208,7 @@ export default class StrataExtension extends Extension { // copied secrets with this hint mime. Honoring it lets users keep // their passwords out of clipboard history. if (mimes.includes('x-kde-passwordManagerHint')) return; + if (this._isExcluded(this._currentFocusedApp)) return; const mime = this._pickMime(mimes); if (!mime) return; @@ -518,28 +516,11 @@ export default class StrataExtension extends Extension { } this._pendingSignalId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 50, () => { this._pendingSignalId = null; - this._processItemAdded(id, mimeType, preview) - .catch(e => logError('ItemAdded error', e)); + this._addIdleSource(() => this._panel?.prependItem(id, mimeType, preview)); return GLib.SOURCE_REMOVE; }); } - async _processItemAdded(id, mimeType, preview) { - if (this._busy) return; - this._busy = true; - try { - if (this._isExcluded(this._currentFocusedApp)) { - try { - await this._proxy?.DeleteItemAsync(id); - } catch (_) { /* item may already be gone */ } - return; - } - this._addIdleSource(() => this._panel?.prependItem(id, mimeType, preview)); - } finally { - this._busy = false; - } - } - _isExcluded(appClass) { if (!appClass) return false; return this._excludedApps.some(ex => appClass.includes(ex.toLowerCase()));