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

Set GNOME single window property #3425

Merged

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Aug 1, 2021

Problem

In GNOME Shell currently, if you launch CKAN via the system menu, its icon has a "New Window" option:

image

Clicking it launches CKAN again, which invariably brings up the locked instance error:

image

It is a little embarrassing to have a highly visible option that doesn't work well by default.

Noticed while investigating #3423.

Cause

The "New Window" option is added by GNOME Shell automatically (if the .desktop file's Actions= list doesn't include new-window), and probably works fine for 90% of apps where running the Exec again successfully opens a new window that works properly.

Changes

Now our .desktop files set X-GNOME-SingleWindow=true to suppress the "New Window" option.

image

To find out this option existed, I had to read the GNOME source code:

I looked for a similar option for KDE or other desktops but could not find one, but I'm happy to add it here if it exists.

In addition, StartupNotify is removed because we do not "KNOW" that our application will send this message (because who knows what Mono's WinForms will do or not do in any situation):

  • https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys

    If true, it is KNOWN that the application will send a "remove" message when started with the DESKTOP_STARTUP_ID environment variable set. If false, it is KNOWN that the application does not work with startup notification at all (does not shown any window, breaks even when using StartupWMClass, etc.). If absent, a reasonable handling is up to implementations (assuming false, using StartupWMClass, etc.). (See the Startup Notification Protocol Specification for more details).

@HebaruSan HebaruSan added Enhancement GUI Issues affecting the interactive GUI Pull request Linux Issues specific for Linux Package: deb Issues affecting the Debian packaging ConsoleUI Issues affecting the interactive console UI Package: rpm Issues affecting RPM packaging labels Aug 1, 2021
Copy link
Member

@DasSkelett DasSkelett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, can't find anything for KDE either. And X-GNOME-SingleWindow=true or X-KDE-SingleWindow=truedon't have an effect.

Also not testing on Gnome, just gonna believe your screenshots there 😆

@HebaruSan HebaruSan merged commit a833159 into KSP-CKAN:master Aug 3, 2021
@HebaruSan HebaruSan deleted the fix/rm-new-window-desktop-action branch August 3, 2021 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ConsoleUI Issues affecting the interactive console UI Enhancement GUI Issues affecting the interactive GUI Linux Issues specific for Linux Package: deb Issues affecting the Debian packaging Package: rpm Issues affecting RPM packaging Pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants