From 26dca54bde85d9bff5e84934769460cf65bc583b Mon Sep 17 00:00:00 2001
From: Slávek Banko <slavek.banko@axis.cz>
Date: Mon, 24 Nov 2025 01:53:38 +0100
Subject: FreeBSD tdebase: Backport d2b2363d93: twin: fix tiling of maximized
 windows. This resolves issue #675
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
---
 freebsd/core/tdebase/Makefile                      |  2 +-
 ...atch-bp000-fix-tiling-of-maximized-windows.diff | 28 ++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 freebsd/core/tdebase/files/patch-bp000-fix-tiling-of-maximized-windows.diff

diff --git a/freebsd/core/tdebase/Makefile b/freebsd/core/tdebase/Makefile
index c6af1da3f..57e06087c 100644
--- a/freebsd/core/tdebase/Makefile
+++ b/freebsd/core/tdebase/Makefile
@@ -11,7 +11,7 @@ PORTNAME=		tdebase-trinity
 COMMENT=		Trinity Base Programs
 TDE_PREVERSION=		
 MASTER_SITE_SUBDIR=	t/${PORTNAME}
-PORTREVISION=		0
+PORTREVISION=		1
 CATEGORIES=		x11
 DIST_SUBDIR=		TDE/core
 
diff --git a/freebsd/core/tdebase/files/patch-bp000-fix-tiling-of-maximized-windows.diff b/freebsd/core/tdebase/files/patch-bp000-fix-tiling-of-maximized-windows.diff
new file mode 100644
index 000000000..a4fe63d49
--- /dev/null
+++ b/freebsd/core/tdebase/files/patch-bp000-fix-tiling-of-maximized-windows.diff
@@ -0,0 +1,28 @@
+commit 23b75093d5599baeb816bbf0163ade78d2201818
+Author: Michele Calgaro <michele.calgaro@yahoo.it>
+Date:   Sat Nov 22 20:39:15 2025 +0900
+
+    twin: fix tiling of maximized windows. This resolves issue #675
+    
+    Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
+    (cherry picked from commit d2b2363d9345e74035e0585344d7150c4a62ef1c)
+
+diff --git a/twin/geometry.cpp b/twin/geometry.cpp
+index 88d0ba8cd..bdef2356c 100644
+--- a/twin/geometry.cpp
++++ b/twin/geometry.cpp
+@@ -1915,12 +1915,12 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust )
+     TQRect clientArea = workspace()->clientArea( MaximizeArea, this );
+ 
+     // save sizes for restoring, if maximalizing
+-    if( !activeTiled && !adjust && !( y() == clientArea.top() && height() == clientArea.height()))
++    if( !adjust && !( y() == clientArea.top() && height() == clientArea.height()))
+         {
+         geom_restore.setTop( y());
+         geom_restore.setHeight( height());
+         }
+-    if( !activeTiled && !adjust && !( x() == clientArea.left() && width() == clientArea.width()))
++    if( !adjust && !( x() == clientArea.left() && width() == clientArea.width()))
+         {
+         geom_restore.setLeft( x());
+         geom_restore.setWidth( width());
-- 
cgit v1.2.3

