linuxmint / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
4.56k stars 744 forks source link

Possible issue with popups/notifications and Skype #233

Closed psych closed 12 years ago

psych commented 12 years ago

I believe there might be an issue with Skype and Cinnamon, possibly to do with the way notifications are displayed. I'm not too sure about this though and can only report what I see.

In Cinnamon 1.2 (this didn't happen in 1.1.3) whenever messages are received in Skype and Skype is minimized, Skype comes to the forefront for me and jumps on top of all other open windows. Obviously this isn't behavior we want. In Cinnamon 1.1.3 a notification Window was displayed in the top right, as I recall, if that option was set in Skype. This is ideal behavior. In Gnome Shell Skype also behaves correctly and a notification top center appears telling me a new message is received.

I've tweaked the chat and notification settings in Skype to just display a notification and not display anything at all. Either way, Skype comes to the forefront.

Skype should not be coming to the top and I believe it might have something to do with notifications if something was changed on the back end of Cinnamon between 1.1.3 and now, because it did used to work well.

Anyone else seeing this?

KirkM commented 12 years ago

This is happening to me as well with Skype and Cinnamon 1.2. New chat message comes in and Skype pops to the front taking focus away from all other windows. A bit awkward when you're typing something into a document or in an online form and you suddenly find yourself typing the rest into a Skype message field instead.

psych commented 12 years ago

I'm not the only one!

KirkM, if you used Cinnamon 1.1.3 can you confirm that it did not happen with that release? Also, I would be interested in knowing whether you use Linux Mint or another distro so we can confirm whether it's a Cinnamon issue or something in the way the various components of Mint interact with Cinnamon.

Carusu commented 12 years ago

I can confirm this issue using the git version. I'm on Arch Linux

KirkM commented 12 years ago

I'm running Cinnamon 1.2 (via the Mint repos) on Linux Mint 12 and I can also confirm that it did not did not happen with Cinnamon 1.1.3.

psych commented 12 years ago

I too am running Mint 12 and have Cinnamon through the Mint repository. Carusu, thanks for chiming in. At least now we know it's happening on two separate distros. I'll refrain from hypothesizing as to what causes this since I know nothing of the internals, but I will say that I'm not seeing issues with Pidgin or Empathy which leads me to believe it might have something to do with the way Skype in particular is handling these things and something that changed in the backend of Cinnamon.

0v3rth3d4wn commented 12 years ago

I'm also running Mint 12 with Cinnamon 1.2 (merlwiz79 repo) and also have the same problem.

AngiolettoNero commented 12 years ago

Linux Mint 12 (LISA) with Cinnamon 1.2. I have the same problem. I confirm that, with Cinnamon 1.1.3, it did not happen. Thanks.

jerjanssen commented 12 years ago

I'm seeing this issue with Skype 2.2.0.35 on Ubuntu 11.10...

It looks like this was introduced with commit c30d046490eccbb97ac1ed0e4293226af55927ce and seems to be isolated to the file 'js/ui/windowAttentionHandler.js'

Simply reverting this change is a usability improvement IMO, but naturally, it reintroduces the issue that this commit was intended to fix:

"Newly open windows are focused by default (instead of appearing in the back with an annoying “Your window is ready” notification)" [1]

I particularly like the subtle "your window is ready" notification while others prefer new windows to steal focus. Perhaps this behavior should be configurable via cinnamon settings.

  1. http://cinnamon.linuxmint.com/?p=119
psych commented 12 years ago

Interesting that this would be the issue. I guess every time a message is received it's considered a new window instead of just a notification of a new message? It seems like a bug that this is what would happen, but is it in Cinnamon or Skype?

kneekoo commented 12 years ago

Oh, this is so annoying... :| I'm in a meeting in Skype and I can't do much as long as people write in there. The focus just keeps getting stolen by Skype.

ghost commented 12 years ago

Same problem, Cinnamon 1.2 and Skype on Mint 12. (Never used a previous version of Cinnamon though.)

mindrunner commented 12 years ago

confirm with gentoo and cinnemon 1.2 - very annoying. :(

psych commented 12 years ago

I saw on February 5 Glebihan submitted a fix for this issue and then reverted it because of inconsistent behavior. If there's anymore information that can be provided to help this along or a fix that can be tested I'd be happy to.

mwik commented 12 years ago

in /usr/share/cinnamon/js/ui/windowAttentionHandler.js, I simpy commented out

window.activate(global.get_current_time()); and now things behave as I want it to. I can't tell though what other effects this has.

psych commented 12 years ago

Awesome! Appreciate that tip.

As a workaround I've set Skype to auto start, move it to the second workspace, and then use pidgin to talk to my skype contacts. I find I actually like Pidgin better to talk to my Skype contacts.

sniffski commented 12 years ago

possible work around would be to add another check here to ignore skype windows also: /usr/share/cinnamon/js/ui/windowAttentionHandler.js

---
_onWindowDemandsAttention : function(display, window) {
        if (!window || window.has_focus() || window.is_skip_taskbar())
            return;

        window.activate(global.get_current_time());
    }
---

Maybe something like:
if (!window || window.has_focus() || window.is_skip_taskbar() || window.is_skype_window())
            return;

But I'm not familiar to what methods does window function has and how to describe it...

0v3rth3d4wn commented 12 years ago

Commenting the line did the job for me! Thank you! Still an officlal fix would be better.

amrun commented 12 years ago

same here :S i got the problem too. nearly popped a vein or something until i found out...

cheers

psych commented 12 years ago

Can someone confirm whether this still exists in Cinnamon 1.3?

Updated to Cinnamon 1.3 and this applets thing is giving me a whole host of troubles. Skype icon doesn't appear at all even though Skype is most definitely running (had it set to run on startup) among other things.

0v3rth3d4wn commented 12 years ago

Same here. The update didn't fix this issue for me. I had to comment out the aforementioned line in /usr/share/cinnamon/js/ui/windowAttentionHandler.js to fix the problem.

ceejatec commented 12 years ago

Thank you thank you! That jump-to-front was driving me batty. My problem app was the QtCreator IDE, which jumped up as soon as any build completed. Intensely annoying. I just stuck a "return;" at the beginning of _onWindowDemandsAttention() and all is better in the world.

This really needs to be configurable behaviour in Cinnamon...

amrun commented 12 years ago

is the change to the file /usr/share/cinnamon/js/ui/windowAttentionHandler.js overwritten on a new update of the package?

if not, i need to set a reminder ;)

mwik commented 12 years ago

Yes, it will be overwritten as it is not a configuration file.

ghost commented 12 years ago

Folks, here is my patch for this issue https://github.com/rat4/Cinnamon/compare/notification_style

Configurable through "org.cinnamon.notification-style" Possible values: 0 - do nothing here, but other notificators (window list applet) still can take care 1 - bring window to front, like current cinnamon 2 - show banner "app is ready", like gnome shell

What do you think?

zakkak commented 12 years ago

Sounds good, I would prefer something like "new message" however and not "app is ready"

psych commented 12 years ago

Thanks a lot for taking a look at this. I'll attempt to figure out how to patch in the next few days and take this for a spin.

beefsack commented 12 years ago

Problem still exists in Cinnamon 1.4 (Fedora 16 x86_64).

dimitrov-adrian commented 12 years ago

So waiting for next release ;)

