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

add StartupWMClass to the desktop file #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alesya-h
Copy link

@alesya-h alesya-h commented Jan 28, 2021

This allows GNOME (and other desktops, as far as I understand) to match snapper launcher icon and snapper windows. Without this change when you click on the Snapper GUI icon in gnome dock it will start the app, but instead of displaying a dot next to the icon showing that the app is running, it will add a new icon without a picture, and that will have a dot. Also without this change when you click on the icon it would start a new instance instead of switching to the running one.

@osamuaoki
Copy link

Confirmation of bug:
Reported issue is true for the current Debian testing package. Modifying desktop file fixes issue.

@alesya-h
Copy link
Author

@ricardomv Could you please take a look and merge this?

@rickysarraf
Copy link

@alesguzik I tried your change but the 2nd instance problem still remain. I tried it on a KDE desktop.

@alesya-h
Copy link
Author

@rickysarraf does it assign the icon? If it does, then it means it works. On Gnome run-or-raise is a default behaviour, apps don't need to implement anything for it to work. I have just tested a few Qt-based apps and they explicitly implement the logic that if a second instance of the app is launched it will switch to it and terminate itself. Maybe KDE assumes that apps should run the second time by-default and smarter apps would handle switching, whereas apps that don't implement anything would just run twice. How do other GTK apps behave? You can try gedit, for example.

@andrewshadura
Copy link

andrewshadura commented Feb 26, 2021

The change make sense and looks good to me.
However, I’d reformat the commit message:

Add StartupWMClass to the desktop file

This is necessary so that GNOME and others window managers can associate the
application window with the launcher icon. Without StartupWMClass, GNOME dock
would display another icon for the application when it’s launched instead of
adding a dot to show the app is running to the already existing one.

@alesya-h
Copy link
Author

@andrewshadura fixed, thanks

This is necessary so that GNOME and others window managers can associate the
application window with the launcher icon. Without StartupWMClass, GNOME dock
would display another icon for the application when it’s launched instead of
adding a dot to show the app is running to the already existing one.
@rickysarraf
Copy link

@rickysarraf does it assign the icon? If it does, then it means it works. On Gnome run-or-raise is a default behaviour, apps don't need to implement anything for it to work. I have just tested a few Qt-based apps and they explicitly implement the logic that if a second instance of the app is launched it will switch to it and terminate itself. Maybe KDE assumes that apps should run the second time by-default and smarter apps would handle switching, whereas apps that don't implement anything would just run twice. How do other GTK apps behave? You can try gedit, for example.

Thanks for explaining. Given that, this may be an oddity in KDE then. I just tested the same use case, with a native KDE applicaiton, Konsole. And it does run a new instance when clicking the app icon, rather than switching to the current running instance. OTOH, a Qt based app like Clementine behaved just like you described.

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

Successfully merging this pull request may close these issues.

4 participants