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

Fix unknown wmclass in linux (missing dock icon) #419

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions modules/pmg_qt/pymol_qt_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1223,6 +1223,10 @@ def execapp():
window = PyMOLQtGUI()
window.setWindowTitle("PyMOL")

# fix linux dash icon/missing wmclass
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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 a org.pymol.PyMOL.desktop file with Icon=application-x-clementine: Taskbar shows application-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 ❌

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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

QtCore.QCoreApplication.setApplicationName("PyMOL")
Copy link
Contributor

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"

QtGui.QGuiApplication.setDesktopFileName("org.pymol.PyMOL")
Copy link
Contributor

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

Copy link
Contributor Author

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.


@commandoverloaddecorator
def viewport(w=-1, h=-1, _self=None):
window.viewportsignal.emit(int(w), int(h))
Expand Down