Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 slimski (1.5.0-6.0antix8) unstable; urgency=medium
 .
   * added seatd as an alternative dependency to elogind and consolekit
Author: anticapitalista <antix@operamail.com>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2021-12-13

--- slimski-1.5.0.orig/app.cpp
+++ slimski-1.5.0/app.cpp
@@ -759,6 +759,9 @@ void App::Login() {    //  WAS   DoLogin
             } else {
                 system(sessStart.c_str());     //  e.g.    /usr/bin/sessreg -a -l $DISPLAY %username
             }
+            // Restart background to remove all text messages
+            string themedir =  "/usr/share/slimski/themes/" + themeName;
+            setBackground(themedir);
         } else {
             //    howdy bub      should we check blank, and fail, at an earlier codepoint?
             if (testing)
--- slimski-1.5.0.orig/cfg.cpp
+++ slimski-1.5.0/cfg.cpp
@@ -553,9 +553,25 @@ string Cfg::removeSpaces(string str) {
 }
 
 bool Cfg::isValidSesstype(string hoo) {                      //   v--- If no elements match, find() returns the last.
-    if ( std::find(sessiontypes.begin(), sessiontypes.end(), hoo) != sessiontypes.end() ) {
+    std::vector<string>::iterator it;
+    //~ std::string ssessiontype;
+
+    if (zeebug) {
+        cout << "Searching for " << hoo << " between list of sessiontypes" << endl;
+    }
+
+    it = std::find (sessiontypes.begin(), sessiontypes.end(), hoo);
+    if ( it != sessiontypes.end() ) {
+        //~ ssessiontype = sessiontypes.at(it);
+        if (zeebug) {
+            cout << "Result of search is: " << hoo << endl;
+        }
         return true;      //                                <--^   counterintuitive, eh
     } else {
+        //~ ssessiontype = "not-found";
+        if (zeebug) {
+            cout << "Result of search is: not-found" << endl;
+        }
         return false;    //   howdy bub   TEST    blank string yields false
     }
 }
--- slimski-1.5.0.orig/panel.cpp
+++ slimski-1.5.0/panel.cpp
@@ -928,8 +928,10 @@ bool Panel::IsCleanString(const string&
 ////if ( s.empty() )   return false;      //an empty string is unusable
     if ( s.empty() )   return false;    // necessary for validating string read from lastused file
 
-    for (const char c : s) {
-        if ( iscntrl(c) || isspace(c) )   return false;
+    if ( cfg->getOption("xsessionsdir") == "" ) {
+        for (const char c : s) {
+            if ( iscntrl(c) || isspace(c) )   return false;
+        }
     }
     return true;
 }
@@ -1048,7 +1050,8 @@ void Panel::showMuMsg(string& bess, int
 
 void Panel::readLastUsed(string lufile) {
     string aline;
-    bool needfallback = false;
+    bool needfallback;
+    needfallback = true;
     ifstream afile;
     afile.open(lufile);
     if (afile.is_open()) {     // howdy   if it exists...
@@ -1067,30 +1070,44 @@ void Panel::readLastUsed(string lufile)
                 //  so test for exact match against the names of currently-available sessiontype names.
                 if ( cfg->isValidSesstype(aline) ) {
                     sessiontype = aline; //   set prefilled sessiontype
+                    if (zeebug) {
+                        cout << "Session will use last used: " <<  sessiontype << endl;
+                    }
+                    needfallback = false;
                 } else {
                     if (zeebug) {
                         cout << "The lastused file declares an INVALID sessiontype." << endl;
                         cout << "Will fallback to default_sessiontype, if a valid default has been specified." << endl;
                     }
-                    needfallback = true;
                 }
-            } else
-                needfallback = true;
-        } else
-            needfallback = true;
-    } else {
-        if (zeebug)     cout << "Cannot read slimski.lastused file: " << lufile << endl;
-
-        needfallback = true;
+            } else if (zeebug)
+                cout << aline << " is not Clean" << endl;
+        } else if (zeebug)
+            cout << "Last session doesn't exist (empty)" << endl;
+    } else if (zeebug)
+        cout << "Cannot read slimski.lastused file: " << lufile << endl;
+
+    if (needfallback) {
+        if (cfg->isValidSesstype(cfg->getOption("default_sessiontype")) ) {
+            sessiontype = cfg->getOption("default_sessiontype");
+            if (zeebug) {
+                cout << "Fallback to default_sessiontype " << sessiontype << endl;
+            }
+        } else {
+            //  a further fallback, handled elsewhere, applies the first listed name specified  in "sessiontypes" line within slimski.conf
+            //   BUT whatif the default no longer has a  matching xsessiondir item ?
+            if (zeebug) {
+                cout << "Checking if xsessionsdir was set: " << cfg->getOption("xsessionsdir") << endl;
+            }
+            if ( cfg->getOption("xsessionsdir") != "" ) {
+                sessiontype = cfg->dacurrentSessiontype();
+                if (zeebug) {
+                    cout << "Fallback to first available session " << sessiontype << endl;
+                }
+            }
+        }
     }
-
-    if (needfallback  &&  cfg->isValidSesstype(cfg->getOption("default_sessiontype")) )
-    {
-        sessiontype = cfg->getOption("default_sessiontype");
-    } else {
-        //  a further fallback, handled elsewhere, applies the first listed name specified  in "sessiontypes" line within slimski.conf
-        //   BUT whatif the default no longer has a  matching xsessiondir item ?
-        if ( cfg->getOption("xsessionsdir") != "")
-            sessiontype = cfg->dacurrentSessiontype();
+    if (zeebug) {
+        cout << "Slimski has decided that the default session be: " <<  sessiontype << endl;
     }
 }
--- slimski-1.5.0.orig/slimski.conf
+++ slimski-1.5.0/slimski.conf
@@ -89,14 +89,15 @@ numlock_enabled             false
 ::: This enables you to accommodate conditional launch of commands in .xinitrc
 ::: (conditional, based on the passed-in themename and/or sessiontype strings)
 :::
-#atlogin_cmd      exec /usr/bin/bash -login /etc/X11/Xsession %sessiontype
+atlogin_cmd      exec /usr/bin/bash -login /etc/X11/Xsession "%sessiontype"
 :::::::::#           ^----- for Debian and derivatives (not for antiX)
 :::::::::#  v---OLD LOGIN COMMANDS (seen in prior antiX versions )::::::#
 #atlogin_cmd      exec /usr/bin/sh -login ~/.xinitrc %sessiontype
 #atlogin_cmd      exec dbus-launch /usr/bin/bash -login ~/.xinitrc %sessiontype >~/.xsession-errors 2>&1
 #atlogin_cmd      exec /usr/bin/bash -login ~/.xinitrc %sessiontype >~/.xsession-errors$DISPLAY 2>&1
 :::::::::::::::::::::::::::::::::::::::::::::::::::#
-atlogin_cmd   setsid /usr/local/bin/desktop-session %sessiontype
+#atlogin_cmd   setsid /usr/local/bin/desktop-session %sessiontype
+:::::::::#           ^----- for antiX Linux (with desktop-session manager)
 
 ::: Commands executed when starting and exiting a session.
 ::: They can be used for registering a X11 session with sessreg
--- slimski-1.5.0.orig/themes/default/en_AU
+++ slimski-1.5.0/themes/default/en_AU
@@ -1,10 +1 @@
-cust5_color                 #DD9CEF
-cust5_font                 Verdana:size=22
-cust5_msg                 cust5 _ msg        ☺
-cust5_x                 50
-cust5_y                 50
-
-bogus line to test whether "malformed" lines will be ignored
-
-
-roses_are_red           violets_are_tasty
+#Insert here the different wording the different messages
--- slimski-1.5.0.orig/themes/default/en_GB
+++ slimski-1.5.0/themes/default/en_GB
@@ -1,11 +1 @@
-cust1_color                 #9999EE
-cust1_font                 Verdana:size=24
-cust1_msg                 cust1 _ msg      en_GB
-cust1_x                 10%
-cust1_y                 10%
-
-cust2_color                 #8BEEFF
-cust2_font                 Verdana:size=20
-cust2_msg                 cust2 _ msg      content from  en_GB theme {-----
-cust2_x                 20%
-cust2_y                 20%
+#Insert here the different wording the different messages
--- slimski-1.5.0.orig/themes/default/en_NZ
+++ slimski-1.5.0/themes/default/en_NZ
@@ -1,10 +1 @@
-cust5_color                 #DD9CEF
-cust5_font                 Verdana:size=22
-cust5_msg                 cust5 _ msg        ☺
-cust5_x                 50
-cust5_y                 50
-
-bogus line to test whether "malformed" lines will be ignored
-
-
-roses_are_red           violets_are_tasty
+#Insert here the different wording the different messages
--- slimski-1.5.0.orig/themes/default/en_US
+++ slimski-1.5.0/themes/default/en_US
@@ -1,15 +1 @@
-cust2_color                 #99EE99
-cust2_font                 Verdana:size=20
-cust2_msg                 cust2 _ msg      content from   en_US localized theme
-cust2_x                 20%
-cust2_y                 20%
-
-cust5_color                 #DD9CEF
-cust5_font                 Verdana:size=22
-cust5_msg                 cust5 _ msg        ☺
-cust5_x                 50
-cust5_y                 50
-
-bogus line to demonstrate that  "malformed/unknown" lines will be ignored
-
- another bogus line  (lines containing any leading whitespace are also ignored)
+#Insert here the different wording the different messages
--- slimski-1.5.0.orig/themes/default/slimski.theme
+++ slimski-1.5.0/themes/default/slimski.theme
@@ -47,35 +47,37 @@ password_feedback_capslock_msg     Authe
 password_feedback_msg              Authentication failed
 
 
-cust1_color                 #9999EE
-cust1_font                 Verdana:size=24
-cust1_msg                 cust1 _ msg      ₭·₮·₯·₹
-cust1_x                 10%
-cust1_y                 10%
-
-cust2_color                 #99EE99
-cust2_font                 Verdana:size=20
-cust2_msg                 cust2 _ msg     content from default/slimski.theme (not localized variant)
-cust2_x                 20%
-cust2_y                 20%
-
-cust3_color                 #EE9999
-cust3_font                 Verdana:size=16
-cust3_msg                 cust3 _ msg      ¥·£·€·$·¢·₡·₢·₣·₤·₥·₦·₧·₨·₩·₪·₫·₭·₮·₯·₹
-cust3_x                 30%
-cust3_y                 30%
-
-cust4_color                 #8BEEFF
-cust4_font                 Verdana:size=14
-cust4_msg                 cust4 _ msg      ¥·£·€·$·¢·₡·₢·₣·₤·₥·₦·₧·₨·₩·₪·₫·₭·₮·₯·₹
-cust4_x                 40%
-cust4_y                 40%
-
-cust5_color                 #DD9CEF
-cust5_font                 Verdana:size=12
-cust5_msg                 cust5 _ msg      ¥·£·€·$·¢·₡·₢·₣·₤·₥·₦·₧·₨·₩·₪·₫·₭·₮·₯·₹
-cust5_x                 50%
-cust5_y                 50%
+# Custom messages. These below are to test different characters.
+# Preserved as example, but not used.
+#cust1_color                 #9999EE
+#cust1_font                 Verdana:size=24
+#cust1_msg                 cust1 _ msg      ₭·₮·₯·₹
+#cust1_x                 10%
+#cust1_y                 10%
+
+#cust2_color                 #99EE99
+#cust2_font                 Verdana:size=20
+#cust2_msg                 cust2 _ msg     content from default/slimski.theme (not localized variant)
+#cust2_x                 20%
+#cust2_y                 20%
+
+#cust3_color                 #EE9999
+#cust3_font                 Verdana:size=16
+#cust3_msg                 cust3 _ msg      ¥·£·€·$·¢·₡·₢·₣·₤·₥·₦·₧·₨·₩·₪·₫·₭·₮·₯·₹
+#cust3_x                 30%
+#cust3_y                 30%
+
+#cust4_color                 #8BEEFF
+#cust4_font                 Verdana:size=14
+#cust4_msg                 cust4 _ msg      ¥·£·€·$·¢·₡·₢·₣·₤·₥·₦·₧·₨·₩·₪·₫·₭·₮·₯·₹
+#cust4_x                 40%
+#cust4_y                 40%
+
+#cust5_color                 #DD9CEF
+#cust5_font                 Verdana:size=12
+#cust5_msg                 cust5 _ msg      ¥·£·€·$·¢·₡·₢·₣·₤·₥·₦·₧·₨·₩·₪·₫·₭·₮·₯·₹
+#cust5_x                 50%
+#cust5_y                 50%
 
 
 
