X11 usage in kdeinit/kinit.cpp

David Faure faure at kde.org
Sat Feb 15 19:49:39 UTC 2014


On Thursday 13 February 2014 09:29:40 Martin Gräßlin wrote:
> Hi,
> 
> on my quest to ensure that we can run all applications with -platform
> wayland if compiled with X11 support I stumbled over
> kinit/kdeinit/kinit.cpp which gets compiled into the kdeinit5 binary. To
> quote the code:
> 
> // Can't use QGuiApplication::platformName() here, there is no app instance
> 
> And that's kind of a global problem in that file. So I don't see how we can
> make a version for wayland without compiling it twice. Will we still need
> kdeinit5 in the future or is that something which could be killed if we
> improve the startup process (thus ignore the problem)?

Whether the speed improvement is still worth it for starting apps is still 
unknown, someone should profile it properly.
However it's needed for sure for kioslaves, so that they can be started and 
passed between processes.

> A similar problem is present in wrapper.cpp which gets linked into the
> binaries:
> * kwrapper5
> * kshell5
> * kdeinit5_shutdown
> * kdeinit5_wrapper
> 
> wrapper.cpp assumes there is a DISPLAY env variable and even if not it's set
> to ":0".

Can't we detect that we're not on X11 simply from the fact that DISPLAY is not 
set?

The current code is wrong on mac and windows too (but without a workspace, the 
functionality of passing slaves between apps is less used so I guess they just 
skip using kdeinit right now).

In kdeinit.cpp it seems it's mostly for startup notification (x11 only),
and some old multihead display code that screams "remove me".

In the other files, it's about the name of the socket to talk to kdeinit. If 
e.g. wayland has no such thing as a display (i.e. the possibility to run 
multiple sessions on the same machine), then this can just be skipped.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list