X2Go Bug report logs - #74
make nxagent keybindings configurable

Package: x2goagent; Maintainer for x2goagent is X2Go Developers <x2go-dev@lists.x2go.org>; Source for x2goagent is src:nx-libs.

Reported by: Alexander Wuerstlein <arw@arw.name>

Date: Mon, 3 Dec 2012 14:18:01 UTC

Severity: normal

Tags: pending

Done: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to x2go-dev@lists.berlios.de, git-admin@x2go.org:
Bug#74; Package nxagent. (Mon, 03 Dec 2012 14:18:01 GMT) (full text, mbox, link).


Acknowledgement sent to Alexander Wuerstlein <arw@arw.name>:
New Bug report received and forwarded. Copy sent to git-admin@x2go.org. (Mon, 03 Dec 2012 14:18:01 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.x2go.org (full text, mbox, reply):

From: Alexander Wuerstlein <arw@arw.name>
To: submit@bugs.x2go.org
Subject: make nxagent keybindings configurable
Date: Mon, 3 Dec 2012 15:08:50 +0100
Package: nxagent

The hardcoded default nxagent keybindings (e.g. Ctrl-Alt-t opens a terminal in
Gnome or closes a nx/x2go session) collide with several more or less popular
window managers or desktop environments. Since any hardcoded configuration will
inevitably collide with some other configuration somewhere, the only sane way
out of this is making the keybindings configurable, which the attached patch does.


Information forwarded to x2go-dev@lists.berlios.de, git-admin@x2go.org:
Bug#74; Package nxagent. (Mon, 03 Dec 2012 14:48:02 GMT) (full text, mbox, link).


Acknowledgement sent to Alexander Wuerstlein <arw@arw.name>:
Extra info received and forwarded to list. Copy sent to git-admin@x2go.org. (Mon, 03 Dec 2012 14:48:02 GMT) (full text, mbox, link).


Message #10 received at 74@bugs.x2go.org (full text, mbox, reply):

From: Alexander Wuerstlein <arw@arw.name>
To: 74@bugs.x2go.org
Cc: Alexander Wuerstlein <arw@arw.name>
Subject: [PATCH 1/2] nxagent keystroke handling: make keys configurable at runtime
Date: Mon, 3 Dec 2012 15:42:11 +0100
Replaces the hardcoded nxagent keybindings by a configurable
table of keybindings. The default configuration is the same as the
original one, to maintain compatibility. A user/administrator can either
specify a command line parameter, environment variable or place a file
in ~/.nx/config/keystroke.cfg or /etc/nx/keystroke.cfg to reconfigure
these keybindings.

The configuration file format is XML, a dependency on libxml2 is added
to allow parsing the configuration.
---
 nx-X11/programs/Xserver/Imakefile              |    9 +-
 nx-X11/programs/Xserver/hw/nxagent/Imakefile   |    9 +-
 nx-X11/programs/Xserver/hw/nxagent/Keystroke.c |  699 ++++++++++++++++--------
 nx-X11/programs/Xserver/hw/nxagent/Keystroke.h |   47 ++
 4 files changed, 527 insertions(+), 237 deletions(-)

diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile
index 3f53eca..80e3a71 100644
--- a/nx-X11/programs/Xserver/Imakefile
+++ b/nx-X11/programs/Xserver/Imakefile
@@ -1013,15 +1013,18 @@ $(NXAGENTOBJS) $(NXAGENTLIBS) $(NXAGENTSYSLIBS):: $(NXAGENTDIRS)
 #if defined(SunArchitecture)
 NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \
                 -lXcomp -lXcompext -lXcompshad -lrt -L/usr/sfw/lib -lNX_Xrender -lNX_Xfixes \
-                -L../../../nx-X11/exports/lib -lNX_Xtst -lNX_Xdamage -lNX_Xrandr -lNX_Xcomposite -lNX_Xdmcp
+                -L../../../nx-X11/exports/lib -lNX_Xtst -lNX_Xdamage -lNX_Xrandr -lNX_Xcomposite -lNX_Xdmcp \
+		`pkg-config --libs libxml-2.0`
 #elif defined(cygwinArchitecture)
 NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext \
                 -lXcomp -lXcompext -lNX_Xrender -lNX_X11 -lNX_Xext -lNX_Xcomposite -lNX_Xfixes \
-                -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lNX_Xtst -lNX_Xdmcp
+                -L ../../../nxcompshad -lXcompshad -L../../../nx-X11/exports/lib -lNX_Xtst -lNX_Xdmcp \
+		`pkg-config --libs libxml-2.0`
 #else
 NXAGENTNXLIBS = -L ../../../nxcomp -L ../../../nxcompext -L ../../../nxcompshad \
                 -lXcomp -lXcompext -lXcompshad -lNX_Xrender -lNX_X11 -lNX_Xext -lNX_Xfixes \
-                -L../../../nx-X11/exports/lib -lNX_Xtst -lNX_Xdamage -lNX_Xrandr -lNX_Xcomposite -lNX_Xinerama -lNX_Xdmcp
+                -L../../../nx-X11/exports/lib -lNX_Xtst -lNX_Xdamage -lNX_Xrandr -lNX_Xcomposite -lNX_Xinerama -lNX_Xdmcp \
+		`pkg-config --libs libxml-2.0`
 #endif
 
 #endif
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile
index a8e1621..ccd53d1 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile
+++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile
@@ -142,7 +142,8 @@ INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../
            -I../../miext/damage -I../../miext/cw \
 	   -I../../GL/glx -I../../GL/include -I../../../../lib/GL/include -I../../Xext \
            -I$(EXTINCSRC) -I$(XINCLUDESRC) \
-	   $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES)
+	   $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) \
+	   `pkg-config --cflags-only-I libxml-2.0`
 #ifdef SunArchitecture
 INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../../nxcompshad \
            -I../../../../extras/Mesa/include \
@@ -152,7 +153,8 @@ INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../
 	   -I../../GL/glx -I../../GL/include -I../../../../lib/GL/include -I../../Xext \
            -I../../miext/damage -I../../miext/cw \
            -I$(EXTINCSRC) -I$(XINCLUDESRC) \
-	   $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES)
+	   $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) \
+	   `pkg-config --cflags-only-I libxml-2.0`
 #else
 #ifdef cygwinArchitecture
 INCLUDES = -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \
@@ -162,7 +164,8 @@ INCLUDES = -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \
            -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../../nxcompshad \
            -I../../../../extras/Mesa/include \
            -I$(EXTINCSRC) -I$(XINCLUDESRC) \
-	   $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES)
+	   $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) \
+	   `pkg-config --cflags-only-I libxml-2.0`
 #endif
 #endif
 
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
index 6c6e477..b5f4acf 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
@@ -28,8 +28,15 @@
 #include "Keystroke.h"
 #include "Drawable.h"
 
