Git master everything, Qt 6.7.1, Kernel 6.8.9. When I open the KCM for the first time after a reboot, the auto-rotate controls are all missing. When I flip my laptop's screen around to enter tablet mode, the controls appear. This is governed by the following visibility condition in https://invent.kde.org/plasma/kscreen/-/blob/master/kcm/ui/Orientation.qml?ref_type=heads#L23: visible: kcm.autoRotationSupported && kcm.orientationSensorAvailable I did a bit of testing, and what happens is that the value of kcm.orientationSensorAvailable doesn't become true until I flip around my laptop's lid to enter Tablet Mode. Maybe entering tablet mode for the first time initializes the orientation sensor or something?
Can reproduce. No wonder I don't see the option.
what I'm seeing in busctl on the first run is that we `Get` the `AccelerometerOrientation` property. that returns `undefined`. after it returns, the service issues a `PropertiesChanged` on that property with `normal` (we probably fail to act on that correctly). on subsequent runs the property is already in the service-side cache and the `Get` returns `normal` instead of `undefined` i.e. the reason it works on subsequent runs is because the service already has the property cached and returns its value immediately instead of via a changed signal
Created attachment 171126 [details] Blind patch Attached a blind patch, as I dont have the hardware to test this.
(In reply to David Redondo from comment #3) > Created attachment 171126 [details] > Blind patch > > Attached a blind patch, as I dont have the hardware to test this. Can you do a MR? I can test it
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kscreen/-/merge_requests/320
Git commit 7723a604662c83f10e3db90c4130b2fd3b461c82 by Marco Martin. Committed on 05/08/2024 at 14:48. Pushed by mart into branch 'master'. Emit OrientationSensor::availableChanged() when needed when we get the signal from QtSensors that the rotation sensor became available, forward the signal so that the QML part can show the autorotation checkbox M +1 -0 common/orientation_sensor.cpp https://invent.kde.org/plasma/kscreen/-/commit/7723a604662c83f10e3db90c4130b2fd3b461c82
Git commit 779c1f56d363f5f8afe7d71def5cd2d5699f8347 by Marco Martin. Committed on 05/08/2024 at 14:49. Pushed by mart into branch 'Plasma/6.1'. Emit OrientationSensor::availableChanged() when needed when we get the signal from QtSensors that the rotation sensor became available, forward the signal so that the QML part can show the autorotation checkbox (cherry picked from commit 7723a604662c83f10e3db90c4130b2fd3b461c82) bddbbfc6 Emit availableChanged() when needed Co-authored-by: Marco Martin <notmart@gmail.com> M +1 -0 common/orientation_sensor.cpp https://invent.kde.org/plasma/kscreen/-/commit/779c1f56d363f5f8afe7d71def5cd2d5699f8347