Move SceneXRender into a plugin

Authored by graesslin on Aug 10 2017, 4:23 PM.


Group Reviewers
R108:054d9234112c: Move SceneXRender into a plugin

First step for loading the compositor Scenes through plugins. The general
idea is that we currently needlessly pull in all the Scenes although only
one will be used.

E.g. on X11 we pull in QPainter, although they are not compatible. On
Wayland we pull in XRender although they are not compatible.

Furthermore our current Scene creation strategy is not really fault
tolerant and can create situations where we don't get a compositor. E.g
on fbdev backend the default settings won't work as it does not support

Long term I want to tackle those conceptional problems together:
we try to load all plugins supported by the current platform till we have
a scene which works. Thus on Wayland we don't end up in a situation where
we don't have a working compositor because the configuration is bad.

To make this possible the switch statement in the Scene needs to go and
needs to be replaced by a for loop iterating over all the available
scenes on the platform. If we go there it makes sense to replace it
directly with a plugin based approach.

So this is a change which tackles the problem by first introducing the
plugin loading. The xrender based scene (as it's the most simple one)
is moved into a plugin. It is first tried to find a scene plugin and only
if there is none the existing code is used.

Test Plan

Tested all scenes

Diff Detail

R108 KWin
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
graesslin created this revision.Aug 10 2017, 4:23 PM
Restricted Application added a project: KWin. · View Herald TranscriptAug 10 2017, 4:23 PM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
broulik added inline comments.

Can we instead query QMetaEnum and store the enum's key name as a string?

graesslin added inline comments.Aug 11 2017, 6:06 PM

That one was new to me. I had a look today and tried to change it, but face several problems:

  • The enum is declared in a namespace
  • Q_NAMESPACE and Q_ENUM_NS are only available in 5.8
  • Ignoring that and just adding them results in linker error as the header where it's defined is header only

So overall I think the answer is: no we cannot.

graesslin updated this revision to Diff 18038.Aug 12 2017, 9:15 AM

Added new debug category to org_kde_kwin.categories

Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptAug 12 2017, 9:15 AM
This revision was automatically updated to reflect the committed changes.