aboutsummaryrefslogtreecommitdiff
path: root/debian/patches/0203_nxagent_disable-rootless-exit.full.patch
blob: 4c4879e17be34fd12e893c91fbc7094e66ae4ed6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Description: Add -norootlessexit cmdline option to nxagent
Author: Oleksandr Shneyder <o.schneyder@phoca-gmbh.de>

--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c
@@ -672,6 +672,12 @@ int ddxProcessArgument(int argc, char *a
     return 1;
   }
 
+  if (!strcmp(argv[i], "-norootlessexit")) {
+    nxagentChangeOption(NoRootlessExit, True);
+    return 1;
+  }
+
+
   if (!strcmp(argv[i], "-noonce"))
   {
       nxagentOnce = False;
@@ -1855,6 +1861,7 @@ void ddxUseMsg()
   ErrorF("The NX system adds the following arguments:\n");
   ErrorF("-forcenx               force use of NX protocol messages assuming communication through nxproxy\n");
   ErrorF("-timeout int           auto-disconnect timeout in seconds (minimum allowed: 60)\n");
+  ErrorF("-norootlessexit        don't exit if there are no clients in rootless mode\n");
 #ifdef RENDER
   ErrorF("-norender              disable the use of the render extension\n");
   ErrorF("-nocomposite           disable the use of the composite extension\n");
--- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c
@@ -219,7 +219,7 @@ void nxagentBlockHandler(pointer data, s
 
   if (nxagentOption(Rootless) &&
           nxagentLastWindowDestroyed && nxagentRootlessDialogPid == 0 &&
-              now > nxagentLastWindowDestroyedTime + 30 * 1000)
+              now > nxagentLastWindowDestroyedTime + 30 * 1000 && !nxagentOption(NoRootlessExit))
   {
     #ifdef WARNING
     fprintf(stderr, "nxagentBlockHandler: No application running. Closing the session.\n");
--- a/nx-X11/programs/Xserver/hw/nxagent/Options.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c
@@ -56,6 +56,7 @@ void nxagentInitOptions()
   nxagentOptions.Persistent = 1;
   nxagentOptions.Rootless   = UNDEFINED;
   nxagentOptions.Fullscreen = UNDEFINED;
+  nxagentOptions.NoRootlessExit = False;
 
   nxagentOptions.X           = 0;
   nxagentOptions.Y           = 0;
--- a/nx-X11/programs/Xserver/hw/nxagent/Options.h
+++ b/nx-X11/programs/Xserver/hw/nxagent/Options.h
@@ -381,6 +381,13 @@ typedef struct _AgentOptions
 
   int ImageRateLimit;
 
+ /*
+  * True if agent should not exit if there are no
+  * clients in rootless mode
+  */
+
+  int NoRootlessExit;
+
 } AgentOptionsRec;
 
 typedef AgentOptionsRec *AgentOptionsPtr;