-
Notifications
You must be signed in to change notification settings - Fork 291
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
Fix unknown wmclass in linux (missing dock icon) #419
base: master
Are you sure you want to change the base?
Conversation
modules/pmg_qt/pymol_qt_gui.py
Outdated
@@ -1223,6 +1223,10 @@ def execapp(): | |||
window = PyMOLQtGUI() | |||
window.setWindowTitle("PyMOL") | |||
|
|||
# fix linux dash icon/missing wmclass | |||
QtCore.QCoreApplication.setApplicationName("PyMOL") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, the application name is already PyMOL
. Confirmed with:
assert app.applicationName() == "PyMOL"
modules/pmg_qt/pymol_qt_gui.py
Outdated
@@ -1223,6 +1223,10 @@ def execapp(): | |||
window = PyMOLQtGUI() | |||
window.setWindowTitle("PyMOL") | |||
|
|||
# fix linux dash icon/missing wmclass | |||
QtCore.QCoreApplication.setApplicationName("PyMOL") | |||
QtGui.QGuiApplication.setDesktopFileName("org.pymol.PyMOL") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use app
?
app.setDesktopFileName("org.pymol.PyMOL")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's been some time since I've read the docs on how to fix it, if I recall correctly it was because of transient pop ups without a parent.
modules/pmg_qt/pymol_qt_gui.py
Outdated
@@ -1223,6 +1223,10 @@ def execapp(): | |||
window = PyMOLQtGUI() | |||
window.setWindowTitle("PyMOL") | |||
|
|||
# fix linux dash icon/missing wmclass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seem to be a problem with KDE or IceWM on X11. So I suggest to be more specific that this is a fix for "Gnome Dash".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have access to a system with KDE/Wayland? It seems that this is Wayland specific actually, since you can specify wmclass for xorg in the .desktop file directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under KDE/Wayland:
- Without
setDesktopFileName()
: Generic icon in taskbar ❌ - With
app.setDesktopFileName("org.pymol.PyMOL")
and launching from aorg.pymol.PyMOL.desktop
file withIcon=application-x-clementine
: Taskbar showsapplication-x-clementine
icon ✔️ - With
app.setDesktopFileName("org.pymol.PyMOL")
and launching from a differently named.desktop
file (e.g.PyMOL.desktop
): Generic icon in taskbar ❌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do pop ups also have these icons? Or is it only the main window?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pop ups get the same icon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's great! I've updated the code to use app
directly, as well as the comment
Split from #400
On Linux, Pymol has a dash/dock gear icon and WMCLASS "python3", I've fixed this so now it exports the correct WMCLASS (which for gnome means that it is now able to find the correct icon).