davidedmundson / xembed-sni-proxy

Convert XEmbed system tray icons to SNI icons
GNU General Public License v2.0
32 stars 6 forks source link

Fix transparent icons in runtime. #22

Closed tehnick closed 8 years ago

tehnick commented 8 years ago

But it does not fix transparent icons for WINE applications at startup.

Unfortunately your workaround with QTimer::singleShot() and SNIProxy::update() does not help to WINE applications. For all Wine applications, which I have tested, icons become correct only after (any) mouse click on them in SNI. So another workaround is required....

Crazy-Hopper commented 8 years ago

Creating the container window on-screen, e.g on pixel (0, 0) seems to make wine icons to be drawn immediately. Could you please test it?

davidedmundson commented 8 years ago

Thanks, good stuff.

Crazy-Hopper commented 8 years ago

Were you referring to the patch or the suggested wine workaround? :-)

tehnick commented 8 years ago

All remarks were fixed. Please recheck this pull request.

tehnick commented 8 years ago

Were you referring to the patch or the suggested wine workaround? :-)

+1 for this question

tehnick commented 8 years ago

@Crazy-Hopper Do you suggest to create a container window at pixel(0, 0) and then to move it somewhere?

davidedmundson commented 8 years ago

If it behaves better with the window on screen.. sure lets do it.

I have another idea I want to try: using _net_wm_sync_request http://standards.freedesktop.org/wm-spec/wm-spec-1.4.html#idm139915842324928

It's quite a big change, I'll try and do that tomorrow or so

Another thing to think about; should we delay telling the SNIHost about our StatusNotifierItem until we get an image? Will save us ever posting a blank space.

Crazy-Hopper commented 8 years ago

@tehnick I tested without moving it. Just created at (0,0).

Crazy-Hopper commented 8 years ago

BUT! there is quite a noticeable flickery at (0,0). That happens on repeated sendClick().

Crazy-Hopper commented 8 years ago

I thought that container window would be moved to where SNI is and will be left there. But apparently something moves it back to (0,0)

Crazy-Hopper commented 8 years ago

U-huh. It's the SNIProxy::Scroll() that moves container back to (0,0) :-)

tehnick commented 8 years ago

@Crazy-Hopper I may confirm that your workaround works fine. Now I do not see transparent icons at all. Nor in Wine apps, nor in Gtk+ based apps, nor in Java-based apps...

tehnick commented 8 years ago

@Crazy-Hopper

That would explain why you missed that. :-) But definitely not a reason for keeping that code.

Personally I do not use animated icons in system tray since first versions of KDE4, because it has huge memory leaks. Yes, this is old system tray with all its problems. But KDE Plasma 5 has similar (but not the same) bug in a new cool system tray. So it is better to not use animated icons in KDE system tray at all.

As for Psi and Psi+. Just few notes:

Well, i reverted in my fork.

Bad idea. Just look at amount of debug messages about skipping transparent icons.

And I was too quick in judgement. This change does help TeamViewer icon not to disappear completely.

Ok.

But making it skipping absolutely transparent images (i.e. sum==0) doesn't help Psi either.

Yep, this shouldn't change anything.

Somewhat improved your patch in e762a4c

Sorry, but it is useless from my point of view, because tray icons are very tiny.

Gotta search for some better way to solve it.

If I understand correctly xembed system tray in KDE4 don't have this bug because program icon is permanently updated. You just cannot notice such fast blink (only few transparent frames). But such solution is not suitable for SNI.