[effects] Support xcbConnectionChanged for support properties
ClosedPublic

Authored by graesslin on Sep 10 2017, 2:56 PM.

Details

Summary

Several effects announce a support property atom on the root window. This
change forwards the KWin::Application's signal that the xcbConnection
changed to the EffectsHandler so that the effects can respond to it.

All effects which announce a support property connect to this new signal
and re-announce the property. In case the xcb connection died (future
XWayland crashing case) it is set to XCB_ATOM_NONE by that. In case the
xcb connection got created (future delayed XWayland startup) the atom is
set to the proper value.

In addition all usages of the support properties are guarded, so that no
nonesense actions are performed if the support property is XCB_ATOM_NONE.

Test Plan

Only compile tested as we don't have XFree KWin yet

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin created this revision.Sep 10 2017, 2:56 PM
Restricted Application added a project: KWin. · View Herald TranscriptSep 10 2017, 2:56 PM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
davidedmundson requested changes to this revision.Sep 10 2017, 3:52 PM
davidedmundson added a subscriber: davidedmundson.
davidedmundson added inline comments.
effects/backgroundcontrast/contrast.cpp
63

we should only announce this
if ((shader && shader->isValid())

effects/blur/blur.cpp
78

same here.

This revision now requires changes to proceed.Sep 10 2017, 3:52 PM
graesslin updated this revision to Diff 19381.Sep 10 2017, 7:52 PM
graesslin edited edge metadata.

Addressed David's comments

Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptSep 10 2017, 7:52 PM
davidedmundson accepted this revision.Sep 10 2017, 7:59 PM
davidedmundson added inline comments.
effects/blur/blur.cpp
76

I was expecting you to do what you for the present windows effect with calling your local lambda announceSupportProperties.

IMHO it's neater than duplicating - but this is fine too.

This revision is now accepted and ready to land.Sep 10 2017, 7:59 PM
graesslin added inline comments.Sep 10 2017, 8:04 PM
effects/blur/blur.cpp
76

I didn't go for the lambda here as the if statement above does also the Wayland registering. So at least the if would have been needed to be duplicated anyway.

This revision was automatically updated to reflect the committed changes.