Ri0n commented 12 years ago

same here Cinnamon 1.4 + gentoo + Psi+

kneekoo commented 12 years ago

Yup, the annoying bug persists. :|

psych commented 12 years ago

Has anyone tried rat4's patch from two months ago to see if it solves this? If it does maybe it can be proposed for inclusion in Cinnamon. I would, but my hard drive on my laptop went kaput and I'm running 12.04 on my desktop which doesn't seem to work with Cinnamon yet.

kneekoo commented 12 years ago

I didn't check the patch. I was hoping an official developer will fix this or at least recommend the patch until an official fix is out. I still have issues with Alt-F2 (not working) but that's another story. The thing is I prefer the official solutions.

mindrunner commented 12 years ago

Hi, i made a unified diff of rat4's implementation. You can find it here: http://pastebin.com/4AncNAVA

For the gentoo users, i changed the ebuild using this patch and host it in luman-overlay. I am just emerging ist and will begin testing right now. I think this should go upstream very quickly.

Edit: The default gnome3 bahavior is set as default, instead of default cinnamon behavior. I prefer this one and tested it sucessfully on my system. The others should work as well ;)

Scott-Mc commented 12 years ago

The patch provided by rat4 works successfully here.

AlbertJP commented 12 years ago

@rat4 Please do a pull request, then we can close this one. The patch may become incompatible if it isn't pulled soon.