+#include <unistd.h>
+
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+
 extern Bool nxagentWMIsRunning;
 extern Bool nxagentIpaq;
+extern char *nxagentKeystrokeFile;
+Bool nxagentKeystrokeFileParsed = False;
 
 #ifdef NX_DEBUG_INPUT
 int nxagentDebugInputDevices = 0;
@@ -47,10 +54,369 @@ extern void nxagentDeactivateInputDevicesGrabs();
 #undef  DEBUG
 #undef  DUMP
 
+
+/* this table is used to parse actions given on the command line or in the
+ * config file, therefore indices have to match the enum in Keystroke.h */
+char * nxagentSpecialKeystrokeNames[] = {
+	"end_marker",
+	"close_session",
+	"switch_all_screens",
+	"minimize",
+	"left",
+	"up",
+	"right",
+	"down",
+	"resize",
+	"defer",
+	"ignore",
+	"force_synchronization",
+
+	"debug_tree",
+	"regions_on_screen",
+	"test_input",
+	"deactivate_input_devices_grab",
+
+	"fullscreen",
+	"viewport_move_left",
+	"viewport_move_up",
+	"viewport_move_right",
+	"viewport_move_down",
+	NULL,
+};
+
+struct nxagentSpecialKeystrokeMap default_map[] = {
+  /* stroke, modifierMask, modifierAltMeta, keysym */
+  {KEYSTROKE_DEBUG_TREE, ControlMask, 1, XK_q},
+  {KEYSTROKE_DEBUG_TREE, ControlMask, 1, XK_Q},
+  {KEYSTROKE_CLOSE_SESSION, ControlMask, 1, XK_t},
+  {KEYSTROKE_CLOSE_SESSION, ControlMask, 1, XK_T},
+  {KEYSTROKE_SWITCH_ALL_SCREENS, ControlMask, 1, XK_f},
+  {KEYSTROKE_SWITCH_ALL_SCREENS, ControlMask, 1, XK_F},
+  {KEYSTROKE_MINIMIZE, ControlMask, 1, XK_m},
+  {KEYSTROKE_MINIMIZE, ControlMask, 1, XK_M},
+  {KEYSTROKE_LEFT, ControlMask, 1, XK_Left},
+  {KEYSTROKE_LEFT, ControlMask, 1, XK_KP_Left},
+  {KEYSTROKE_UP, ControlMask, 1, XK_Up},
+  {KEYSTROKE_UP, ControlMask, 1, XK_KP_Up},
+  {KEYSTROKE_RIGHT, ControlMask, 1, XK_Right},
+  {KEYSTROKE_RIGHT, ControlMask, 1, XK_KP_Right},
+  {KEYSTROKE_DOWN, ControlMask, 1, XK_Down},
+  {KEYSTROKE_DOWN, ControlMask, 1, XK_KP_Down},
+  {KEYSTROKE_RESIZE, ControlMask, 1, XK_r},
+  {KEYSTROKE_RESIZE, ControlMask, 1, XK_R},
+  {KEYSTROKE_DEFER, ControlMask, 1, XK_e},
+  {KEYSTROKE_DEFER, ControlMask, 1, XK_E},
+  {KEYSTROKE_IGNORE, ControlMask, 1, XK_BackSpace},
+  {KEYSTROKE_IGNORE, 0, 0, XK_Terminate_Server},
+  {KEYSTROKE_FORCE_SYNCHRONIZATION, ControlMask, 1, XK_j},
+  {KEYSTROKE_FORCE_SYNCHRONIZATION, ControlMask, 1, XK_J},
+  {KEYSTROKE_REGIONS_ON_SCREEN, ControlMask, 1, XK_a},
+  {KEYSTROKE_REGIONS_ON_SCREEN, ControlMask, 1, XK_A},
+  {KEYSTROKE_TEST_INPUT, ControlMask, 1, XK_x},
+  {KEYSTROKE_TEST_INPUT, ControlMask, 1, XK_X},
+  {KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB, ControlMask, 1, XK_y},
+  {KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB, ControlMask, 1, XK_Y},
+  {KEYSTROKE_FULLSCREEN, ControlMask | ShiftMask, 1, XK_f},
+  {KEYSTROKE_FULLSCREEN, ControlMask | ShiftMask, 1, XK_F},
+  {KEYSTROKE_VIEWPORT_MOVE_LEFT, ControlMask | ShiftMask, 1, XK_Left},
+  {KEYSTROKE_VIEWPORT_MOVE_LEFT, ControlMask | ShiftMask, 1, XK_KP_Left},
+  {KEYSTROKE_VIEWPORT_MOVE_UP, ControlMask | ShiftMask, 1, XK_Up},
+  {KEYSTROKE_VIEWPORT_MOVE_UP, ControlMask | ShiftMask, 1, XK_KP_Up},
+  {KEYSTROKE_VIEWPORT_MOVE_RIGHT, ControlMask | ShiftMask, 1, XK_Right},
+  {KEYSTROKE_VIEWPORT_MOVE_RIGHT, ControlMask | ShiftMask, 1, XK_KP_Right},
+  {KEYSTROKE_VIEWPORT_MOVE_DOWN, ControlMask | ShiftMask, 1, XK_Down},
+  {KEYSTROKE_VIEWPORT_MOVE_DOWN, ControlMask | ShiftMask, 1, XK_KP_Down},
+  {KEYSTROKE_END_MARKER, 0, 0, 0},
+};
+struct nxagentSpecialKeystrokeMap *map = default_map;
+
+static int modifier_matches(unsigned int mask, int compare_alt_meta, unsigned int state)
+{
+  /* nxagentAltMetaMask needs special handling
+   * it seems to me its an and-ed mask of all possible meta and alt keys
+   * somehow...
+   *
+   * otherwise this function would be just a simple bitop
+   */
+  int ret = 1;
+
+  if (compare_alt_meta) {
+    if (! (state & nxagentAltMetaMask)) {
+      ret = 0;
+    }
+
+    mask &= ~nxagentAltMetaMask;
+  }
+
+  /* all modifiers except meta/alt have to match exactly, extra bits are evil */
+  if ((mask & state) != mask) {
+    ret = 0;
+  }
+
+  return ret;
+}
+
+static int read_binding_from_xmlnode(xmlNode *node, struct nxagentSpecialKeystrokeMap *ret)
+{
+  int successful = 0;
+  struct nxagentSpecialKeystrokeMap new = {0, 0, 0, 0};
+  xmlAttr *attr;
+
+  for (attr = node->properties; attr; attr = attr->next)
+  {
+    /* ignore attributes without data (which should never happen anyways) */
+    if (attr->children->content == NULL)
+    {
+      char *aname = (attr->name)?(attr->name):"unknown";
+      fprintf(stderr, "attribute %s with NULL value", aname);
+      continue;
+    }
+    if (strcmp((char *)attr->name, "action") == 0)
+    {
+      int i;
+      for (i = 0; nxagentSpecialKeystrokeNames[i] != NULL; i++)
+      {
+        if (strcmp(nxagentSpecialKeystrokeNames[i],(char *)attr->children->content) == 0)
+        {
+          /* this relies on the values of enum nxagentSpecialKeystroke and the
+           * indices of nxagentSpecialKeystrokeNames being in sync */
+          new.stroke = i;
+          break;
+        }
+      }
+      continue;
+    }
+    else if (strcmp((char *)attr->name, "key") == 0)
+    {
+      new.keysym = XStringToKeysym((char *)attr->children->content);
+      /* NoSymbol is usually 0, but could there be weird implementations? */
+      if (new.keysym == NoSymbol)
+      {
+        new.keysym = 0;
+      }
+      continue;
+    }
+
+    /* ignore attributes with value="0" or "false", everything else is interpreted as true */
+    if (strcmp((char *)attr->children->content, "0") == 0 || strcmp((char *)attr->children->content, "false") == 0)
+      continue;
+
+    if (strcmp((char *)attr->name, "Mod1") == 0)
+    {
+      new.modifierMask |= Mod1Mask;
+    }
+    else if (strcmp((char *)attr->name, "Mod2") == 0)
+    {
+      new.modifierMask |= Mod2Mask;
+    }
+    else if (strcmp((char *)attr->name, "Mod3") == 0)
+    {
+      new.modifierMask |= Mod3Mask;
+    }
+    else if (strcmp((char *)attr->name, "Mod4") == 0)
+    {
+      new.modifierMask |= Mod4Mask;
+    }
+    else if (strcmp((char *)attr->name, "Control") == 0)
+    {
+      new.modifierMask |= ControlMask;
+    }
+    else if (strcmp((char *)attr->name, "Shift") == 0)
+    {
+      new.modifierMask |= ShiftMask;
+    }
+    else if (strcmp((char *)attr->name, "Lock") == 0)
+    {
+      new.modifierMask |= LockMask;
+    }
+    else if (strcmp((char *)attr->name, "AltMeta") == 0)
+    {
+      new.modifierAltMeta = 1;
+    }
+  }
+
+  if (new.stroke != 0 && new.keysym != 0)
+  {
+    /* keysym and stroke are required, everything else is optional */
+    successful = 1;
+    memcpy(ret, &new, sizeof(struct nxagentSpecialKeystrokeMap));
+  }
+  return successful;
+}
+
+/*
+ * searches a keystroke xml file
+ *
+ * search order:
+ *  - '-keystrokefile' commandline parameter
+ *  - $NXAGENT_KEYSTROKEFILE environment variable
+ *  - $HOME/.nx/config/keystroke.cfg
+ *  - /etc/nx/keystroke.cfg
+ *  - hardcoded traditional NX default settings
+ */
+static void parse_keystroke_file(void)
+{
+  char *filename = NULL;
+
+  char *homefile = "/.nx/config/keystroke.cfg";
+  char *etcfile = "/etc/nx/keystroke.cfg";
+
+  if (nxagentKeystrokeFile != NULL && access(nxagentKeystrokeFile, R_OK) == 0)
+  {
+    filename = strdup(nxagentKeystrokeFile);
+    if (filename == NULL)
+    {
+      fprintf(stderr, "malloc failed");
+      exit(EXIT_FAILURE);
+    }
+  }
+  else if ((filename = getenv("NXAGENT_KEYSTROKEFILE")) != NULL && access(filename, R_OK) == 0)
+  {
+    filename = strdup(filename);
+    if (filename == NULL)
+    {
+      fprintf(stderr, "malloc failed");
+      exit(EXIT_FAILURE);
+    }
+  }
+  else
+  {
+    char *homedir = getenv("HOME");
+    filename = NULL;
+    if (homedir != NULL)
+    {
+      homedir = strdup(homedir);
+      if (homedir == NULL)
+      {
+        fprintf(stderr, "malloc failed");
+	exit(EXIT_FAILURE);
+      }
+      filename = calloc(1, strlen(homefile) + strlen(homedir) + 1);
+      if (filename == NULL)
+      {
+        fprintf(stderr, "malloc failed");
+        exit(EXIT_FAILURE);
+      }
+      strcpy(filename, homedir);
+      strcpy(filename + strlen(homedir), homefile);
+      if (homedir)
+      {
+        free(homedir);
+      }
+    }
+
+    if (access(filename, R_OK) == 0)
+    {
+      /* empty */
+    }
+    else if (access(etcfile, R_OK == 0))
+    {
+      if (filename)
+        free(filename);
+      filename = strdup(etcfile);
+      if (filename == NULL)
+      {
+        fprintf(stderr, "malloc failed");
+        exit(EXIT_FAILURE);
+      }
+    }
+    else
+    {
+      if (filename)
+	free(filename);
+      filename = NULL;
+    }
+  }
+
+  /* now we know which file to read, if any */
+  if (filename)
+  {
+    xmlDoc *doc = NULL;
+    xmlNode *root = NULL;
+    LIBXML_TEST_VERSION
+    doc = xmlReadFile(filename, NULL, 0);
+    if (doc != NULL)
+    {
+      xmlNode *cur = NULL;
+      root = xmlDocGetRootElement(doc);
+
+      for (cur = root; cur; cur = cur->next)
+      {
+        if (cur->type == XML_ELEMENT_NODE && strcmp((char *)cur->name, "keystrokes") == 0)
+	{
+          xmlNode *bindings = NULL;
+          int num = 0;
+          int idx = 0;
+
+          for (bindings = cur->children; bindings; bindings = bindings->next)
+          {
+            if (bindings->type == XML_ELEMENT_NODE && strcmp((char *)bindings->name, "keystroke") == 0)
+            {
+              num++;
+            }
+          }
+          map = calloc((num + 1), sizeof(struct nxagentSpecialKeystrokeMap));
+          if (map == NULL)
+          {
+            fprintf(stderr, "malloc failed");
+            exit(EXIT_FAILURE);
+          }
+
+          for (bindings = cur->children; bindings; bindings = bindings->next)
+          {
+            if (bindings->type == XML_ELEMENT_NODE && strcmp((char *)bindings->name, "keystroke") == 0)
+            {
+              int res = 0;
+              res = read_binding_from_xmlnode(bindings, &(map[idx]));
+              if (res)
+                idx++;
+            }
+          }
+
+          map[idx].stroke = KEYSTROKE_END_MARKER;
+        }
+      }
+
+      xmlFreeDoc(doc);
+      xmlCleanupParser();
+    }
+    else
+    {
+      #ifdef DEBUG
+      fprintf("XML parsing for %s failed\n", filename);
+      #endif
+    }
+    free(filename);
+  }
+}
+
+static enum nxagentSpecialKeystroke find_keystroke(XKeyEvent *X)
+{
+  KeySym keysym = XKeycodeToKeysym(nxagentDisplay, X->keycode, 0);
+  struct nxagentSpecialKeystrokeMap *cur = map;
+
+  if (! nxagentKeystrokeFileParsed)
+  {
+    parse_keystroke_file();
+    nxagentKeystrokeFileParsed = True;
+  }
+
+  enum nxagentSpecialKeystroke ret = KEYSTROKE_NOTHING;
+
+  while ((cur++)->stroke != KEYSTROKE_END_MARKER) {
+    if (cur->keysym == keysym && modifier_matches(cur->modifierMask, cur->modifierAltMeta, X->state)) {
+      return cur->stroke;
+    }
+  }
+
+  return ret;
+}
+
 int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
 {
   KeySym sym;
   int index = 0;
+  enum nxagentSpecialKeystroke stroke = find_keystroke(X);
 
   *result = doNothing;
 
@@ -87,257 +453,128 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
     return 1;
   }
 
