Skip to content

Commit

Permalink
windowAttentionHandler.js: make the ignored app check case-
Browse files Browse the repository at this point in the history
insensitive.  While we're here make it a gsettings array for
convenience.

Quassel used to work - it now returns 'quassel' on my machine.
Enabling the 'focus stealing prevention' switch under windows
behavior solves this, but has too many side effects.

See #5358
  • Loading branch information
mtwebster committed Jun 8, 2016
1 parent 8e30c3a commit 31d0ae2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
5 changes: 5 additions & 0 deletions data/org.cinnamon.gschema.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,11 @@
</_description>
</key>

<key type="as" name="demands-attention-ignored-wm-classes">
<default>["skype", "viber", "quassel", "retroshare", "psi-plus", "kadu"]</default>
<_summary>WM class names to skip processing for in windowAttentionHandler.js</_summary>
</key>

</schema>

<schema id="org.cinnamon.theme" path="/org/cinnamon/theme/"
Expand Down
11 changes: 4 additions & 7 deletions js/ui/windowAttentionHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@ WindowAttentionHandler.prototype = {
// We are just ignoring the hint on skip_taskbar windows for now.
// (Which is the same behaviour as with metacity + panel)

let wmclass = window.get_wm_class();
let ignored_classes = global.settings.get_strv("demands-attention-ignored-wm-classes");

if (!window || window.has_focus() || window.is_skip_taskbar() ||
(window.get_wm_class() && (window.get_wm_class().indexOf("Skype") > -1 ||
window.get_wm_class().indexOf("Viber") > -1 ||
window.get_wm_class().indexOf("Quassel") > -1 ||
window.get_wm_class().indexOf("Pidgin") > -1 ||
window.get_wm_class().indexOf("RetroShare") > -1 ||
window.get_wm_class().indexOf("Psi-plus") > -1 ||
window.get_wm_class().indexOf("Kadu") > -1)))
(wmclass && (ignored_classes.indexOf(wmclass.toLowerCase()) != -1)))
return;

try {
Expand Down

5 comments on commit 31d0ae2

@brownsr
Copy link
Member

@brownsr brownsr commented on 31d0ae2 Jun 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pidgin disappeared in this change. Is that right ? Just checking ...

@mtwebster
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops

@Scukerman
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My Viber steals focus again, why have you done this again? And what do I need to do to fix that?

@cavebeat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the commit breaks again my 479a950

@mtwebster
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed - sorry

b41c75c

Please sign in to comment.