-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
MNE-Python application icon broken in Ubuntu 24.04 #12899
Comments
@larsoner The installer creates https://github.com/conda-forge/mne-feedstock/tree/main/recipe/menu See the respective config file: I don't fully understand your issue report – are you saying you didn't end up with a |
No, there are several The issue is that on latest Ubuntu -- regardless of whether or not the installer is used -- when you open Python, init a Qt app, and show a window, you get the generic gear icon that shows up in the taskbar (first image pasted above). No runtime Qt calls could be used to set it. This is different from previous versions of Ubuntu, where our The workaround is to have a So the question is really how do should we suggest to people (in install docs) or add to our installer a custom |
... looking at https://conda.github.io/menuinst/reference/ I don't see an option for |
Okay, opened conda-forge/mne-feedstock#139, conda/menuinst#265, and #12900 |
Hello, just to clarify, no veto against this PR from my side! I only think that maybe we can come up with an additional / a better solution that requires less user interaction 👍 |
Hi @larsoner! I have the same problem with MNELAB, but adding the I've created
Do I have to do anything else? Or is it a problem that the "executable" is really running Python with a specific module (or |
You need to know the So if I then create: ~/.local/share/applications/matplotlib.desktop[Desktop Entry]
Type=Application
Version=1.5
Name=matplotlib
StartupWMClass=matplotlib
Icon=/home/larsoner/python/matplotlib/lib/matplotlib/mpl-data/images/matplotlib_large.png
SingleMainWindow=true
NoDisplay=true It updates to use the |
Thanks @larsoner, this works! However, the I assume in the case of MNE, the installer sets the class to |
It will. See #12900 (comment). The problem is that users who don't use the installer still need it |
Right, but users without the installer will not have the |
IIUC the wmclass is set at runtime by the mne qt browser package, not by the installer |
I don't think so. It has |
Correct that the installer does not set it. Whatever creates the Qt app (or whatever app shows up in the dock) at runtime sets it implicitly or explicitly. So if it's mne-python -- including In the example above, by contrast, doing So @cbrnr I think most likely whatever library (ipython?) is spinning up the app that shows up in the dock is implicitly or explicitly setting the wmclass to |
Yeah, this sounds really brittle. I wish there was a way to set this in the app. But I still don't understand how people who don't use the installer will benefit from the desktop icon. How can I start the Qt app by MNE-Python? What even is "MNE-Python" in this context? Sorry I keep asking questions, but maybe you can give me a simple reproducible way to open some MNE GUI app that has the |
For me This should also work in plain Python:
This should cause mne-qt-browser to be the first thing to spawn the Qt app, which should in turn set the wmclass to MNE-Python. |
For this part it's really this under the hood:
That would be the QApplication created by MNE-Python (the |
No, it's |
Weird, didn't know what the difference would be! But at least now you know how to change the icon if you want to. |
Well, that's kind of my point: if I change it, then all Python GUI apps have that same icon! |
... I think due to the use of Gnome3 newer Ubuntu seems to by default now require a
.desktop
file to use something other than this in the dock:I tried a bunch of Qt stuff and none of it worked. At some point I stumbled upon a post that mentioned
.desktop
withStartupWMClass
could fix it and indeed this seems to work:~/.local/share/applications/mne-python.desktop
@hoechenberger our installers currently add files like
mne-python-180_prompt-mne.desktop
but I'm not sure if it's possible to have them create a separate linux-only file, do you?Either way, we could consider adding a note about this to our install docs somewhere as well.
The text was updated successfully, but these errors were encountered: