Skip to content

libdpms: Delay supportedChanged signal until after the constructor

Jakob Petsovits requested to merge work/cherry-pick-c37450e1 into Plasma/6.0

BUG: 338796

KScreen::Dpms was giving promises that it couldn't keep, i.e. blocking in isSupported() until initialization is done. Implementing this safely as specified would involve multithreading or manual event loop processing, both of which seem overkill here.

Given the lack of blocking in isSupported(), an owner of the Dpms object could only connect to supportedChanged(). However, this was emitted during the constructor, which makes connections pointless for someone who can only connect after creating the object.

To make any of this work, queue the majority of initialization work until after the constructor is called, for both X11 and Wayland.

(cherry picked from commit c37450e1)

Merge request reports