From ac6c53f3fa24444a902adaf7f904b320ef327ec5 Mon Sep 17 00:00:00 2001 From: Alexander Golubev Date: Sun, 24 Dec 2023 11:04:00 +0300 Subject: [PATCH] tderandr: fix saving screen reflaction The conditions for screen reflection when saved was always evaluated as false and generally were incorrect. The problem was previausly unnoticed. Signed-off-by: Alexander Golubev --- tderandr/randr.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tderandr/randr.cpp b/tderandr/randr.cpp index d00641154..6a3d0381e 100644 --- a/tderandr/randr.cpp +++ b/tderandr/randr.cpp @@ -656,7 +656,9 @@ KDE_EXPORT void RandRScreen::load(TDEConfig& config) if (proposeSize(sizeIndex(TQSize(config.readNumEntry("width", currentPixelWidth()), config.readNumEntry("height", currentPixelHeight()))))) proposeRefreshRate(refreshRateHzToIndex(proposedSize(), config.readNumEntry("refresh", currentRefreshRate()))); - proposeRotation(rotationDegreeToIndex(config.readNumEntry("rotation", 0)) + (config.readBoolEntry("reflectX") ? ReflectX : 0) + (config.readBoolEntry("reflectY") ? ReflectY : 0)); + proposeRotation(rotationDegreeToIndex(config.readNumEntry("rotation", 0)) + | (config.readBoolEntry("reflectX") ? ReflectX : 0) + | (config.readBoolEntry("reflectY") ? ReflectY : 0)); } KDE_EXPORT void RandRScreen::save(TDEConfig& config) const @@ -666,8 +668,8 @@ KDE_EXPORT void RandRScreen::save(TDEConfig& config) const config.writeEntry("height", currentPixelHeight()); config.writeEntry("refresh", refreshRateIndexToHz(currentSize(), currentRefreshRate())); config.writeEntry("rotation", rotationIndexToDegree(currentRotation())); - config.writeEntry("reflectX", (bool)(currentRotation() & ReflectMask) == ReflectX); - config.writeEntry("reflectY", (bool)(currentRotation() & ReflectMask) == ReflectY); + config.writeEntry("reflectX", (bool)(currentRotation() & ReflectX)); + config.writeEntry("reflectY", (bool)(currentRotation() & ReflectY)); } KDE_EXPORT RandRDisplay::RandRDisplay()