Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37897071
en ru br
ALT Linux repos
S:5.69-alt1
5.0: 5.27-alt10.M50.1
4.1: 5.27-alt5.M41.1
4.0: 5.27-alt8.M40.1.1

Group :: Graphical desktop/Other
RPM: xlockmore

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: xlockmore-5.46-nologout.patch
Download


diff -ur xlockmore-5.43/xlock/logout.c xlockmore-5.43.new/xlock/logout.c
--- xlockmore-5.43/xlock/logout.c	2014-06-29 11:02:51.000000000 +0000
+++ xlockmore-5.43.new/xlock/logout.c	2014-06-29 11:56:43.308044766 +0000
@@ -47,6 +47,7 @@
 
 extern Bool inroot, inwindow, nolock, debug;
 extern char *logoutCmd;
+extern Bool nologout;
 
 /*-
  * This file contains a function called logoutUser() that, when called,
@@ -397,6 +398,7 @@
 			exit(0);
 		}
 	}
+	if (nologout) return;
 #ifdef CLOSEDOWN_LOGOUT
 	(void) finish(display, False);
 #else
diff -ur xlockmore-5.43/xlock/resource.c xlockmore-5.43.new/xlock/resource.c
--- xlockmore-5.43/xlock/resource.c	2014-06-29 11:58:30.723057676 +0000
+++ xlockmore-5.43.new/xlock/resource.c	2014-06-29 11:53:27.118541800 +0000
@@ -473,6 +473,8 @@
 	{(char *) "-pipepassCmd", (char *) ".pipepassCmd", XrmoptionSepArg, (caddr_t) NULL},
 #endif
 	{(char *) "-logoutCmd", (char *) ".logoutCmd", XrmoptionSepArg, (caddr_t) NULL},
+	{(char *) "-nologout", (char *) ".nologout", XrmoptionNoArg, (caddr_t) "on"},
+	{(char *) "+nologout", (char *) ".nologout", XrmoptionNoArg, (caddr_t) "off"},
 
 	{(char *) "-mailCmd", (char *) ".mailCmd", XrmoptionSepArg, (caddr_t) ""},
 	{(char *) "-mailIcon", (char *) ".mailIcon", XrmoptionSepArg, (caddr_t) ""},
@@ -696,6 +698,7 @@
 	{(char *) "-pipepassCmd string", (char *) "command into which to pipe the password when unlocking"},
 #endif
       {(char *) "-logoutCmd string", (char *) "command to run when automatically logging out"},
+      {(char *) "-/+nologout", (char *) "let logoutCmd run, but suppress/do not suppress logging out"},
 	{(char *) "-mailCmd string", (char *) "command to run to check for mail"},
 	{(char *) "-mailIcon string", (char *) "Icon to display when there is mail"},
 	{(char *) "-nomailIcon string", (char *) "Icon to display when there is no mail"},
@@ -869,6 +872,7 @@
 char       *pipepassCmd;
 #endif
 char       *logoutCmd;
+Bool       nologout;
 
 char       *mailCmd;
 char       *mailIcon;
@@ -1001,6 +1005,7 @@
 	{(void *) & pipepassCmd, (char *) "pipepassCmd", (char *) "PipePassCmd", (char *) "", t_String},
 #endif
 	{(void *) & logoutCmd, (char *) "logoutCmd", (char *) "LogoutCmd", (char *) "", t_String},
+	{(void *) & nologout, (char *) "nologout", (char *) "nologout", (char *) "off", t_Bool},
 #ifdef USE_DPMS
 	{(void *) & dpmsstandby, (char *) "dpmsstandby", (char *) "DPMSStandby", (char *) DEF_DPMSSTANDBY, t_Int},
 	{(void *) & dpmssuspend, (char *) "dpmssuspend", (char *) "DPMSSuspend", (char *) DEF_DPMSSUSPEND, t_Int},
diff -ur xlockmore-5.43/xlock/xlock.c xlockmore-5.43.new/xlock/xlock.c
--- xlockmore-5.43/xlock/xlock.c	2014-06-29 11:58:30.723057676 +0000
+++ xlockmore-5.43.new/xlock/xlock.c	2014-06-29 11:53:57.375390481 +0000
@@ -873,6 +873,7 @@
 extern char *pipepassCmd;
 #endif
 extern char *logoutCmd;
+extern Bool nologout;
 
 extern char *mailCmd;
 extern char *mailIcon;
@@ -1720,7 +1720,7 @@
 					5 + 2 * (fontHeight));
 				XSetForeground(dsp, Scr[scr].gc, Scr[scr].fg_pixel);
 
-				if (tried_logout) {
+				if (tried_logout && !nologout) {
 					putText(dsp, Scr[scr].window, Scr[scr].textgc, logoutFailedString,
 						True, left, &x, &y);
 				} else {
@@ -1730,7 +1730,7 @@
 					(void) sprintf(buf, " %s ", logoutButtonLabel);
 					XSetForeground(dsp, Scr[scr].gc, Scr[scr].white_pixel);
 					(void) XDrawString(dsp, Scr[scr].button, Scr[scr].gc,
-						0, fontAscent + 1, buf, strlen(buf));
+						0, fontHeight - font->descent, buf, strlen(buf));
 					XSetForeground(dsp, Scr[scr].gc, Scr[scr].fg_pixel);
 					y += 5 + 2 * fontHeight;
 					putText(dsp, Scr[scr].window, Scr[scr].textgc, logoutButtonHelp,
diff -ur xlockmore-5.43/xlock/xlock.man xlockmore-5.43.new/xlock/xlock.man
--- xlockmore-5.43/xlock/xlock.man	2014-06-29 11:02:51.000000000 +0000
+++ xlockmore-5.43.new/xlock/xlock.man	2014-06-29 11:42:50.696690651 +0000
@@ -275,6 +275,9 @@
 [
 .BI \-logoutCmd " string"
 ]
+[
+.BI \-nologout
+]
 
 .SH DESCRIPTION
 .B xlock
@@ -1610,6 +1613,11 @@
 command to execute when the program logs the user out (either via the autologout
 or by pressing the logout button).
 .TP 5
+.B \-nologout
+Use
+.B logoutCmd
+without actually logging out, e. g. if the command switches user instead.
+.TP 5
 .BI \-mailCmd \ string
 Text
 .I string
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin