:: [devuan-dev] bug#761: marked as don…
Inizio della pagina
Delete this message
Reply to this message
Autore: Devuan bug Tracking System
Data:  
To: dak
Oggetto: [devuan-dev] bug#761: marked as done (slim: label position in slimlock vs. slim (fix included))
Your message dated Fri, 11 Aug 2023 03:33:32 +0000
with message-id <1691724812.944211.631.nullmailer@???>
and subject line #761: fixed in src:slim version 1.4.0-0devuan3
has caused the Devuan bug report #761,
regarding slim: label position in slimlock vs. slim (fix included)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@???
immediately.)


--
761: https://bugs.devuan.org/cgi/bugreport.cgi?bug=761
Devuan Bug Tracking System
Contact owner@??? with problems
package: slim
version: 1.4.0-0devuan2

slimlock shows two text-labels (welcome_ and password_). Placement is
relative background, but should be relativepanel-image, like slim.
This is invisible when using a current Devuan theme(s): The panel-image
is placed at 0,0, which equalises the origins in slim and slimlock.
Fix: small patch included, mostly comments in the source as patch-notes.
Maintainers may use it as they see fit.
Patch file:
"slim__slimlock_label_positions__welcome_and_password__bugfix.patch"

System: daedalus
Kernel: 6.3.6-1-liquorix-amd64
((chimaera's 1.3.6: Patch applies with comments rejected. Seems to work
for welcome_ and username_ (not hidden), but not for password_)).


Part II:
Dear maintainer,
beside the bug fix, there is a small piece of code to handle in-line
comments in config files, which is attached too.

Proposed feature: Handle in-line comments in config files (slim.theme).
Reason: Before realising the error, I used in-line comments during
theme'ing.
Patch file: "slim__in-line_comments_in_config_files__addon.patch"
This may or may not be considered useful.


Both are tested, but I'm not really a software developer.
Feel free to contact me for any issues.

Thanks for devuan, slim and all the effort!
Regards,
Thomas
diff -ru -x build slim-1.4.0/panel.cpp slim-1.4.1/panel.cpp
--- slim-1.4.0/panel.cpp    2023-01-22 10:51:28.000000000 +0100
+++ slim-1.4.1/panel.cpp    2023-06-08 19:43:11.624315311 +0200
@@ -181,6 +181,10 @@
         // Thus we apply a hack to offset the input positions. It's a shame
         // we don't do the job properly, as this hack isn't applied to any
         // of the static text
+        /* 2023-06-08: Applied as suggested, in function 'ShowText()' to the
+         * concerning label's positions 'welcome_x,y' and 'password_x,y'.
+         * 'username_x,y' would apply, but is not shown in slimlock.
+         * Details: see blow (grep the date) */
         input_name_x += X;
         input_name_y += Y;
         input_pass_x += X;
@@ -757,6 +761,37 @@


     /// @bug this draw context is assumed relative to the panel but in lock
     ///         mode it's actually relative to the background
+    /* 2023-06-08: 
+     * Fix: Sync remaining label positions in 'slimlock' with 'slim'. 
+     *   In case of slimlock 'if (mode == Mode_Lock)', a coordinate-offset
+     *   is applied to 'welcome_x,y' and 'password_x,y'.
+     * How: The offsets (X, Y) form function 'Panel()' are used here equally.
+     *
+     * *** The following notes can be found (+/-) on slims web-site too
+     * ***  https://slim-fork.sourceforge.io/themes.html 
+     *
+     * Notes about text-label positions:
+     * slimlock: All positions are relative background.
+     * slim: Positions are either relative background or relative 'panel.png'.
+     * Var-names and coordinates gathered in 'cfg.cpp' from 'slim.theme'. 
+     *    Coordinates of 'panel.png' are in:  input_panel_[x,y] 
+     *    Positions relative to 'panel.png' are in: 
+     *       username_x, password_x, input_name_x, input_pass_x, welcome_x
+     *    Absolute positions relative background are in: 
+     *       msg_x , session_x, passwd_feedback_x, input_panel_x
+     * 
+     * Notes on theme'ing:
+     * slim:
+     *  * Labels written at absolute positions are only visible BESIDE 'panel.png'.
+     *  * Labels written at relative positions are only visible ON 'panel.png' itself.
+     * slimlock:
+     *   Shows the relative labels 'welcome_x,y' and 'password_x,y' above background.
+     *   This reveals their positions, even if invisible in slim.
+     * 
+     * layer:
+     *  slim    : bg-color -> bg-image -> bg-labels -> pannel-img -> pannel-labels
+     *  slimlock: composit-backgound -> pannel-labels  
+     */
     XftDraw *draw = XftDrawCreate(Dpy, Win,
           DefaultVisual(Dpy, Scr), DefaultColormap(Dpy, Scr));
     /* welcome message */
