xpra icon
Bug tracker and wiki

Opened 3 years ago

Closed 3 years ago

Last modified 8 months ago

#799 closed defect (fixed)

ungroup windows from taskbar

Reported by: John1221 Owned by: Smo
Priority: minor Milestone: 0.15
Component: client Version: trunk
Keywords: win32 Cc:

Description

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.

Attachments (2)

win32-group-leader.patch (3.8 KB) - added by Antoine Martin 3 years ago.
work in progress patch
ungroup_test_r8601.png (66.3 KB) - added by John1221 3 years ago.

Download all attachments as: .zip

Change History (19)

comment:1 Changed 3 years ago by Antoine Martin

Keywords: win32 added; combine removed
Milestone: 0.15
Owner: changed from Antoine Martin to Antoine Martin
Priority: majorminor
Status: newassigned
Summary: Combine window from taskbarungroup windows from taskbar

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.

Last edited 3 years ago by Antoine Martin (previous) (diff)

comment:2 Changed 3 years ago by 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)
Last edited 3 years ago by Antoine Martin (previous) (diff)

Changed 3 years ago by Antoine Martin

Attachment: win32-group-leader.patch added

work in progress patch

comment:3 Changed 3 years ago by Antoine Martin

Owner: changed from Antoine Martin to John1221
Status: assignednew

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.

Last edited 3 years ago by Antoine Martin (previous) (diff)

comment:4 in reply to:  3 Changed 3 years ago by John1221

Owner: changed from John1221 to Antoine Martin

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:

  • Windows XP: not work for me. I know XP is a very old OS. But for some reasons, I have to maintain it.
  • Windows 7: just work with Firefox only. Chrome, Opera and xterm are still group together. (I attached a new screenshot)

    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.

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

Last edited 3 years ago by John1221 (previous) (diff)

Changed 3 years ago by John1221

Attachment: ungroup_test_r8601.png added

comment:5 Changed 3 years ago by Antoine Martin

Owner: changed from Antoine Martin to John1221

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..)

comment:6 in reply to:  5 Changed 3 years ago by John1221

Owner: changed from John1221 to Antoine Martin

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.

comment:7 Changed 3 years ago by Antoine Martin

Resolution: fixed
Status: newclosed

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!

comment:8 in reply to:  7 Changed 3 years ago by 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 !! :)

comment:9 Changed 3 years ago by 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)

comment:10 Changed 3 years ago by 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'>

comment:11 Changed 3 years ago by 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.

comment:12 Changed 3 years ago by 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
Last edited 3 years ago by Antoine Martin (previous) (diff)

comment:13 Changed 3 years ago by alas

Resolution: fixed
Status: closedreopened

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.

comment:14 Changed 3 years ago by alas

Owner: changed from Antoine Martin to Smo
Status: reopenednew

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

Handing this off to you Smo.

comment:15 Changed 3 years ago by 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.

comment:16 Changed 3 years ago by Smo

Resolution: fixed
Status: newclosed

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

comment:17 Changed 8 months ago by 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).

Note: See TracTickets for help on using tickets.