From da7db78bfe13860fe8d63654ed4c3427f14f373c Mon Sep 17 00:00:00 2001
From: Alexander Golubev <fatzer2@gmail.com>
Date: Thu, 8 Jan 2026 01:06:13 +0300
Subject: twin: set opacity to be fully opaque by default

Also set window's opacity after it's getting managed by twin.

This resolves issue with windows that don't require input get
transparent after move/resize.

Bug: https://mirror.git.trinitydesktop.org/gitea/TDE/tdebase/issues/698
Closes: https://mirror.git.trinitydesktop.org/gitea/TDE/tdebase/issues/699
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
---
 twin/client.cpp    | 2 +-
 twin/client.h      | 6 ++++++
 twin/workspace.cpp | 4 ++++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/twin/client.cpp b/twin/client.cpp
index 0f1e7d053..7ed1f28fa 100644
--- a/twin/client.cpp
+++ b/twin/client.cpp
@@ -120,7 +120,7 @@ Client::Client( Workspace *ws )
         border_right( 0 ),
         border_top( 0 ),
         border_bottom( 0 ),
-        opacity_( 0 ),
+        opacity_( Opacity::Opaque ),
         demandAttentionKNotifyTimer( NULL ),
         activeMaximizing(false),
         activeTiled(false)
diff --git a/twin/client.h b/twin/client.h
index 178c718c4..8417da653 100644
--- a/twin/client.h
+++ b/twin/client.h
@@ -321,6 +321,12 @@ class Client : public TQObject, public KDecorationDefines
         void cancelAutoRaise();
         void destroyClient();
         void checkActiveModal();
+
+    // some helpful constants for setOpacity() and related functions
+        struct Opacity { enum : uint {
+            Opaque      = 0xFFFFFFFF  //< Fully opaque window
+        }; };
+
         void setOpacity(bool translucent, uint opacity = 0);
         void setShadowSize(uint shadowSize);
         void updateOpacity();
diff --git a/twin/workspace.cpp b/twin/workspace.cpp
index 89bd84993..f2f234b54 100644
--- a/twin/workspace.cpp
+++ b/twin/workspace.cpp
@@ -605,6 +605,10 @@ void Workspace::addClient( Client* c, allowed_t )
             c->setOpacity(options->translucentDocks, options->dockOpacity);
             }
         }
+    else
+        {
+        c->updateOpacity();
+        }
 
     if (c->isMenu() || c->isTopMenu())
         {
-- 
cgit v1.2.3

