Support StartupNotify #1113

Open
opened 2026-02-21 15:29:18 -05:00 by deekerman · 7 comments
Owner

Originally created by @sledgehammer999 on GitHub (Jan 26, 2014).

As far as I can tell qt doesn't handle Freedesktop's startup notifications specification. That means that we have to handle it ourselves. Luckily there is a reference implementation available and it is used by gtk by default. So that means that every distro should package it already.
eg debian: http://packages.debian.org/sid/libstartup-notification0-dev

I didn't check the license. I think it is BSD so we are ok with it.

(anyone wanting to implement this, go ahead)

Originally created by @sledgehammer999 on GitHub (Jan 26, 2014). As far as I can tell qt doesn't handle [Freedesktop's startup notifications specification](http://www.freedesktop.org/wiki/Specifications/startup-notification-spec/). That means that we have to handle it ourselves. Luckily there is a [reference implementation](http://www.freedesktop.org/wiki/Software/startup-notification/) available and it is used by gtk by default. So that means that every distro should package it already. eg debian: http://packages.debian.org/sid/libstartup-notification0-dev I didn't check the license. I think it is BSD so we are ok with it. (anyone wanting to implement this, go ahead)
Author
Owner

@sledgehammer999 commented on GitHub (Jan 26, 2014):

On better inspection the COPYING file indicates that the lib is LGPL 2, so we're good to go.

@sledgehammer999 commented on GitHub (Jan 26, 2014): On better inspection the COPYING file indicates that the lib is LGPL 2, so we're good to go.
Author
Owner

@pmzqla commented on GitHub (Mar 6, 2015):

I think Qt5.4 solves this problem.

@pmzqla commented on GitHub (Mar 6, 2015): I think Qt5.4 solves this problem.
Author
Owner

@sledgehammer999 commented on GitHub (Mar 9, 2015):

Any links to docs? Or are you just observing the "busy notification" during startup?

@sledgehammer999 commented on GitHub (Mar 9, 2015): Any links to docs? Or are you just observing the "busy notification" during startup?
Author
Owner

@pmzqla commented on GitHub (Mar 9, 2015):

http://doc-snapshot.qt-project.org/qt5-5.4/qx11info.html#nextStartupId

If I start qBt with

DESKTOP_STARTUP_ID="qBittorrent" qbittorrent

QX11Info::nextStartupId() returns "qBittorrent" and as soon as the main window appears, it returns an empty string.

EDIT:
I will maybe see what happens with Gnome when I have time and see if the application hangs on start with StartupNotify=true. (this was the problem, right?)

@pmzqla commented on GitHub (Mar 9, 2015): http://doc-snapshot.qt-project.org/qt5-5.4/qx11info.html#nextStartupId If I start qBt with ``` DESKTOP_STARTUP_ID="qBittorrent" qbittorrent ``` `QX11Info::nextStartupId()` returns "qBittorrent" and as soon as the main window appears, it returns an empty string. EDIT: I will maybe see what happens with Gnome when I have time and see if the application hangs on start with `StartupNotify=true`. (this was the problem, right?)
Author
Owner

@sledgehammer999 commented on GitHub (Mar 9, 2015):

As far as I remember yes, that was the problem.
Also we have corner case here: What happens if our instance doesn't display a window and just exits after passing info to the already running instance? Back in the day when I programmed with Gtkmm, it had a function that allowed the program to explicitly tell the windowing(?) system "I started ok, I've done my job". To my knowledge such a function isn't available in qt4. (I haven't searched qt5 yet).

@sledgehammer999 commented on GitHub (Mar 9, 2015): As far as I remember yes, that was the problem. Also we have corner case here: What happens if our instance doesn't display a window and just exits after passing info to the already running instance? Back in the day when I programmed with Gtkmm, it had a function that allowed the program to explicitly tell the windowing(?) system "I started ok, I've done my job". To my knowledge such a function isn't available in qt4. (I haven't searched qt5 yet).
Author
Owner

@pmzqla commented on GitHub (Mar 9, 2015):

I will maybe see what happens with Gnome when I have time and see if the application hangs on start with StartupNotify=true. (this was the problem, right?)

Gnome no longer hangs, no matter what's the value of StartupNotify (probably it was a bug that got fixed), however, with Qt5.4 the mouse stops spinning as soon as the main window appears, while with Qt4.8 it keeps spinning. I guess this confirms that 5.4 brought the support to startup notifications.

To my knowledge such a function isn't available in qt4. (I haven't searched qt5 yet).

I honestly don't know. I might look into this.

@pmzqla commented on GitHub (Mar 9, 2015): > I will maybe see what happens with Gnome when I have time and see if the application hangs on start with StartupNotify=true. (this was the problem, right?) Gnome no longer hangs, no matter what's the value of StartupNotify (probably it was a bug that got fixed), however, with Qt5.4 the mouse stops spinning as soon as the main window appears, while with Qt4.8 it keeps spinning. I guess this confirms that 5.4 brought the support to startup notifications. > To my knowledge such a function isn't available in qt4. (I haven't searched qt5 yet). I honestly don't know. I might look into this.
Author
Owner

@xavier2k6 commented on GitHub (May 23, 2025):

ANNOUNCEMENT!

For anybody coming across this "Feature Request" & would like/love to see a potential implementation in the future!
Here are some options available to you:

  1. Please select/click the 👍 &/orreactions in the original/opening post of this ticket.

  2. Please feel free (If you have the "skillset") to create a "Pull Request" implementing what's being requested in this ticket.
    (new/existing contributors/developers are always welcome)


DO:

  • Provide constructive feedback.
  • Display how other projects implemented same/similar etc.

DO NOT:

  • Add a "Bump", "me too", "2nd/3rd" etc. or "criticizing" comment(s).
    (These will be disregarded/hidden as "spam/abuse/off-topic" etc. as they don't provide anything constructive.)
@xavier2k6 commented on GitHub (May 23, 2025): ## ANNOUNCEMENT! For anybody coming across this **_"Feature Request"_** & would like/love to see a potential implementation in the future! **Here are some options available to you:** 1. Please select/click the 👍 **&/or** ❤ `reactions` in the original/opening post of this ticket. 2. Please feel free _(If you have the "skillset")_ to create a **_"Pull Request"_** implementing what's being requested in this ticket. **_(new/existing contributors/developers are always welcome)_** ____ **DO:** * Provide constructive feedback. * Display how other projects implemented same/similar etc. **DO NOT:** * Add a "Bump", "me too", "2nd/3rd" etc. or "criticizing" comment(s). **(These will be disregarded/hidden as "spam/abuse/off-topic" etc. as they don't provide anything constructive.)**
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#1113
No description provided.