From 4531d0929bd9714b6fe6c78a88d7d74d19b7fbbb Mon Sep 17 00:00:00 2001
From: Daniel Würl <trinity@dwrl.de>
Date: Sat, 29 Mar 2025 12:50:01 +0100
Subject: Fixed regression on loading of certain border parts.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Daniel Würl <trinity@dwrl.de>
---
 client/deKoratorclient.cpp | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/client/deKoratorclient.cpp b/client/deKoratorclient.cpp
index 0e9c694..80d379d 100644
--- a/client/deKoratorclient.cpp
+++ b/client/deKoratorclient.cpp
@@ -594,17 +594,30 @@ bool DeKoratorFactory::readConfig()
 // Load border pixmaps and try to also get pixmaps for inactive state.
 bool DeKoratorFactory::loadBorderPixmap(decoType borderPart, const TQString& newName, const TQString& oldName) {
     TQString decoPixDir = DeKoratorFactory::framesPath_;
-    
-    bool imgLoaded = DECOARR[ borderPart ][ orig ] ->load( decoPixDir + "/" + newName + "Bg.png" );
+    TQString preferredName;
+    TQString fallbackName;
+
+    // Solve collision on parts 'bottomLeftFrame' and 'bottomRightFrame' between new and old image names.
+    if ( borderPart == bottomLeftFrame || borderPart == bottomRightFrame ) {
+        preferredName = oldName;
+        fallbackName = newName;
+    }
+    else
+    {
+        preferredName = newName;
+        fallbackName = oldName;
+    }
+
+    bool imgLoaded = DECOARR[ borderPart ][ orig ] ->load( decoPixDir + "/" + preferredName + "Bg.png" );
     if ( imgLoaded ) {
-        if ( !DECOARR[ borderPart ][ inActOrig ]->load( decoPixDir + "/" + newName + "InactiveBg.png" ) )
-            DECOARR[ borderPart ][ inActOrig ] ->load( decoPixDir + "/" + newName + "Bg.png" );
+        if ( !DECOARR[ borderPart ][ inActOrig ]->load( decoPixDir + "/" + preferredName + "InactiveBg.png" ) )
+            DECOARR[ borderPart ][ inActOrig ] ->load( decoPixDir + "/" + preferredName + "Bg.png" );
     }
     else
     {
-        imgLoaded = DECOARR[ borderPart ][ orig ] ->load( decoPixDir + "/" + oldName + "Bg.png" );
-        if ( !DECOARR[ borderPart ][ inActOrig ]->load( decoPixDir + "/" + oldName + "InactiveBg.png" ) )
-            DECOARR[ borderPart ][ inActOrig ] ->load( decoPixDir + "/" + oldName + "Bg.png" );
+        imgLoaded = DECOARR[ borderPart ][ orig ] ->load( decoPixDir + "/" + fallbackName + "Bg.png" );
+        if ( !DECOARR[ borderPart ][ inActOrig ]->load( decoPixDir + "/" + fallbackName + "InactiveBg.png" ) )
+            DECOARR[ borderPart ][ inActOrig ] ->load( decoPixDir + "/" + fallbackName + "Bg.png" );
     }
     if ( imgLoaded )
         return true;
-- 
cgit v1.2.3

