Skip to content

Commit

Permalink
fix: ignore case when comparing excluded apps
Browse files Browse the repository at this point in the history
  • Loading branch information
oae committed Mar 6, 2023
1 parent cd752fa commit 42ea7cb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ class PanoExtension {
if (
wmClass &&
this.settings.get_boolean('watch-exclusion-list') &&
this.settings.get_strv('exclusion-list').indexOf(wmClass) >= 0
this.settings
.get_strv('exclusion-list')
.map((s) => s.toLowerCase())
.indexOf(wmClass.toLowerCase()) >= 0
) {
clipboardManager.stopTracking();
} else if (clipboardManager.isTracking === false) {
Expand Down
12 changes: 12 additions & 0 deletions src/utils/clipboardManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,18 @@ export class ClipboardManager extends Object {
if (this.settings.get_boolean('is-in-incognito')) {
return;
}
const focussedWindow = Global.get().display.focus_window;
const wmClass = focussedWindow?.get_wm_class();
if (
wmClass &&
this.settings.get_boolean('watch-exclusion-list') &&
this.settings
.get_strv('exclusion-list')
.map((s) => s.toLowerCase())
.indexOf(wmClass.toLowerCase()) >= 0
) {
return;
}
if (selectionType === SelectionType.SELECTION_CLIPBOARD) {
try {
const result = await this.getContent(ClipboardType.CLIPBOARD);
Expand Down

0 comments on commit 42ea7cb

Please sign in to comment.