clementine-player / Clementine

:tangerine: Clementine Music Player
https://www.clementine-player.org/
GNU General Public License v3.0
3.74k stars 676 forks source link

Cannot activate the main window from tray on Win7 #4557

Open HappySeaFox opened 10 years ago

HappySeaFox commented 10 years ago

Sometimes when I click the tray icon the main window is shown, but it is not active. I need to activate it by hand. This happens due to limitations of Windows platform described here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms633539%28v=vs.85%29.aspx . But we can use a small hack with AttatchThreadInput() to force the main window be active. I use it in my Qt application with tray and everything works fine.

Patch: http://pastebin.com/4ATATQWR

I didn't test it with Clementine, but it should work just fine.

adem4ik commented 10 years ago

Ye, I can confirm this problem, happens on my Win7 machine too.