-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Unify WM_CLASS across backends #8394
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
Conversation
Currently Qt4 uses |
I had a short look at qt4 but didn't see the location where this is set. Can you give me a hint on the relevant source parts for the other backends? |
Well, I don't know either :-) |
I think I have found all relevant locations and updated the PR accordingly. |
Right now (with this PR) some backends use There's also the wxagg backend but a quick googling suggests it can't set WM_CLASS (not sure though). |
I tried, but I think not all GUI toolkits give access to control this completely. |
No worries. |
There is also the native osx backend, but unless you have a mac that one is hard to work on. |
Is there anything like |
Not sure. There is also the 'gtk' backend (which is different than the gtk3 backend). |
I have updated the commit to include the old and broken gtk backend. For wx I couldn't find any public API that allows setting the WM_CLASS. |
@languitar As far as I know the GTK(2) backend should be working and not broken, but quite difficult to install (that is the GTKAgg and GTKCairo variants, the GDK variant is deprecated and possibly broken) |
The backend that I touched ( |
👍 One last picking thing, we have settled on the convention of capitalizing Matplotlib in text, should we use that here too? I am leaning towards yes, but could be easily talked into either direction. |
Ok thats fine. There are actually 2 subclasses of that backend that are not deprecated. The GTK backend uses GDK to do the actual drawing (which is different from all other backends) but the GTKAgg and GTKCairo backends which uses Agg and Cairo and are subclassed of the GTK backend are not since they use more standard matplotlib renders |
wx probably doesn't expose such an API (http://wxpython-users.1045709.n5.nabble.com/Setting-WM-CLASS-td3270267.html). |
@tacaswell It should probably be |
Updated accordingly, at least for the backends where this is possible. |
@tacaswell this looks ready to go |
Qt uses the first argument of sys.argv to set the WM_CLASS attribute. So
far, a space character was used. Replace it with "matplotlib-qt5" to be
more recognizable. This enables interpretable rules for certain window
managers which use WM_CLASS.
This is related to #4746 and #6743.