sephiroth6 commented 12 years ago

mint 12 + cinnamon 1.4 problem still exists

AlbertJP commented 12 years ago

Yes, #623 is not yet pulled. May end up in Cinnamon 1.5 if such a version ever appears.

firsyura commented 12 years ago

I found solution for this issue: http://scott.cm/skype-auto-popup-with-cinnamon/

dimitrov-adrian commented 12 years ago

@firsyura this break my cinnamon (Ubuntu Oneric, cinnamon 1.4)

firsyura commented 12 years ago

mint 13 + cinnamon 1.4 This solution is working

AlbertJP commented 12 years ago

@dimitrov-adrian Yes with ubuntu 11.10 / mint 12 you'll have to do it with the repository package (or compile rat4's branch manually) but on 12.04 / 13 it can be fixed and I hope the fix will be pulled into master.

sniffski commented 12 years ago

Work around: Edit: /usr/share/cinnamon/js/ui/windowAttentionHandler.js

Find line:
        if (!window || window.has_focus() || window.is_skip_taskbar())
Replace with line:
        if (!window || window.has_focus() || window.is_skip_taskbar() || window.wm_class(skype))
clefebvre commented 12 years ago

A lot of work went into this so this is going to come as bad news. I should have reacted to it much earlier.

I don't like the idea of this being configurable.. mainly because this isn't a question of preference but a question of fixing a bug. The focus should always be taken when the user launches a new app and never be taken on his behalf when he doesn't trigger the creation of new content.

For Skype, I fixed the bug with this https://github.com/linuxmint/Cinnamon/commit/c5bbcad1cc4cc8183f2556deef867d0fae5f0109

For other apps which face a similar issue, I'd like people to insert the following code at line 27 in /usr/share/cinnamon/js/ui/windowAttentionHandler.js:

global.log_error("Focus stolen by : " + window.get_wm_class());

Then restart cinnamon, and when the focus is stolen from you, click on the ^ applet, troubleshoot, looking glass, click on the error tab, and you should see the wm class name of the app which stole your focus. Give me that wm class name, and we'll add it to Cinnamon.

swedik commented 11 years ago

Same problem with pidgin. window.get_wm_class() == "Pidgin" helped. Thanks

crazedsanity commented 10 years ago

I am experiencing this issue with Mint 16 Petra, Cinnamon 2.0.14. The issue happens with Pidgin, though I'll admit that's the only messaging system I use.

I am sad to see that this is still an issue. I'd searched for Pidgin-specific bugs for weeks before I realized it wasn't Pidgin at all.

Alucard1989pl commented 10 years ago

@sniffski thanks for this little guide fix, i've Cinnmon 2.2.13 and I add Kadu communicator on this line and it works perfectly for me :).

00gavin commented 9 years ago

Substituting Pidgin for Quassel in /usr/share/cinnamon/js/ui/windowAttentionHandler.js was the fix for me. Cheers!

cavebeat commented 9 years ago

hi, i have the same problem. every cinnamon update the file /usr/share/cinnamon/js/ui/windowAttentionHandler.js is resetted to upstream values. i am on LMDE2 64 bit Cinnamon, Cinnamon v2.8.2

i'd need two more Entries to suppress the stealing of Autofocus: Psi+ and RetroShare

I have created the following Pull-Request. https://github.com/linuxmint/Cinnamon/pull/4801

densha commented 4 years ago

Any updates on this? 3 years later, this is still an issue with the latest version of Linux Mint.

lgoebkes commented 4 years ago

I can confirm that this is still an issue with Telegram. Are there any updates on this matter?