kdeinit vs. link order

David Faure faure at kde.org
Tue Jul 9 09:51:16 BST 2013


Le lundi 8 juillet 2013 11:47:03 Thomas Lübking a écrit :
> Escalating to the High Council.

:-)

> KWin needs[1] to set some environment variables before libGL is
> instantiated. 

Instantiated = loaded as a directly-linked shared library?

Or is it dlopened? (then a Q_CONSTRUCTOR_FUNCTION would probably be enough)

> This used to be done by an extra shared object at the end of
> the link order.

Interesting hack, never heard of that before.

> While i'm not sure whether the current process in CMakeLists is actually
> correct, not even LD_PRELOADing the lib works - the setenv calls have no
> effect, while setting the environment in the shell clearly works.
> > A gut feeling and brief google consultation make me "blame" the fact that
> > kwin is "now" a kdeinit executable (for a while...)

I don't see the relation. I mean, OK kdeinit4 changes things when starting an 
app from the GUI, but certainly not when starting an app from a terminal.

If you set LD_PRELOAD and then type kwin in a terminal, it still doesn't work?
Then the problem is elsewhere.

> So the question is:
> -------------------
> Is there any (preferred) way to either make kdeinit instatiate the special
> shared object before libGL or eventually just calling setenv directly
> before doing so?

Let's first establish kdeinit as guilty for sure before we go further into 
that direction (short answer, nothing exists, we'd have to add code).

> Or would the only solution be to actually set the environment from a shell,
> ie. have a kwin binary or even shell script that sets the environment and
> then spawns a kwin.bin subprocess?

kwin is typically started from startkde anyway, why not setenv there?
Because other processes than kwin shouldn't get this env var?
Then the alternative is to add that to ksmserver, it's the one that starts 
kwin actually (startkde -> ksmserver -> kwin, where "->" means "starts (via 
kdeinit)")

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





More information about the kde-core-devel mailing list