-  if ((X -> state & nxagentAltMetaMask) &&
-          ((X -> state & (ControlMask | ShiftMask)) == ControlMask))
-  {
-    switch (sym)
-    {
+  switch (stroke) {
+    case KEYSTROKE_DEBUG_TREE:
       #ifdef DEBUG_TREE
-
-      case XK_q:
-      case XK_Q:
-      {
-        *result = doDebugTree;
-
-        break;
-      }
-
-      #endif /* DEBUG_TREE */
-
-      case XK_t:
-      case XK_T:
-      {
-        *result = doCloseSession;
-
-        break;
-      }
-      case XK_f:
-      case XK_F:
-      {
-        if (nxagentOption(Rootless) == False)
-        {
-          *result = doSwitchAllScreens;
-        }
-
-        break;
-      }
-      case XK_m:
-      case XK_M:
-      {
-        if (nxagentOption(Rootless) == False)
-        {
-          *result = doMinimize;
-        }
-
-        break;
-      }
-      case XK_Left:
-      case XK_KP_Left:
-      {
-        if (nxagentOption(Rootless) == False &&
-                nxagentOption(DesktopResize) == False)
-        {
-          *result = doViewportLeft;
-        }
-
-        break;
+      *result = doDebugTree;
+      #endif
+      break;
+    case KEYSTROKE_CLOSE_SESSION:
+      *result = doCloseSession;
+      break;
+    case KEYSTROKE_SWITCH_ALL_SCREENS:
+      if (nxagentOption(Rootless) == False) {
+        *result = doSwitchAllScreens;
       }
-      case XK_Up:
-      case XK_KP_Up:
-      {
-        if (nxagentOption(Rootless) == False &&
-                nxagentOption(DesktopResize) == False)
-        {
-          *result = doViewportUp;
-        }
-
-        break;
+      break;
+    case KEYSTROKE_MINIMIZE:
+      if (nxagentOption(Rootless) == False) {
+        *result = doMinimize;
       }
-      case XK_Right:
-      case XK_KP_Right:
-      {
-        if (nxagentOption(Rootless) == False &&
-                nxagentOption(DesktopResize) == False)
-        {
-          *result = doViewportRight;
-        }
-
-        break;
+      break;
+    case KEYSTROKE_LEFT:
+      if (nxagentOption(Rootless) == False &&
+          nxagentOption(DesktopResize) == False) {
+        *result = doViewportLeft;
       }
-      case XK_Down:
-      case XK_KP_Down:
-      {
-        if (nxagentOption(Rootless) == 0 &&
-                nxagentOption(DesktopResize) == 0)
-        {
-          *result = doViewportDown;
-        }
-
-        break;
+      break;
+    case KEYSTROKE_UP:
+      if (nxagentOption(Rootless) == False &&
+          nxagentOption(DesktopResize) == False) {
+        *result = doViewportUp;
       }
-      case XK_R:
-      case XK_r:
-      {
-        if (nxagentOption(Rootless) == 0)
-        {
-          *result = doSwitchResizeMode;
-        }
-
-        break;
+      break;
+    case KEYSTROKE_RIGHT:
+      if (nxagentOption(Rootless) == False &&
+          nxagentOption(DesktopResize) == False) {
+        *result = doViewportRight;
       }
-      case XK_E:
-      case XK_e:
-      {
-        *result = doSwitchDeferMode;
-
-        break;
+      break;
+    case KEYSTROKE_DOWN:
+      if (nxagentOption(Rootless) == False &&
+          nxagentOption(DesktopResize) == False) {
+        *result = doViewportDown;
       }
-      case XK_BackSpace:
-      case XK_Terminate_Server:
-      {
-        /*
-         * Discard Ctrl-Alt-BackSpace key.
-         */
-
-        return 1;
-
-        break;
+      break;
+    case KEYSTROKE_RESIZE:
+      if (nxagentOption(Rootless) == False) {
+        *result = doSwitchResizeMode;
       }
-
-      case XK_J:
-      case XK_j:
-      {
-        nxagentForceSynchronization = 1;
-
-        return 1;
-      }
-
+      break;
+    case KEYSTROKE_DEFER:
+      *result = doSwitchDeferMode;
+      break;
+    case KEYSTROKE_IGNORE:
+      /* this is used e.g. to ignore C-A-Backspace aka XK_Terminate_Server */
+      return 1;
+      break;
+    case KEYSTROKE_FORCE_SYNCHRONIZATION:
+      nxagentForceSynchronization = 1;
+      break;
+    case KEYSTROKE_REGIONS_ON_SCREEN:
       #ifdef DUMP
-
-      case XK_A:
-      case XK_a:
-      {
-        /*
-         * Used to test the lazy encoding.
-         */
-
-        nxagentRegionsOnScreen();
-
-        return 1;
-      }
-
+      nxagentRegionsOnScreen();
       #endif
-
+      break;
+    case KEYSTROKE_TEST_INPUT:
+      /*
+       * Used to test the input devices state.
+       */
       #ifdef NX_DEBUG_INPUT
-
-      case XK_X:
-      case XK_x:
-      {
-        /*
-         * Used to test the input devices state.
-         */
-
-        if (X -> type == KeyPress)
-        {
-          if (nxagentDebugInputDevices == 0)
-          {
-            fprintf(stderr, "Info: Turning input devices debug ON.\n");
-    
-            nxagentDebugInputDevices = 1;
-          }
-          else
-          {
-            fprintf(stderr, "Info: Turning input devices debug OFF.\n");
-    
-            nxagentDebugInputDevices = 0;
-    
-            nxagentLastInputDevicesDumpTime = 0;
-          }
+      if (X -> type == KeyPress) {
+        if (nxagentDebugInputDevices == 0) {
+          fprintf(stderr, "Info: Turning input devices debug ON.\n");
+          nxagentDebugInputDevices = 1;
+        } else {
+          fprintf(stderr, "Info: Turning input devices debug OFF.\n");
+          nxagentDebugInputDevices = 0;
+          nxagentLastInputDevicesDumpTime = 0;
         }
-
-        return 1;
       }
-
-      case XK_Y:
-      case XK_y:
-      {
-        /*
-         * Used to deactivate input devices grab.
-         */
-
-        if (X -> type == KeyPress)
-        {
-          nxagentDeactivateInputDevicesGrabs();
-        }
-
-        return 1;
+      return 1;
+      #endif
+      break;
+    case KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB:
+      #ifdef NX_DEBUG_INPUT
+      if (X->type == KeyPress) {
+        nxagentDeactivateInputDevicesGrab();
       }
-
+      return 1;
       #endif
-    }
-  }
-  else if ((X -> state & nxagentAltMetaMask) &&
-               ((X -> state & (ControlMask | ShiftMask)) == (ControlMask |
-                   ShiftMask)))
-  {
-    switch (sym)
-    {
-      case XK_f:
-      case XK_F:
-      {
-        if (nxagentOption(Rootless) == 0)
-        {
-          *result = doSwitchFullscreen;
-        }
-
-        break;
+      break;
+    case KEYSTROKE_FULLSCREEN:
+      if (nxagentOption(Rootless) == 0) {
+        *result = doSwitchFullscreen;
       }
-      case XK_Left:
-      case XK_KP_Left:
-      {
-        if (nxagentOption(Rootless) == 0 &&
-                nxagentOption(DesktopResize) == 0)
-        {
-          *result = doViewportMoveLeft;
-        }
-
-        break;
+      break;
+    case KEYSTROKE_VIEWPORT_MOVE_LEFT:
+      if (nxagentOption(Rootless) == 0 &&
+          nxagentOption(DesktopResize) == 0) {
+        *result = doViewportMoveLeft;
       }
-      case XK_Up:
-      case XK_KP_Up:
-      {
-        if (nxagentOption(Rootless) == 0 &&
-                nxagentOption(DesktopResize) == 0)
-        {
-          *result = doViewportMoveUp;
-        }
-
-        break;
+      break;
+    case KEYSTROKE_VIEWPORT_MOVE_UP:
+      if (nxagentOption(Rootless) == 0 &&
+          nxagentOption(DesktopResize) == 0) {
+        *result = doViewportMoveUp;
       }
-      case XK_Right:
-      case XK_KP_Right:
-      {
-        if (nxagentOption(Rootless) == 0 &&
-                nxagentOption(DesktopResize) == 0)
-        {
-          *result = doViewportMoveRight;
-        }
-
-        break;
+      break;
+    case KEYSTROKE_VIEWPORT_MOVE_RIGHT:
+      if (nxagentOption(Rootless) == 0 &&
+          nxagentOption(DesktopResize) == 0) {
+        *result = doViewportMoveRight;
       }
-      case XK_Down:
-      case XK_KP_Down:
-      {
-        if (nxagentOption(Rootless) == 0 &&
-                nxagentOption(DesktopResize) == 0)
-        {
-          *result = doViewportMoveDown;
-        }
-
-        break;
+      break;
+    case KEYSTROKE_VIEWPORT_MOVE_DOWN:
+      if (nxagentOption(Rootless) == 0 &&
+          nxagentOption(DesktopResize) == 0) {
+        *result = doViewportMoveDown;
       }
-    }
+      break;
+    case KEYSTROKE_NOTHING: /* do nothing. difference to KEYSTROKE_IGNORE is the return value */
+    case KEYSTROKE_END_MARKER: /* just to make gcc STFU */
+    case KEYSTROKE_MAX:
+      break;
   }
-
   return (*result == doNothing) ? 0 : 1;
 }
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h
index ef71a88..ecfb2c4 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h
+++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h
@@ -24,4 +24,51 @@ extern int nxagentCheckSpecialKeystroke(XKeyEvent*, enum HandleEventResult*);
 
 unsigned int nxagentAltMetaMask;
 
+/* keep this sorted, do not rely on any numerical value in this enum, and be aware
+ * that KEYSTROKE_MAX may be used in a malloc */
+
+/* also be aware that if changing any numerical values, you also need to change values
+ * Keystroke.c nxagentSpecialKeystrokeNames */
+enum nxagentSpecialKeystroke {
+	/* 0 is used as end marker */
+	KEYSTROKE_END_MARKER = 0,
+	KEYSTROKE_CLOSE_SESSION = 1,
+	KEYSTROKE_SWITCH_ALL_SCREENS = 2,
+	KEYSTROKE_MINIMIZE = 3,
+	KEYSTROKE_LEFT = 4,
+	KEYSTROKE_UP = 5,
+	KEYSTROKE_RIGHT = 6,
+	KEYSTROKE_DOWN = 7,
+	KEYSTROKE_RESIZE = 8,
+	KEYSTROKE_DEFER = 9,
+	KEYSTROKE_IGNORE = 10,
+	KEYSTROKE_FORCE_SYNCHRONIZATION = 11,
+
+	/* stuff used for debugging, probably not useful for most people */
+	KEYSTROKE_DEBUG_TREE = 12,
+	KEYSTROKE_REGIONS_ON_SCREEN = 13,
+	KEYSTROKE_TEST_INPUT = 14,
+	KEYSTROKE_DEACTIVATE_INPUT_DEVICES_GRAB = 15,
+
+	KEYSTROKE_FULLSCREEN = 16,
+	KEYSTROKE_VIEWPORT_MOVE_LEFT = 17,
+	KEYSTROKE_VIEWPORT_MOVE_UP = 18,
+	KEYSTROKE_VIEWPORT_MOVE_RIGHT = 19,
+	KEYSTROKE_VIEWPORT_MOVE_DOWN = 20,
+
+	KEYSTROKE_NOTHING = 21,
+
+	/* insert more here, increment KEYSTROKE_MAX accordingly.
+	 * then update string translation below */
+
+	KEYSTROKE_MAX=22,
+};
+
+struct nxagentSpecialKeystrokeMap {
+	enum nxagentSpecialKeystroke stroke;
+	unsigned int modifierMask; /* everything except alt/meta */
+	int modifierAltMeta; /* modifier combination should include alt/meta */
+	KeySym keysym;
+};
+
 #endif /* __Keystroke_H__ */
-- 
1.7.10.4


Information forwarded to x2go-dev@lists.berlios.de, git-admin@x2go.org:
Bug#74; Package nxagent. (Mon, 03 Dec 2012 14:48:02 GMT) (full text, mbox, link).


Acknowledgement sent to Alexander Wuerstlein <arw@arw.name>:
Extra info received and forwarded to list. Copy sent to git-admin@x2go.org. (Mon, 03 Dec 2012 14:48:03 GMT) (full text, mbox, link).


Message #15 received at 74@bugs.x2go.org (full text, mbox, reply):

From: Alexander Wuerstlein <arw@arw.name>
To: 74@bugs.x2go.org
Cc: Alexander Wuerstlein <arw@arw.name>
Subject: [PATCH 2/2] add documentation for keystrokes
Date: Mon, 3 Dec 2012 15:42:12 +0100
---
 README.keystrokes |   83 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)
 create mode 100644 README.keystrokes

diff --git a/README.keystrokes b/README.keystrokes
new file mode 100644
index 0000000..519ffba
--- /dev/null
+++ b/README.keystrokes
@@ -0,0 +1,83 @@
+Configurable keybindings in nxagent
+
+Keybindings in the redistributed x2go version of nxagent can now be configured
+by the user. This is done via a configuration file. 
+
+File location
+-------------
+
+nxagent searches for the configuration file in the following order:
+- in the location given by the '-keystrokefile' command line parameter
+- in the location given by the NXAGENT_KEYSTROKEFILE environment variable
+- in ~/.nx/config/keystroke.cfg
+- in /etc/nx/keystroke.cfg
+
+If none of those files is accessible, the default configuration is used which
+is the same as the old, traditional nxagent keybindings.
+
+File format
+-----------
+
+The configuration file is XML with the following format:
+
+<!DOCTYPE NXKeystroke>
+<keystrokes>
+	<keystroke action="fullscreen" AltMeta="1" Control="1" key="b" />
+	<keystroke action="minimize" AltMeta="1" Control="1" key="space" />
+	<keystroke action="minimize" key="Escape" Shift="1" />
+	<keystroke action="close_session" key="F7" />
+	<keystroke action="fullscreen" key="F7" Mod1="1" />
+	<keystroke action="fullscreen" key="F6" Mod1="1" />
+	<keystroke action="force_synchronization" key="f" />
+	<keystroke action="fullscreen" key="space" Mod1="0" Mod2="0" Control="0" Shift="0" AltMeta="0" />
+</keystrokes>
+
+Each 'action' defines an action to be executed when receiving that keystroke. A
+list of possible actions is given below. Some of those actions are only
+available with debug builds of nxagent.
+
+Keys are given as a combination of 'key' and (optionally) a number of
+modifiers. The key attribute is evaluated into a X11 key via the usual
+XStringToKeysym function. A list of possible keys can be found in
+/usr/include/X11/keysymdef.h, the names are specified without the leading
+'XK_'. Evaluation is case-sensitive, so, 'space' and 'Escape' will work while
+'Space' and 'escape' won't.
+
+Modifiers are given as boolean attributes, possible modifiers are Mod1, Mod2,
+Mod3, Mod4, Control, Shift, Lock. Sensible combinations strongly depend on your
+keyboard configuration, but usually you will need Mod1 and Control. Boolean in
+this context means '0', 'false' and an unspecified attribute are false, anything
+else is considered true.
+
+Everything in this file is case-sensitive. Unknown lines are ignored.
+Keybindings are evaluated from top to bottom, so if a keybinding matches, other
+keybindings further down will be ignored. The contents of the file replaces the
+default keybindings, and only one file is read, no merging between different
+configuration files is done. This also means that an empty or invalid configuration
+file deactivates all keybindings.
+
+List of possible 'action' attributes:
+-------------------------------------
+
+close_session
+switch_all_screens
+minimize
+left
+up
+right
+down
+resize
+defer
+ignore
+fullscreen
+viewport_move_left
+viewport_move_up
+viewport_move_right
+viewport_move_down
+
+Only in builds with certain debugging options enabled, ignored otherwise:
+force_synchronization
+debug_tree
+regions_on_screen
+test_input
+deactivate_input_devices_grab
-- 
1.7.10.4


Information forwarded to x2go-dev@lists.berlios.de, git-admin@x2go.org:
Bug#74; Package nxagent. (Tue, 04 Dec 2012 13:00:42 GMT) (full text, mbox, link).


Acknowledgement sent to Mike Gabriel <mike.gabriel@das-netzwerkteam.de>:
Extra info received and forwarded to list. Copy sent to git-admin@x2go.org. (Tue, 04 Dec 2012 13:00:43 GMT) (full text, mbox, link).


Message #20 received at 74@bugs.x2go.org (full text, mbox, reply):

From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
To: 74@bugs.x2go.org
Cc: 74-submitter@bugs.x2go.org, control@bugs.x2go.org
Subject: Patch applied, packages for heuler (Debian) are currently building
Date: Tue, 04 Dec 2012 13:53:44 +0100
[Message part 1 (text/plain, inline)]
tag #74 pending
thanks

Hi Arw,

the patch has been applied to nx-libs.git. Packages are currently building.

Please add the README for the keybindings to our wiki and post the  
link on the x2go-dev mailing list, so that people can start testing  
the new feature.

Ctrl-t for gnome-terminal is back,
Mike

-- 

DAS-NETZWERKTEAM
mike gabriel, rothenstein 5, 24214 neudorf-bornstein
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb
[Message part 2 (application/pgp-signature, inline)]

Added tag(s) pending. Request was from Mike Gabriel <mike.gabriel@das-netzwerkteam.de> to control@bugs.x2go.org. (Tue, 04 Dec 2012 13:00:43 GMT) (full text, mbox, link).


Message sent on to Alexander Wuerstlein <arw@arw.name>:
Bug#74. (Tue, 04 Dec 2012 13:00:43 GMT) (full text, mbox, link).


Information forwarded to x2go-dev@lists.berlios.de, git-admin@x2go.org:
Bug#74; Package nxagent. (Tue, 04 Dec 2012 15:18:01 GMT) (full text, mbox, link).


Acknowledgement sent to Mike Gabriel <mike.gabriel@das-netzwerkteam.de>:
Extra info received and forwarded to list. Copy sent to git-admin@x2go.org. (Tue, 04 Dec 2012 15:18:02 GMT) (full text, mbox, link).


Message #30 received at 74@bugs.x2go.org (full text, mbox, reply):

From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
To: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>, 74@bugs.x2go.org
Cc: 74-submitter@bugs.x2go.org, control@bugs.x2go.org
Subject: FTBFS after applying the keystrokes patch
Date: Tue, 04 Dec 2012 16:12:06 +0100
[Message part 1 (text/plain, inline)]
tag #74 -pending
thanks

Hi Alexander,

gcc -o nxagent -g -O3 -fno-strict-aliasing -ansi -Wall -Wpointer-arith  
-Wundef     -L../../exports/lib   hw/nxagent/miinitext.o                
    hw/nxagent/NXwindow.o                    hw/nxagent/NXevents.o     
                hw/nxagent/NXproperty.o                   
hw/nxagent/NXdixfonts.o                  hw/nxagent/NXglyphcurs.o       
           hw/nxagent/NXdispatch.o                   
hw/nxagent/NXrender.o                    hw/nxagent/NXglyph.o           
           hw/nxagent/NXpicture.o                    
hw/nxagent/NXextension.o                 hw/nxagent/NXglxext.o          
           hw/nxagent/NXxvdisp.o                     
hw/nxagent/NXmiglyph.o                   hw/nxagent/NXmiexpose.o        
           hw/nxagent/NXresource.o                   
hw/nxagent/NXmiwindow.o                  hw/nxagent/NXdamage.o          
  dix/libdix.a os/libos.a    hw/nxagent/libnxagent.a fb/libfb.a  
composite/libcomposite.a damageext/libdamage.a  
miext/damage/libdamage.a xfixes/libxfixes.a miext/cw/libcw.a            
  Xext/libext.a xkb/libxkb.a os/libos.a   Xi/libxinput.a               
      dbe/libdbe.a record/librecord.a  XTrap/libxtrap.a  
GL/glx/libglx.a                GL/mesa/GLcore/libGLcore.a               
   randr/librandr.a render/librender.a dix/libxpstubs.a mi/libmi.a  
composite/libcomposite.a damageext/libdamage.a  
miext/damage/libdamage.a xfixes/libxfixes.a miext/cw/libcw.a            
      Xext/libext.a xkb/libxkb.a os/libos.a   Xi/libxinput.a           
          dbe/libdbe.a record/librecord.a  XTrap/libxtrap.a  
GL/glx/libglx.a                GL/mesa/GLcore/libGLcore.a               
   randr/librandr.a render/librender.a hw/nxagent/libnxagent.a  
mi/libmi.a      ../../lib/font/libNX_Xfont.a -lNX_freetype  
dix/libxpstubs.a -L../../exports/lib   -lNX_Xext -lNX_X11 -lz -lm       
              -lNX_Xpm -L ../../../nxcomp -L ../../../nxcompext -L  
../../../nxcompshad                 -lXcomp -lXcompext -lXcompshad  
-lNX_Xrender -lNX_X11 -lNX_Xext -lNX_Xfixes                  
-L../../../nx-X11/exports/lib -lNX_Xtst -lNX_Xdamage -lNX_Xrandr  
-lNX_Xcomposite -lNX_Xinerama -lNX_Xdmcp `pkg-config --libs  
libxml-2.0` -Wl,-rpath-link,../../exports/lib
hw/nxagent/libnxagent.a(Keystroke.o): In function `parse_keystroke_file':
/var/cache/pbuilder/pbuilder-mnt/nx-libs-3.5.0.17/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c:264: undefined reference to  
`nxagentKeystrokeFile'
hw/nxagent/libnxagent.a(Keystroke.o): In function `find_keystroke':
/var/cache/pbuilder/pbuilder-mnt/nx-libs-3.5.0.17/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c:266: undefined reference to  
`nxagentKeystrokeFile'
collect2: ld returned 1 exit status
make[8]: *** [nxagent] Error 1
make[8]: Leaving directory  
`/var/cache/pbuilder/pbuilder-mnt/nx-libs-3.5.0.17/nx-X11/programs/Xserver'
make[7]: *** [all] Error 2
make[7]: Leaving directory  
`/var/cache/pbuilder/pbuilder-mnt/nx-libs-3.5.0.17/nx-X11/programs'
make[6]: *** [all] Error 2
make[6]: Leaving directory  
`/var/cache/pbuilder/pbuilder-mnt/nx-libs-3.5.0.17/nx-X11'
make[5]: *** [World] Error 2
make[5]: Leaving directory  
`/var/cache/pbuilder/pbuilder-mnt/nx-libs-3.5.0.17/nx-X11'
make[4]: *** [World] Error 2
make[4]: Leaving directory  
`/var/cache/pbuilder/pbuilder-mnt/nx-libs-3.5.0.17/nx-X11'
make[3]: *** [build-full] Error 2
make[3]: Leaving directory `/var/cache/pbuilder/pbuilder-mnt/nx-libs-3.5.0.17'
make[2]: *** [build] Error 2
make[2]: Leaving directory `/var/cache/pbuilder/pbuilder-mnt/nx-libs-3.5.0.17'
dh_auto_build: make -j1 returned exit code 2
make[1]: *** [override_dh_auto_build] Error 2
make[1]: Leaving directory `/var/cache/pbuilder/pbuilder-mnt/nx-libs-3.5.0.17'
make: *** [build] Error 2

Can you check whats happening during build of nx-libs.

Use the current master branch of nx-libs.git and run

  debuild -uc -us

on the root directory of the source tree. Your patch gets applied by  
quilt during the build process.

You can manually apply patches with

  QUILT_PATCHES=debian/patches quilt push -a

Your patch is nearly right at the end (number 302_...).

Greets,
Mike


-- 

DAS-NETZWERKTEAM
mike gabriel, rothenstein 5, 24214 neudorf-bornstein
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb
[Message part 2 (application/pgp-signature, inline)]

Removed tag(s) pending. Request was from Mike Gabriel <mike.gabriel@das-netzwerkteam.de> to control@bugs.x2go.org. (Tue, 04 Dec 2012 15:18:02 GMT) (full text, mbox, link).


Message sent on to Alexander Wuerstlein <arw@arw.name>:
Bug#74. (Tue, 04 Dec 2012 15:18:02 GMT) (full text, mbox, link).


Information forwarded to x2go-dev@lists.berlios.de, git-admin@x2go.org:
Bug#74; Package nxagent. (Wed, 05 Dec 2012 23:03:02 GMT) (full text, mbox, link).


Acknowledgement sent to Alexander Wuerstlein <arw@arw.name>:
Extra info received and forwarded to list. Copy sent to git-admin@x2go.org. (Wed, 05 Dec 2012 23:03:02 GMT) (full text, mbox, link).


Message #40 received at 74@bugs.x2go.org (full text, mbox, reply):

From: Alexander Wuerstlein <arw@arw.name>
To: 74@bugs.x2go.org
Cc: Alexander Wuerstlein <arw@arw.name>
Subject: [PATCH] Fix build error caused by patch for #74 (missing nxagentKeystrokeFile)
Date: Thu, 6 Dec 2012 00:02:47 +0100
Adds command line argument -keystrokefile to nxagent which fills
the nxagentKeystrokeFile variable
---
 .../302_nxagent_configurable-keystrokes.full.patch |   42 ++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/debian/patches/302_nxagent_configurable-keystrokes.full.patch b/debian/patches/302_nxagent_configurable-keystrokes.full.patch
index fb74739..8fb34df 100644
--- a/debian/patches/302_nxagent_configurable-keystrokes.full.patch
+++ b/debian/patches/302_nxagent_configurable-keystrokes.full.patch
@@ -987,3 +987,45 @@ Description: Make nxagent-specific keyboard bindings configurable
 +regions_on_screen
 +test_input
 +deactivate_input_devices_grab
+--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c
++++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c
+@@ -148,6 +148,8 @@
+ 
+ char nxagentVerbose = 0;
+ 
++char *nxagentKeystrokeFile = NULL;
++
+ int ddxProcessArgument(int argc, char *argv[], int i)
+ {
+   /*
+@@ -1021,6 +1023,20 @@
+     return 1;
+   }
+ 
++  if (!strcmp(argv[i], "-keystrokefile"))
++  {
++    if (i + 1 < argc)
++    {
++      if (NULL != (nxagentKeystrokeFile = strdup(argv[i + 1])))
++      {
++        return 2;
++      } else {
++	FatalError("malloc failed");
++      }
++    }
++    return 0;
++  }
++
+   return 0;
+ }
+
+--- a/nx-X11/programs/Xserver/hw/nxagent/Args.h
++++ b/nx-X11/programs/Xserver/hw/nxagent/Args.h
+@@ -83,4 +83,6 @@
+ 
+ extern int nxagentRemoteMajor;
+ 
++extern char *nxagentKeystrokeFile;
++
+ #endif /* __Args_H__ */
+
-- 
1.7.10.4


Information forwarded to x2go-dev@lists.berlios.de, git-admin@x2go.org:
Bug#74; Package nxagent. (Thu, 06 Dec 2012 08:51:41 GMT) (full text, mbox, link).


Acknowledgement sent to Mike Gabriel <mike.gabriel@das-netzwerkteam.de>:
Extra info received and forwarded to list. Copy sent to git-admin@x2go.org. (Thu, 06 Dec 2012 08:51:41 GMT) (full text, mbox, link).


Message #45 received at 74@bugs.x2go.org (full text, mbox, reply):

From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
To: Alexander Wuerstlein <arw@arw.name>, 74@bugs.x2go.org
Cc: control@bugs.x2go.org
Subject: Re: [X2Go-Dev] Bug#74: Fix build error caused by patch for #74 (missing nxagentKeystrokeFile)
Date: Thu, 06 Dec 2012 09:50:49 +0100
[Message part 1 (text/plain, inline)]
tag #74 pending
thanks

THANKS!
Committed:
http://code.x2go.org/gitweb?p=nx-libs.git;a=commitdiff;h=26901cc52224dbfbf308b9252640563e4b52e960

Package seems to build fine now.
Thanks for the quick response!!!

Mike

On Do 06 Dez 2012 00:02:47 CET Alexander Wuerstlein wrote:

> Adds command line argument -keystrokefile to nxagent which fills
> the nxagentKeystrokeFile variable
> ---
>  .../302_nxagent_configurable-keystrokes.full.patch |   42  
> ++++++++++++++++++++
>  1 file changed, 42 insertions(+)
>
> diff --git  
> a/debian/patches/302_nxagent_configurable-keystrokes.full.patch  
> b/debian/patches/302_nxagent_configurable-keystrokes.full.patch
> index fb74739..8fb34df 100644
> --- a/debian/patches/302_nxagent_configurable-keystrokes.full.patch
> +++ b/debian/patches/302_nxagent_configurable-keystrokes.full.patch
> @@ -987,3 +987,45 @@ Description: Make nxagent-specific keyboard  
> bindings configurable
>  +regions_on_screen
>  +test_input
>  +deactivate_input_devices_grab
> +--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c
> ++++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c
> +@@ -148,6 +148,8 @@
> +
> + char nxagentVerbose = 0;
> +
> ++char *nxagentKeystrokeFile = NULL;
> ++
> + int ddxProcessArgument(int argc, char *argv[], int i)
> + {
> +   /*
> +@@ -1021,6 +1023,20 @@
> +     return 1;
> +   }
> +
> ++  if (!strcmp(argv[i], "-keystrokefile"))
> ++  {
> ++    if (i + 1 < argc)
> ++    {
> ++      if (NULL != (nxagentKeystrokeFile = strdup(argv[i + 1])))
> ++      {
> ++        return 2;
> ++      } else {
> ++	FatalError("malloc failed");
> ++      }
> ++    }
> ++    return 0;
> ++  }
> ++
> +   return 0;
> + }
> +
> +--- a/nx-X11/programs/Xserver/hw/nxagent/Args.h
> ++++ b/nx-X11/programs/Xserver/hw/nxagent/Args.h
> +@@ -83,4 +83,6 @@
> +
> + extern int nxagentRemoteMajor;
> +
> ++extern char *nxagentKeystrokeFile;
> ++
> + #endif /* __Args_H__ */
> +
> --
> 1.7.10.4
> _______________________________________________
> X2Go-Dev mailing list
> X2Go-Dev@lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/x2go-dev
>



-- 

DAS-NETZWERKTEAM
mike gabriel, rothenstein 5, 24214 neudorf-bornstein
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb
[Message part 2 (application/pgp-signature, inline)]

Added tag(s) pending. Request was from Mike Gabriel <mike.gabriel@das-netzwerkteam.de> to control@bugs.x2go.org. (Thu, 06 Dec 2012 08:51:42 GMT) (full text, mbox, link).


Bug reassigned from package 'nxagent' to 'x2goagent'. Request was from Reinhard Tartler <siretart@gmail.com> to control@bugs.x2go.org. (Thu, 06 Dec 2012 14:33:01 GMT) (full text, mbox, link).


Information forwarded to x2go-dev@lists.berlios.de, X2Go Developers <x2go-dev@lists.berlios.de>:
Bug#74; Package x2goagent. (Wed, 09 Jan 2013 11:45:56 GMT) (full text, mbox, link).


Acknowledgement sent to Mike Gabriel <mike.gabriel@das-netzwerkteam.de>:
Extra info received and forwarded to list. Copy sent to X2Go Developers <x2go-dev@lists.berlios.de>. (Wed, 09 Jan 2013 11:45:56 GMT) (full text, mbox, link).


Message #54 received at 74@bugs.x2go.org (full text, mbox, reply):

From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
To: 74@bugs.x2go.org
Cc: control@bugs.x2go.org
Subject: Solved with release nx-libs 3.5.0.17
Date: Wed, 09 Jan 2013 12:37:11 +0100
[Message part 1 (text/plain, inline)]
close #74
thanks

This issue has been solved with nx-libs 3.5.0.17.

light+love
Mike

-- 

DAS-NETZWERKTEAM
mike gabriel, rothenstein 5, 24214 neudorf-bornstein
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb
[Message part 2 (application/pgp-signature, inline)]

Marked Bug as done Request was from Mike Gabriel <mike.gabriel@das-netzwerkteam.de> to control@bugs.x2go.org. (Wed, 09 Jan 2013 11:45:58 GMT) (full text, mbox, link).


Notification sent to Alexander Wuerstlein <arw@arw.name>:
Bug acknowledged by developer. (Wed, 09 Jan 2013 11:45:58 GMT) (full text, mbox, link).


Bug archived. Request was from Debbugs Internal Request <git-admin@x2go.org> to internal_control@bugs.x2go.org. (Thu, 07 Feb 2013 06:24:01 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


X2Go Developers <owner@bugs.x2go.org>. Last modified: Wed May 1 22:28:14 2024; Machine Name: ymir.das-netzwerkteam.de

X2Go Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.