Optional QtGui dependency for KDBusAddons?

Alex Merry kde at randomguy3.me.uk
Tue Nov 12 23:42:36 UTC 2013


This is in relation to https://git.reviewboard.kde.org/r/113798/

Basically, KDBusService, which handles (among other things) unique
applications, needs to deal with startup notification.  It both needs to
get the existing startup notification info if it is a duplicate instance
that needs to pass it to the main app, and discharge the startup
notification in the main instance.

This all (currently) requires interacting with X11.  QtGui's XCB backend
ordinarily discharges startup notifications when the first window is
show, and it is possible to extract the startup notification id from it
if this has not happened yet.  Doing so requires linking against QtGui,
though.

Discharging it, on the other hand, would be a more manual affair.
KWindowSystem has KStartupInfo, but KDBusAddons definitely can't use that.

In addition, there is an idea in the longer term to move to using just
D-Bus for dealing with startup notifications, rather than X magic.

One option is to move KDBusService to a tier2+ framework.  However,
there isn't really a natural fit for it anywhere else, especially as
this stuff is all hidden from the user of the class.

The other option is to optionally link against QtGui and probably
against XCB as well, and do the magic internally.  When we reach the
point where all desktops are using a D-Bus version of startup
notifications, we can simply drop this hack.

The latter is my personal preference (and I don't see any real issue
with KDBusAddons optionally using something from Qt Essentials), but
what are other people's thoughts?

Alex


More information about the Kde-frameworks-devel mailing list