user2285319
user2285319

Reputation: 31

How to respond to desktop startup notification with Qt

I have a Qt application, running under Xfce and other Linux desktops, which works well, except that the circulating "startup notification" icon is not dismissed when the app starts up, so that it persists for some time after the app main window is showing and complete.

I would assume that either the QApplication would by default dismiss the notification when the main window event loop starts, or I would call some method to do so. I can't find anything relevant in the Qt API documentation, or with google searches on Qt startup notification.

How can one dismiss the startup notification, in a Qt application.

Upvotes: 3

Views: 709

Answers (2)

sercxjo
sercxjo

Reputation: 358

The startup notification is sent automatically inside Qt when the first window is first shown (see src/plugins/platforms/xcb/qxcbscreen.cpp), but obviously, due to a bug, it does not work if there are quotes or the escape character (\) in the .desktop file in the path to the program.

In addition, if Terminal=true is presented, the environment variable DESKTOP_STARTUP_ID is deleted by xterm and does not reach your application, so it is better not to enable both Terminal and StartupNotify flags at the same time.

Was tested on MATE.

Upvotes: 0

Tsu Jan
Tsu Jan

Reputation: 19

Doesn't adding of

StartupNotify=false

to the .desktop file of your app solve the problem?.In KDE,

X-KDE-StartupNotify=false

works; perhaps XFCE has a similar variable.

Upvotes: 1

Related Questions