summaryrefslogtreecommitdiffstats
path: root/twin/useractions.cpp
diff options
context:
space:
mode:
authorAlexander Golubev <fatzer2@gmail.com>2026-01-08 16:33:18 +0300
committerFat-Zer <fatzer2@gmail.com>2026-02-13 19:41:02 +0000
commit04b43be9b261f36edc4b0300a9784ec5dcbe1c52 (patch)
tree967aafbc0ce7c706cafe3dbb0f804a2cf0bb8544 /twin/useractions.cpp
parent97e3bd0ca6cdc58c1915038eaf28822a60d0206e (diff)
downloadtdebase-04b43be9b261f36edc4b0300a9784ec5dcbe1c52.tar.gz
tdebase-04b43be9b261f36edc4b0300a9784ec5dcbe1c52.zip
twin: better rules when to set custom_opacity flag
This patch implements next peaces of logic: - If opacity is not completely opaque by default, changing it to opaque won't result it resetting the flag anymore. - Also in such a case the X11 property will be set for completely opaque windows as well. That way we can restore it in case of WM restart. - On WM initialization we check if the X11 opacity property has value we would expectto be left behind by previous WM instance and if it does we won't set the custom_opacity flag. Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
Diffstat (limited to 'twin/useractions.cpp')
-rw-r--r--twin/useractions.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/twin/useractions.cpp b/twin/useractions.cpp
index c573e8214..8051c9574 100644
--- a/twin/useractions.cpp
+++ b/twin/useractions.cpp
@@ -652,21 +652,22 @@ bool Client::performMouseCommand( Options::MouseCommand command, TQPoint globalP
{
if (opacity_ < Opacity::Opaque - Opacity::MouseStep)
{
- setOpacity(true, opacity_ + Opacity::MouseStep);
custom_opacity = true;
+ setOpacity(true, opacity_ + Opacity::MouseStep);
}
else
{
- setOpacity(false, Opacity::Opaque);
- custom_opacity = false;
+ if (defaultOpacity() == Opacity::Opaque)
+ custom_opacity = false;
+ setOpacity(true, Opacity::Opaque);
}
}
break;
case Options::MouseOpacityLess:
if (opacity_ > 0)
{
- setOpacity(true, (opacity_ > Opacity::MouseStep) ? opacity_ - Opacity::MouseStep : Opacity::Transparent);
custom_opacity = true;
+ setOpacity(true, (opacity_ > Opacity::MouseStep) ? opacity_ - Opacity::MouseStep : Opacity::Transparent);
}
break;
case Options::MouseNothing: