snapper-gui icon indicating copy to clipboard operation
snapper-gui copied to clipboard

add StartupWMClass to the desktop file

Open alesya-h opened this issue 3 years ago • 7 comments

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.

alesya-h avatar Jan 28 '21 00:01 alesya-h

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

osamuaoki avatar Feb 25 '21 03:02 osamuaoki

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

alesya-h avatar Feb 26 '21 03:02 alesya-h

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

rickysarraf avatar Feb 26 '21 07:02 rickysarraf

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

alesya-h avatar Feb 26 '21 11:02 alesya-h

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.

andrewshadura avatar Feb 26 '21 11:02 andrewshadura

@andrewshadura fixed, thanks

alesya-h avatar Feb 26 '21 12:02 alesya-h

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

rickysarraf avatar Feb 26 '21 16:02 rickysarraf