@@ -770,6 +805,10 @@
     welcome_x = Cfg::absolutepos(cfgX, image->Width(), extents.width);
     welcome_y = Cfg::absolutepos(cfgY, image->Height(), extents.height);
     if (welcome_x >= 0 && welcome_y >= 0) {
+        if (mode == Mode_Lock) {
+            welcome_x += X; 
+            welcome_y += Y;
+        }
         SlimDrawString8 (draw, &welcomecolor, welcomefont,
                          welcome_x, welcome_y,
                          welcome_message,
@@ -789,6 +828,10 @@
         password_x = Cfg::absolutepos(cfgX, image->Width(), extents.width);
         password_y = Cfg::absolutepos(cfgY, image->Height(), extents.height);
         if (password_x >= 0 && password_y >= 0){
+            if (mode == Mode_Lock) {
+                password_x += X; 
+                password_y += Y;
+            } 
             SlimDrawString8 (draw, &entercolor, enterfont, password_x, password_y,
                              msg, &entershadowcolor, shadowXOffset, shadowYOffset);
         }
@@ -805,6 +848,7 @@
         username_x = Cfg::absolutepos(cfgX, image->Width(), extents.width);
         username_y = Cfg::absolutepos(cfgY, image->Height(), extents.height);
         if (username_x >= 0 && username_y >= 0){
+            /* if (mode == Mode_Lock) {username_x += X; username_y += Y;} */ /* not shown, just to mark */
             SlimDrawString8 (draw, &entercolor, enterfont, username_x, username_y,
                              msg, &entershadowcolor, shadowXOffset, shadowYOffset);
         }

diff -ru -x build slim-1.4.0/cfg.cpp slim-1.4.1/cfg.cpp
--- slim-1.4.0/cfg.cpp    2023-01-22 10:51:28.000000000 +0100
+++ slim-1.4.1/cfg.cpp    2023-06-08 19:38:52.539127875 +0200
@@ -213,6 +213,13 @@
     }
     name = line.substr ( 0, pos );
     value = Trim ( line.substr ( pos ) );
+    // In case of in-line comments:  value = 'strings # comment'.  
+    // Find '#' past the 1st character (colour), then cut and trim again.
+    pos = value.find_first_of ( '#', 1 );      
+    if ( pos > 0 && pos < string::npos )
+    { 
+        value = Trim ( value.substr( 0, pos ) );  
+    }
     if ( value.empty() )
     {
         error = "Badly formed line: " + line;


Version: 1.4.0-0devuan3

Source package slim (1.4.0-0devuan3) added to Devuan suite unstable.

This closes bug report 761.

Thanks

DAK managing the Devuan archive

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Fri, 11 Aug 2023 02:51:09 +0000
Source: slim
Architecture: source
Version: 1.4.0-0devuan3
Distribution: unstable
Urgency: medium
Maintainer: Devuan Dev Team <devuan-dev@???>
Changed-By: Boian Bonev <bbonev@???>
Closes: 761
Changes:
 slim (1.4.0-0devuan3) unstable; urgency=medium
 .
   [ Thomas Fischer ]
   * PR#7 by Thomas Fischer <tom314@???>
     - Move text labels to the correct position as in slim (slimlock,
       Closes: #761)
     - Allow inline comments in config files
     - Fix background image with alpha channel stretch/tile/center and
       background color
 .
   [ Boian Bonev ]
   * Upload to unstable
Checksums-Sha1:
 91821c7a2f9b3bd4a00e4c9e17c898a6339f7015 1814 slim_1.4.0-0devuan3.dsc
 aab520673e4196e704535361459286d817d55836 34656 slim_1.4.0-0devuan3.debian.tar.xz
 e1e89f42989ff4f369a9596a4dc7a94a8267b632 5373 slim_1.4.0-0devuan3_source.buildinfo
Checksums-Sha256:
 627c89b8adbe65e0c7992540e226d47b4048939c2405bbcee0ec57bdcdef9c6f 1814 slim_1.4.0-0devuan3.dsc
 0d63d6536ccb21b5633f5a7e4bd400339168a62418904a2b3d2d31764da1030d 34656 slim_1.4.0-0devuan3.debian.tar.xz
 c1c0fb1c639e97244eccb0bb182ab1fde5c3f3e256a4554d588dde46a1e5b28b 5373 slim_1.4.0-0devuan3_source.buildinfo
Files:
 b808a2d3aef9dfe4b4e39fdea51d5a32 1814 x11 optional slim_1.4.0-0devuan3.dsc
 02280819d9dd1d65505aeccb9eda11a2 34656 x11 optional slim_1.4.0-0devuan3.debian.tar.xz
 38d004bb362854566d90ab1def79651a 5373 x11 optional slim_1.4.0-0devuan3_source.buildinfo


-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEcuPLdzMV36LkZHQ9lFMhJFQZIvsFAmTVp9gACgkQlFMhJFQZ
IvvXTQf+O4IKpjNephIenaWLI2KpVTGtC1urNCLkXYA7obJDt3JhD2IBSqGXeOZn
VhhpCaB6oY97zCtAeRcVXSpbfKzL65JMr7d47pgPwpLknntp864TlsdT79t8ZB7O
xEQvDAdsYhgpV+eKY6iaZS/clsmpsvRggsOV2F5jKoOBsUbq6iSvWomFBpPogfF1
yOk7CWm47Lx17Ssvapvj/1JGWcgZW6T1+2nqyyxBkrvhdJ2hciaOMSZtxuw8Yo6Z
OyJljNPKrE7KuEfK0gD3PFlMZYQgLMj2IS+uKolS73BRIHjh261dPW0iHgOl+Twe
WdsfkmLEYIHGe3X977iY18L9+9dkow==
=E00J
-----END PGP SIGNATURE-----