Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ungroup windows from taskbar #799

Closed
totaam opened this issue Jan 30, 2015 · 36 comments
Closed

ungroup windows from taskbar #799

totaam opened this issue Jan 30, 2015 · 36 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Jan 30, 2015

Issue migrated from trac ticket # 799

component: client | priority: minor | resolution: fixed | keywords: win32

2015-01-30 04:29:42: John1221 created the issue


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.

@totaam
Copy link
Collaborator Author

totaam commented Jan 30, 2015

2015-01-30 04:44:50: totaam changed status from new to assigned

@totaam
Copy link
Collaborator Author

totaam commented Jan 30, 2015

2015-01-30 04:44:50: totaam changed title from Combine window from taskbar to ungroup windows from taskbar

@totaam
Copy link
Collaborator Author

totaam commented Jan 30, 2015

2015-01-30 04:44:50: totaam changed priority from major to minor

@totaam
Copy link
Collaborator Author

totaam commented Jan 30, 2015

2015-01-30 04:44:50: totaam changed owner from antoine to totaam

@totaam
Copy link
Collaborator Author

totaam commented Jan 30, 2015

2015-01-30 04:44:50: totaam commented


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.

@totaam
Copy link
Collaborator Author

totaam commented Jan 31, 2015

2015-01-31 05:41:54: totaam commented


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)

@totaam
Copy link
Collaborator Author

totaam commented Jan 31, 2015

2015-01-31 07:27:44: antoine uploaded file win32-group-leader.patch (3.8 KiB)

work in progress patch

@totaam
Copy link
Collaborator Author

totaam commented Jan 31, 2015

2015-01-31 08:03:27: antoine changed status from assigned to new

@totaam
Copy link
Collaborator Author

totaam commented Jan 31, 2015

2015-01-31 08:03:27: antoine changed owner from totaam to John1221

@totaam
Copy link
Collaborator Author

totaam commented Jan 31, 2015

2015-01-31 08:03:27: antoine commented


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.

@totaam
Copy link
Collaborator Author

totaam commented Feb 2, 2015

2015-02-02 08:33:30: John1221 changed owner from John1221 to totaam

@totaam
Copy link
Collaborator Author

totaam commented Feb 2, 2015

2015-02-02 08:33:30: John1221 commented


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.

@totaam
Copy link
Collaborator Author

totaam commented Feb 2, 2015

2015-02-02 08:38:42: John1221 uploaded file ungroup_test_r8601.png (66.3 KiB)

ungroup_test_r8601.png

@totaam
Copy link
Collaborator Author

totaam commented Feb 2, 2015

2015-02-02 09:31:18: totaam changed owner from totaam to John1221

@totaam
Copy link
Collaborator Author

totaam commented Feb 2, 2015

2015-02-02 09:31:18: totaam commented


Windows XP: not work for me.
[[BR]]
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.
[[BR]]

Chrome, Opera and xterm are still group together.
[[BR]]
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..)

@totaam
Copy link
Collaborator Author

totaam commented Feb 2, 2015

2015-02-02 10:29:24: John1221 changed owner from John1221 to totaam

@totaam
Copy link
Collaborator Author

totaam commented Feb 2, 2015

2015-02-02 10:29:24: John1221 commented


Chrome, Opera and xterm are still group together.
[[BR]]
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.

@totaam
Copy link
Collaborator Author

totaam commented Feb 2, 2015

2015-02-02 11:14:17: totaam changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Feb 2, 2015

2015-02-02 11:14:17: totaam set resolution to fixed

@totaam
Copy link
Collaborator Author

totaam commented Feb 2, 2015

2015-02-02 11:14:17: totaam commented


xterm's windows are separate to many group only.
[[BR]]
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.

[[BR]]

So I tested all of them.
[[BR]]
Thank you very much!

@totaam
Copy link
Collaborator Author

totaam commented Feb 2, 2015

2015-02-02 17:01:11: John1221 commented


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 !! :)

@totaam
Copy link
Collaborator Author

totaam commented Feb 5, 2015

2015-02-05 07:09:35: antoine commented


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

@totaam
Copy link
Collaborator Author

totaam commented Feb 21, 2015

2015-02-21 06:04:57: antoine commented


Unconfirmed reports of problems with SHGetPropertyStoreForWindow in #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'>

@totaam
Copy link
Collaborator Author

totaam commented Feb 23, 2015

2015-02-23 20:12:17: afarr commented


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.

@totaam
Copy link
Collaborator Author

totaam commented Feb 24, 2015

2015-02-24 03:36:11: antoine commented


Minor warning fixed in r8694:

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

@totaam
Copy link
Collaborator Author

totaam commented Mar 4, 2015

2015-03-04 01:33:37: afarr changed status from closed to reopened

@totaam
Copy link
Collaborator Author

totaam commented Mar 4, 2015

2015-03-04 01:33:37: afarr removed resolution (was fixed)

@totaam
Copy link
Collaborator Author

totaam commented Mar 4, 2015

2015-03-04 01:33:37: afarr commented


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.

@totaam
Copy link
Collaborator Author

totaam commented Mar 4, 2015

2015-03-04 02:13:51: afarr changed status from reopened to new

@totaam
Copy link
Collaborator Author

totaam commented Mar 4, 2015

2015-03-04 02:13:51: afarr changed owner from totaam to smo

@totaam
Copy link
Collaborator Author

totaam commented Mar 4, 2015

2015-03-04 02:13:51: afarr commented


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

Handing this off to you Smo.

@totaam
Copy link
Collaborator Author

totaam commented Mar 5, 2015

2015-03-05 17:21:23: smo commented


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.

@totaam
Copy link
Collaborator Author

totaam commented Mar 5, 2015

2015-03-05 23:24:51: smo changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Mar 5, 2015

2015-03-05 23:24:51: smo set resolution to fixed

@totaam
Copy link
Collaborator Author

totaam commented Mar 5, 2015

2015-03-05 23:24:51: smo commented


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

@totaam totaam closed this as completed Mar 5, 2015
@totaam
Copy link
Collaborator Author

totaam commented Jan 16, 2017

2017-01-16 11:19:26: antoine commented


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant