http://bugs.winehq.org/show_bug.cgi?id=32699
Bug #: 32699 Summary: Add StartupWMClass to .desktop files. Product: Wine Version: 1.5.21 Platform: x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: Schnuff_Forum@web.de Classification: Unclassified
See launchpad bug here: https://bugs.launchpad.net/unity/+bug/702452
In Ubuntu Unity applications run via wine have the default wine-icon (the wine-bottle) in the "Running Program-Icons"-bar (The Task-bar). Thus all applications are getting "stacked" under one icon.
To stop this behavior you have to write in each (generated) .desktop-file the Line: StartupWMClass=<name of the exe-file>
Example Firefox: StartupWMClass=firefox.exe
Wine should do this automatically after I installed my program, so the users would get the expected Icons and "Stacking-Mechanism" in Unity.
http://bugs.winehq.org/show_bug.cgi?id=32699
Simon Schnuff_Forum@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://launchpad.net/bugs/ | |702452
http://bugs.winehq.org/show_bug.cgi?id=32699
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, integration Component|-unknown |programs Severity|normal |enhancement
http://bugs.winehq.org/show_bug.cgi?id=32699
Marco Trevisan (Treviño) mail@3v1n0.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mail@3v1n0.net
http://bugs.winehq.org/show_bug.cgi?id=32699
rgcjonas@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |rgcjonas@gmail.com
--- Comment #1 from rgcjonas@gmail.com 2013-04-13 10:33:11 CDT --- This bug is a huge usability problem nowadays (in both Gnome Shell and Unity). The current solution matches all wine applications to a single desktop file, because every wine window has a WM_CLASS of "Wine" and the desktop file a StartupWMClass=Wine . I'd consider this incorrect, because * Every wine application is now grouped to the same .desktop file, even though they're completely different applications * You can't start the application the window belongs to by clicking the .desktop file (<-- this is the real problem)
Furthermore, this leads to the following problems in both Unity and gnome shell: * Every wine window is grouped to the same icon * The description "Wine windows program launcher" doesn't help when identifying the application * You can pin the icon to the launcher, but it will never start anything.
Luckily, windows 7 can also group and pin apps on the taskbar, and AFAIK (correct me if I'm wrong) they match windows to launchers as follows: * If the process set a AppUserModelID for the process or the window, then windows 7 searches for a shortcut file with the matching property System.AppUserModel.ID * In case that fails, it falls back to searching a shortcut that specifies the running exe file. * If that doesn't work either, the 'pinning' feature is disabled for that window, and it will be grouped by the process exe file.
The only way to correctly solve our problem is by replicating windows 7's method. I'd suggest the following implementation: * Set the StartupWMClass of every .desktop file to the System.AppUserModel.ID property of the windows shortcut (if it exists) or the (case sensitive) name of the launched .exe file. * Let every wine window have a WM_CLASS (res_class, because gnome shell ignores res_name) of the explicit AppUserModelID, if the application has set it, or the name of the running .exe file (the value that is set to res_name as of now).
This would then show the following behaviour (which IMHO is the one the user will probably expect): * If the application correctly set an AppUserModelID and specified it in the shortcut, the desktop will match the windows with the correct .desktop file. It will be pinnable. * If the application displays the window from the same process that is started with the shortcut, it will also be matched (because of the .exe file name in wm_class). * If the window does not belong to any shortcut, the desktop environment won't match it. The app will not be pinnable in that case. I don't know how Unity or Gnome Shell would handle grouping in that case.
http://bugs.winehq.org/show_bug.cgi?id=32699
Damjan Jovanovic damjan.jov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW CC| |damjan.jov@gmail.com Ever Confirmed|0 |1
--- Comment #2 from Damjan Jovanovic damjan.jov@gmail.com 2013-05-28 07:46:57 CDT --- Anything running under any runtime or custom loader (Java, Mono, Python, Perl, Ruby, even running an application with strace or gdb) will exhibit exactly the same stacking problem. Wow the Linux desktop is really owning.
http://bugs.winehq.org/show_bug.cgi?id=32699
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fracting@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=32699
--- Comment #3 from rgcjonas@gmail.com 2013-05-28 07:58:09 CDT --- The same problem microsoft was facing when they introduced windows 7. They developed a solution (AppUserModelIDs) which maps quite cleanly to the linux solution (WMClass). We just need to implement that AppUserModelID stuff and export it as WM Classes.
http://bugs.winehq.org/show_bug.cgi?id=32699
--- Comment #4 from Vincent Povirk madewokherd@gmail.com 2013-05-28 12:21:52 CDT --- AppUserModelID is the way to go in the long run, but it requires some missing architecture (which I've been slowly working on implementing). And to really match Windows, we'd have to generate .desktop files on demand for running programs. Of course, the .exe bit could be done without any of the new architecture.
http://bugs.winehq.org/show_bug.cgi?id=32699
--- Comment #5 from Marco Trevisan (Treviño) mail@3v1n0.net 2013-05-28 13:24:28 CDT --- (In reply to comment #2)
Anything running under any runtime or custom loader (Java, Mono, Python, Perl, Ruby, even running an application with strace or gdb) will exhibit exactly the same stacking problem. Wow the Linux desktop is really owning.
That's not completely true as all these environments are generally able to be launched using an exec that matches the desktop-id or the WMClass or either to provide their WMClass. Also, at least in unity, we have a whitelist of loaders that receive a different treatment (we handle the parameter instead of the launched binary), but this is not something that can be done easily also with Wine if we want to have some basic application <-> desktop-file matching.
However, having a StartupWMClass that matches the launched .exe file (if possibile) would be enough (at least for Ubuntu unity) to properly match wine applications.
https://bugs.winehq.org/show_bug.cgi?id=32699
Michael Müller michael@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |michael@fds-team.de
--- Comment #6 from Michael Müller michael@fds-team.de --- Hi,
I wrote a tiny patch which changes the window class inside of winex11 from "Wine" to the name of the program executable. This solves the problem and does not require any changes to desktop files (and it also works if you start the program from a terminal). Most window managers should now only group together the windows of the same executable and not all wine applications. The patch is available at:
https://github.com/compholio/wine-compholio/blob/master/patches/winex11-Wind...
Could you guys verify that it works for you? I tested it with XFCE and Unity and it solves the problem.
The patch does not implement the AppUserModelIDs feature but since Wine still defaults to Windows XP mode, I assume that most applications wouldn't use this feature anyway.
Michael
https://bugs.winehq.org/show_bug.cgi?id=32699
Stuart Axon stu.axon@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |stu.axon@gmail.com
--- Comment #7 from Stuart Axon stu.axon@gmail.com --- Created attachment 50037 --> https://bugs.winehq.org/attachment.cgi?id=50037 Low DPI icons
Low DPI icons on internal apps, wine progman has none.
https://bugs.winehq.org/show_bug.cgi?id=32699
--- Comment #8 from Marco Trevisan (Treviño) mail@3v1n0.net --- (In reply to Michael Müller from comment #6)
Hi,
I wrote a tiny patch which changes the window class inside of winex11 from "Wine" to the name of the program executable. This solves the problem and does not require any changes to desktop files (and it also works if you start the program from a terminal). Most window managers should now only group together the windows of the same executable and not all wine applications. The patch is available at:
Well, while this fixes the grouping problem, this won't allow window managers to associate the actual .desktop file to the window, and thus you'd just use the embedded icon or window name, instead of the applications data defined in the .desktop file.
https://bugs.winehq.org/show_bug.cgi?id=32699
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sebastian@fds-team.de
https://bugs.winehq.org/show_bug.cgi?id=32699
Jactry Zeng jactry92@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jactry92@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=32699
--- Comment #9 from Vincent Povirk madewokherd@gmail.com --- The default when AppUserModelID's are implemented should be the full path to the .exe file (exe's with the same filename in different directories do not group together on windows), so that's what I'd suggest setting WM_CLASS to.
https://bugs.winehq.org/show_bug.cgi?id=32699
Iuri Diniz sinister@bol.com.br changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sinister@bol.com.br
--- Comment #10 from Iuri Diniz sinister@bol.com.br --- I made a script in order to automate the process: https://gist.github.com/iuridiniz/85403545d0fd7e4a0000
Requisites: Python 2.7 pyxdg pylnk
Quick install all the requisites: $ sudo pip install pylnk pyxdg
Quick usage: $ python fix-wine-desktop-entry.py FILE.desktop
Quick fix all .desktop entries of a wine default installation: $ find ~/.local/share/applications/wine -name "*.desktop" -exec python fix-wine-desktop-entry.py {} ;
https://bugs.winehq.org/show_bug.cgi?id=32699
Michael Müller michael@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |STAGED Staged patchset| |https://github.com/wine-com | |pholio/wine-staging/tree/ma | |ster/patches/winex11-Window | |_Groups
https://bugs.winehq.org/show_bug.cgi?id=32699
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
https://bugs.winehq.org/show_bug.cgi?id=32699
josh jake.phy@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jake.phy@gmail.com
--- Comment #11 from josh jake.phy@gmail.com --- Is there any news on this? The missing StartupWMClass=program.exe in the desktop files, is causing issues in my Mint Linux applet. https://github.com/jake-phy/WindowIconList/issues/105
https://bugs.winehq.org/show_bug.cgi?id=32699
Eike Hein hein@kde.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |hein@kde.org
--- Comment #12 from Eike Hein hein@kde.org --- I maintain the taskbar in KDE's Plasma 5. We have the same problem that Gnome Shell and Unity do. Is there any chance we can get wine to set StartupWMClass in the .desktop files it generates to the executable name it sets in WM_CLASS so we can match without unreliable hackery?
https://bugs.winehq.org/show_bug.cgi?id=32699
--- Comment #13 from Eike Hein hein@kde.org --- I've started a thread on wine-devel that goes into greater detail on this issue: https://www.winehq.org/pipermail/wine-devel/2017-April/117413.html
https://bugs.winehq.org/show_bug.cgi?id=32699
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest@luukku.com
--- Comment #14 from winetest@luukku.com --- (In reply to Eike Hein from comment #13)
I've started a thread on wine-devel that goes into greater detail on this issue: https://www.winehq.org/pipermail/wine-devel/2017-April/117413.html
Since you are so aware of the issue are you able to form a better fix? Basically anyone can contribute to wine.
https://bugs.winehq.org/show_bug.cgi?id=32699
--- Comment #15 from Eike Hein hein@kde.org --- I'm really really hoping for someone more qualified to pop up (since I don't know the wine codebase), but failing that I can try to take a stab at it yes.
https://bugs.winehq.org/show_bug.cgi?id=32699
--- Comment #16 from winetest@luukku.com --- (In reply to Eike Hein from comment #15)
I'm really really hoping for someone more qualified to pop up (since I don't know the wine codebase), but failing that I can try to take a stab at it yes.
Does this link help?
https://source.winehq.org/git/wine.git/blob/9f55292085392579568ff81b8adb926b...
I am not sure what to search from there.
StartupWMClass WM_CLASS
Gave no results.
https://bugs.winehq.org/show_bug.cgi?id=32699
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gijsvrm@gmail.com
--- Comment #17 from Gijs Vermeulen gijsvrm@gmail.com --- Was this fixed by: https://source.winehq.org/git/wine.git/commit/917e86dd7a4cca1da47262caaded2b... ?
https://bugs.winehq.org/show_bug.cgi?id=32699
--- Comment #18 from Eike Hein hein@kde.org --- I haven't had a chance to test it yet, but going by the description and diff it looks good.
https://bugs.winehq.org/show_bug.cgi?id=32699
--- Comment #19 from Eike Hein hein@kde.org --- I've tested this now and I can confirm it works nicely. Thanks, this improves the experience for our users quite a bit.
https://bugs.winehq.org/show_bug.cgi?id=32699
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|STAGED |RESOLVED Fixed by SHA1| |917e86dd7a4cca1da47262caade | |d2bef9e022f99
--- Comment #20 from Austin English austinenglish@gmail.com --- (In reply to Eike Hein from comment #19)
I've tested this now and I can confirm it works nicely. Thanks, this improves the experience for our users quite a bit.
Reported fixed (please reopen if it's not).
https://bugs.winehq.org/show_bug.cgi?id=32699
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #21 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 3.4.