[X2Go-Commits] [nx-libs] 206/219: nxagent: Make autograb an nxagentOption.

git-admin at x2go.org git-admin at x2go.org
Sat Sep 28 12:11:07 CEST 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit 8bf3429bc9f7aed5b85cf8c0dd71ae678bce544e
Author: Ulrich Sibiller <uli42 at gmx.de>
Date:   Thu Mar 16 13:00:48 2017 +0100

    nxagent: Make autograb an nxagentOption.
---
 nx-X11/programs/Xserver/hw/nxagent/Events.c  | 12 +++++-------
 nx-X11/programs/Xserver/hw/nxagent/Options.c |  2 ++
 nx-X11/programs/Xserver/hw/nxagent/Options.h |  7 +++++++
 3 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c
index 95a00afbf..8bc06e0ae 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Events.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c
@@ -674,8 +674,6 @@ static void nxagentSwitchDeferMode(void)
   }
 }
 
-static Bool autograb = False;
-
 static void nxagentEnableAutoGrab(void)
 {
 #ifdef DEBUG
@@ -683,7 +681,7 @@ static void nxagentEnableAutoGrab(void)
 #endif
 
   nxagentGrabPointerAndKeyboard(NULL);
-  autograb = True;
+  nxagentChangeOption(AutoGrab, True);
 }
 
 static void nxagentDisableAutoGrab(void)
@@ -693,7 +691,7 @@ static void nxagentDisableAutoGrab(void)
 #endif
 
   nxagentUngrabPointerAndKeyboard(NULL);
-  autograb = False;
+  nxagentChangeOption(AutoGrab, False);
 }
 
 static void nxagentToggleAutoGrab(void)
@@ -702,7 +700,7 @@ static void nxagentToggleAutoGrab(void)
   if (nxagentOption(Rootless) || nxagentOption(Fullscreen))
     return;
 
-  if (!autograb)
+  if (!nxagentOption(AutoGrab))
     nxagentEnableAutoGrab();
   else
     nxagentDisableAutoGrab();
@@ -1560,7 +1558,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
         }
 
         /* FIXME: only when in windowed mode! */
-        if (autograb)
+        if (nxagentOption(AutoGrab))
         {
           if (X.xfocus.window == nxagentDefaultWindows[0] && X.xfocus.mode == NotifyNormal)
           {
@@ -1648,7 +1646,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
 
         #endif /* NXAGENT_FIXKEYS */
 
-        if (autograb)
+        if (nxagentOption(AutoGrab))
         {
           XlibWindow w;
           int revert_to;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c
index c06967c76..10e006a23 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Options.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c
@@ -172,6 +172,8 @@ void nxagentInitOptions(void)
   nxagentOptions.ReconnectTolerance = DEFAULT_TOLERANCE;
 
   nxagentOptions.KeycodeConversion = DEFAULT_KEYCODE_CONVERSION;
+
+  nxagentOptions.AutoGrab = False;
 }
 
 /*
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.h b/nx-X11/programs/Xserver/hw/nxagent/Options.h
index b5394ee01..88bb60e8f 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Options.h
+++ b/nx-X11/programs/Xserver/hw/nxagent/Options.h
@@ -450,6 +450,13 @@ typedef struct _AgentOptions
    * Convert evdev keycodes to pc105.
    */
   KeycodeConversionMode KeycodeConversion;
+
+  /*
+   * True if agent should grab the input in windowed mode whenever the
+   * agent window gets the focus
+   */
+  int AutoGrab;  /* Should be Bool but I do not want to include Xlib.h here */
+
 } AgentOptionsRec;
 
 typedef AgentOptionsRec *AgentOptionsPtr;

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list