Xpra: Ticket #799: ungroup windows from taskbar

Use Windows OS client (Window XP, Windows 7 and later), windows opened via xpra will combine all of them to a button "Xpra : screen for X " instead of separating related windows.



Fri, 30 Jan 2015 04:44:50 GMT - Antoine Martin: status, summary, priority, owner, keywords changed; milestone set

Original ML post: Combine window from taskbar.

MSDN link: Application User Model IDs (AppUserModelIDs)

In particular: A single executable file with a UI with multiple modes that appear to the user as separate applications should assign different AppUserModelIDs to each mode. For instance, a portion of an application that users see as an independent experience that they can pin to and launch from the taskbar separately from the rest of the application should have its own AppUserModelID, separate from the main experience."

It looks like we need to call SHGetPropertyStoreForWindow and add the AppUserModelIDs we want on each window.


Sat, 31 Jan 2015 05:41:54 GMT - Antoine Martin:

I think this is the pywin32 part solved (looks easy, but took hours to figure out) - Windows 7 onwards only:

from win32com.propsys import propsys
ps = propsys.SHGetPropertyStoreForWindow(hwnd)
key = propsys.PSGetPropertyKeyFromName("System.AppUserModel.ID")
value = propsys.PROPVARIANTType("hello")
ps.SetValue(key, value)

Sat, 31 Jan 2015 07:27:43 GMT - Antoine Martin: attachment set

work in progress patch


Sat, 31 Jan 2015 08:03:26 GMT - Antoine Martin: owner, status changed

It's done as of r8601.

You can find a beta win32 client with this change.

Please let us know if that works for you. This is not suitable for a v0.14.x backport.

I've just noticed one small problem: the window icon does not seem to be set properly if I open a secondary window with Firefox, it shows the default GTK icon instead. So please re-assign to me after testing.


Mon, 02 Feb 2015 08:33:29 GMT - John1221: owner changed

Please let us know if that works for you. This is not suitable for a v0.14.x backport.

I've just tested with Windows XP and Windows 7 client. And:

With windows 7: I opened 3 Firefox's windows, and all of them show the default Firefox icon, not default GTK icon.


Mon, 02 Feb 2015 08:38:41 GMT - John1221: attachment set


Mon, 02 Feb 2015 09:31:17 GMT - Antoine Martin: owner changed

Windows XP: not work for me.


It is not meant to work with XP. The API does not exist in versions older than Windows 7. To get a different grouping with XP, you would need a separate xpra client process, and therefore a different server session. This cannot be fixed from within xpra.

Chrome, Opera and xterm are still group together.


Fixed in r8603 - new beta uploaded, this one is actually a different, long standing bug which will be backported.

(side note: that's my luck: all the apps I tested, like Firefox, worked as they set the group leader property, Chrome and Opera do not..)


Mon, 02 Feb 2015 10:29:24 GMT - John1221: owner changed

Chrome, Opera and xterm are still group together.


Fixed in r8603 - new beta uploaded, this one is actually a different, long standing bug which will be backported.

Just test again. Chrome, Opera and xterm are ungroup now. xterm's windows are separate to many group only.

(side note: that's my luck: all the apps I tested, like Firefox, worked as they set the group leader property, Chrome and Opera do not..)

I think so, too. So I tested all of them.


Mon, 02 Feb 2015 11:14:16 GMT - Antoine Martin: status changed; resolution set

xterm's windows are separate to many group only.


each xterm gets its own group because we use the process pid to decide if windows belong in the same group when the application doesn't specify a group leader. I guess we could use the command and/or window class to group things differently, but this could cause more bugs and what we have works well enough I think. So I am closing this ticket.


So I tested all of them.


Thank you very much!


Mon, 02 Feb 2015 17:01:10 GMT - John1221:

each xterm gets its own group because we use the process pid to decide if windows belong in the same group when the application doesn't specify a group leader. I guess we could use the command and/or window class to group things differently, but this could cause more bugs and what we have works well enough I think. So I am closing this ticket.

Yeah, I don't use xterm in my case. Thank you very much for your quick reply and fix !! :)


Thu, 05 Feb 2015 07:09:35 GMT - Antoine Martin:

Whilst backporting some of those changes to v0.14.x, I found more problems with it (including one bug which could lead to a hidden window+memory leak), so there are more fixes for this in r8628 + r8629, r8630, logging tweaks in r8632.

Since I was there, I also changed it so we now group by window class in trunk (done in r8626 - but this won't be the case in v0.14.x where we will continue to prefer the pid if present): so now xterms get grouped together.

Backport of most of this to v0.14.x is in r8631. Beta build of both 0.14 and trunk are in the beta area (note: 0.14.x will not be getting the grouping code for MS Windows - so it is only there to verify that things aren't broken elsewhere by these changes)


Sat, 21 Feb 2015 06:04:56 GMT - Antoine Martin:

Unconfirmed reports of problems with SHGetPropertyStoreForWindow in ticket:756#comment:5. @afarr: please re-open this ticket if needed.

With -d win32, you should be seeing something like:

win32 hooks: propsys=<module 'win32com.propsys.propsys' from 'C:\Program Files (x86)\Xpra\win32com.propsys.propsys.pyd'>
hooked group leader override using <module 'win32com.propsys.propsys' from 'C:\Program Files (x86)\Xpra\win32com.propsys.propsys.pyd'>

Mon, 23 Feb 2015 20:12:17 GMT - alas:

Using 0.15.0 r8689 windows client (windows 8.1) against 0.15.0 r8661 fedora 20 client, with -d win32 I am seeing no sign of the SHGetPropertyStoreForWindow errors mentioned in #756.

It must've been the older client. Leaving closed.


Tue, 24 Feb 2015 03:36:10 GMT - Antoine Martin:

Minor warning fixed in r8694:

C:\Program Files\Xpra\library.zip\xpra\client\gtk2\client.py:399: GtkWarning: gdk_window_set_group not implemented

Wed, 04 Mar 2015 01:33:37 GMT - alas: status changed; resolution deleted

I may have spoken too soon... testing (other things) with win32 client 0.15.0 r8743 against fedora 20 server 0.15.0 r8743 ...

Whenever I open a new application from a start-child xterm (firefox, gedit, transparent_colors.py, test_workspace.py, etc.) I get that error message again: 2015-03-03 17:26:17,224 failed to set group leader: 'module' object has no attribute 'SHGetPropertyStoreForWindow'.

I guess I'll open this ticket back up.


Wed, 04 Mar 2015 02:13:51 GMT - alas: owner, status changed

Whoops... testing again with your 0.15.0 r8743 win32 build ... no sign of that error message.

Handing this off to you Smo.


Thu, 05 Mar 2015 17:21:23 GMT - Smo:

Tried installing http://sourceforge.net/projects/pywin32/ again into my build system.

I seem to be able to do

from win32com import propsys in python so I will try to build again and test.

Odd I had this installed before so i'm not sure why this is an issue.


Thu, 05 Mar 2015 23:24:50 GMT - Smo: status changed; resolution set

This seems to have solved the issue not sure why but the message is now gone.


Mon, 16 Jan 2017 11:19:26 GMT - Antoine Martin:

The window group code has been re-implemented in C++ (see r14795) so we can move away from pywin32 and use a newer build system (see #678).


Sat, 23 Jan 2021 05:06:18 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/799