Feuerfuchs / Collapsible-Systray-Cinnamon-Applet

A replacement for the abandoned System Tray Collapsible Cinnamon applet
10 stars 0 forks source link

Bug: collapsed icons are cached #7

Closed Roman-Skripka closed 7 years ago

Roman-Skripka commented 8 years ago

If the application's icon is hidden and this application updates the icon (e.g. new message came), then the icon doesn't get an update. For non-collapsed icons it works fine.

Feuerfuchs commented 8 years ago

I don't use any applications that change their icons often, so I had to find a fix blindly. Can you please try if it the bug is still there? (The changes are currently only on GitHub)

Feuerfuchs commented 8 years ago

Installed Pidgin and tried it myself — didn't fix it. :(

Roman-Skripka commented 8 years ago

Yeah, just checked it myself. New bug appeared - moving app from active list to collapsed one closes settings menu

Roman-Skripka commented 8 years ago

Not sure if it was made by intention, but active app icons stopped updating as well )

Feuerfuchs commented 8 years ago

I've been looking for a solution for hours now, but nothing works. I can only conclude that Cinnamon's way of handling tray icons is very bugged. The only solution I can come up with is to remove animations and reload all tray icons if the user expands/collapses the tray. Looks ugly, but it eliminates this bug.

Feuerfuchs commented 8 years ago

Alright, I just found a semi-working solution. Hidden icons will keep working now, but there are some exceptions. 1: Chromium is only a quarter disk; 2: If the Pidgin icon starts blinking, it just disappears. Hiding and un-hiding it while it's not blinking fixes that (until it blinks again). Still, this solution is way more acceptable than reloading all icons as it allows me to keep animations. :)

Feuerfuchs commented 8 years ago

And now the solution is complete. :) Depending on the application I use different methods to hide the icon. This way, I could fix Pidgin and Chromium.

Please let me know if there are still some icons that don't behave correctly!

Roman-Skripka commented 8 years ago

Well, as a developer, I don't think that having a list of apps-exclusions is the right way to handle issues like that. And after this fix I have awt app quarted, the same I think can happen to chromium-browser(chrome?) icon. One more bug - moving the app to the list of collapsed apps not only reloads the whole applet, but also makes other icons there invisible until applet's reload. If the root cause lies in cinnamon implementation, I think you should report about it to their bug tracker. P.S. at least skype icons work as expected if collapsed and this is great

Roman-Skripka commented 8 years ago

To track issue with applet's reload on settings change https://github.com/Feuerfuchs/Collapsible-Systray-Cinnamon-Applet/issues/8

Feuerfuchs commented 8 years ago

Well, as a developer, I don't think that having a list of apps-exclusions is the right way to handle issues like that

I don't like it either, but I don't have much of a choice. Even the Cinnamon developers themselves handled it like that, just take a look at this code: https://github.com/linuxmint/Cinnamon/blob/master/files/usr/share/cinnamon/applets/systray%40cinnamon.org/applet.js#L275-#L297

I'll open an issue, but it seems these problems are all related to the one described in this file: https://github.com/linuxmint/Cinnamon/blob/master/src/cinnamon-embedded-window.c But let's see if they can find a solution...

awt app quarted

Does the applet show the name as "awt"? (I need this to add it to the exception list)

Roman-Skripka commented 8 years ago

@Feuerfuchs sorry, I made a typo, it appears in settings as 'swt'.

Roman-Skripka commented 8 years ago

To track the issue with missing icons https://github.com/Feuerfuchs/Collapsible-Systray-Cinnamon-Applet/issues/9

Feuerfuchs commented 8 years ago

I am now investigating a new method to display icons. Let's hope this one will solve all issues and I won't have to maintain an exclusion list. :S

Feuerfuchs commented 8 years ago

Today I tried a lot of things to make icons work properly, but it seems there's no way to get around the exception lists. My efforts aren't wasted, though – the code is now considerably better.

Feuerfuchs commented 8 years ago

I reported the issue now: https://github.com/linuxmint/Cinnamon/issues/5573 Let's hope the developers there find a solution.

ghost commented 8 years ago

@Feuerfuchs do you have a better idea of how this will work? I think it's nice they don't update while they are hidden. I only think in one better solution that re-add the icons... This is create a refresh function inside the cinnamon api if not exist... Do you search for something like Refresh?

ghost commented 8 years ago

I dont't know if you speak about the cinnamon systray icons or the indicators... They sure will need different solutions...

Feuerfuchs commented 8 years ago

@lestcape App indicators don't have any issues since they use the proper API (e.g. ClutterImage) to display the icons. Tray icons, however, are displayed by using an invisible GtkWindow whose content is composed onto the desktop using a special ClutterTexture. That solution seems to have some issues, such as that icons aren't updated anymore as soon as they become invisible, and the only way to make them work again is to completely reload them. So what I need is either a fix for this problem, or some way to make icons work again after they have stopped updating without reloading them entirely.

ghost commented 8 years ago

I can only help for app indicators because it's what i merged in cinnamon, but i know you are right.... Do you test this: https://github.com/linuxmint/Cinnamon/blob/master/files/usr/share/cinnamon/applets/systray%40cinnamon.org/applet.js#L228?

Feuerfuchs commented 8 years ago

That line of code you linked reloads all tray icons completely, and that's what I don't want to do. The only time I could reload all icons to make them work again would be after the expand animation, so what the user would see is that all icons suddenly disappear as soon as the animation is finished and re-appear after one or two seconds — that wouldn't look good at all. :/

ghost commented 8 years ago

Ok, but see, this is the way of how the thing are... what you need is a change of the api or found a work around, but tray icons works in this way...

Feuerfuchs commented 8 years ago

And that is why I posted an issue is the Cinnamon repository — to have the developers take a look if they can change "the way of how things are". Surely it can't be intentional behavior for tray icons to stop updating if their actor becomes invisible?

ghost commented 8 years ago

I don't know if was or not an intentional behaviour... The embedded GtkIncons come from Cinnamon.TrayManager implementation. In the cjs part there are not anything relate with that: https://github.com/linuxmint/Cinnamon/blob/master/js/ui/statusIconDispatcher.js

You need to search in the C++ class if there are something like that, But could be also a behavior of the embedded actors and not a systray specific. Like the systray provide the only embedded icons in cinnamon i don't have a point to compare...

I also don't know where is implemented the TrayManager, if i found where it's i will say you...

Feuerfuchs commented 8 years ago

I'm not sure what your point is. I'm not looking for a solution anymore, I'm just waiting for what the Cinnamon developers can say about the matter.

ghost commented 8 years ago

My point is that you can find the solution to this problem like any cinnamon dev. Wait for the cinnamon devs it's not an option... You could be a cinnamon devs if you want... Just find a good solution for that and create a pull request to solve the issue... But of course if this is not your intention you can wait if you want...

Feuerfuchs commented 8 years ago

If I didn't have exams currently I would've done that, but right now it doesn't seem like a good idea to learn how Cinnamon works and set up my computer for debugging and whatnot. ^^

Feuerfuchs commented 8 years ago

Besides, I actually did take a look at the C files and pointed to a possible explanation for the issues (see my issue in the Cinnamon repository). But I really can't do more than that ATM.