[X2Go-Commits] [nx-libs] 17/30: hw/nxagent/Keyboard.c: Drop support for loading XKB config from file.

git-admin at x2go.org git-admin at x2go.org
Tue Jul 3 22:24:04 CEST 2018


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 cc27ebb2558770f97448e38cc3f017b60f02d6b8
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Thu Feb 16 21:16:50 2017 +0000

    hw/nxagent/Keyboard.c: Drop support for loading XKB config from file.
    
     * Support for XkbCF has been dropped in XKB extension by X.org
     * Has never been used in recent NXv3 implementations (e.g. X2Go)
     * Config file parsing is error prone, use setxkbmap API instead
---
 nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 104 ++------------------------
 1 file changed, 7 insertions(+), 97 deletions(-)

diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
index 51a11b4..5454081 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
@@ -884,11 +884,6 @@ XkbError:
 
 #ifdef XKB
       } else { /* if (noXkbExtension) */
-        FILE *file;
-        XkbConfigRtrnRec config;
-
-        char *nxagentXkbConfigFilePath;
-
         XkbComponentNamesRec names = {0};
         char *rules, *variants, *options;
 
@@ -1035,108 +1030,23 @@ XkbError:
 
         XkbGetControls(nxagentDisplay, XkbAllControlsMask, xkb);
 
-        if (nxagentX2go)
-          nxagentXkbConfigFilePath = strdup(XKB_CONFIG_FILE_X2GO);
-        else
-          nxagentXkbConfigFilePath = strdup(XKB_CONFIG_FILE_NX);
-
-        if (!nxagentXkbConfigFilePath)
-        {
-          FatalError("nxagentKeyboardProc: malloc failed.");
-        }
-
-        #ifdef TEST
-        fprintf(stderr, "nxagentKeyboardProc: nxagentXkbConfigFilePath [%s].\n",
-                    nxagentXkbConfigFilePath);
-        #endif
-
-        if ((file = fopen(nxagentXkbConfigFilePath, "r"))) {
-
-          #ifdef TEST
-          fprintf(stderr, "nxagentKeyboardProc: Going to parse config file.\n");
-          #endif
-
-          if (XkbCFParse(file, XkbCFDflts, xkb, &config) == 0) {
-            ErrorF("Error parsing config file.\n");
-
-            free(nxagentXkbConfigFilePath);
-            nxagentXkbConfigFilePath = NULL;
-
-            fclose(file);
-            goto XkbError;
-          }
-          if (config.rules_file)
-            rules = config.rules_file;
-          if (config.model)
-          {
-            if (free_model)
-            {
-              free_model = 0; 
-              free(model);
-            }
-            model = config.model;
-          }
-          if (config.layout)
-          {
-            if (free_layout)
-            {
-              free_layout = 0;
-              free(layout);
-            }
-            layout = config.layout;
-          }
-          if (config.variant)
-            variants = config.variant;
-          if (config.options)
-            options = config.options;
-
-          free(nxagentXkbConfigFilePath);
-          nxagentXkbConfigFilePath = NULL;
-
-          fclose(file);
-        }
-        else
-        {
-          #ifdef TEST
-          fprintf(stderr, "nxagentKeyboardProc: No config file, going to set rules and init device.\n");
-          #endif
-          #ifdef DEBUG
-          fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device: "
-                          "[rules='%s',model='%s',layout='%s',variants='%s',options='%s'].\n",
-                          rules, model, layout, variants, options);
-          #endif
-
-          XkbSetRulesDflts(rules, model, layout, variants, options);
-          XkbInitKeyboardDeviceStruct((void *)pDev, &names, &keySyms, modmap,
-                                          nxagentBell, nxagentChangeKeyboardControl);
-
-          free(nxagentXkbConfigFilePath);
-          nxagentXkbConfigFilePath = NULL;
-
-          if (!nxagentKeyboard || strcmp(nxagentKeyboard, "query") == 0)
-          {
-            goto XkbError;
-          }
-
-          goto XkbEnd;
-        }
-
-        #ifdef TEST
-        fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device.\n");
-        #endif
         #ifdef DEBUG
         fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device: "
                         "[rules='%s',model='%s',layout='%s',variants='%s',options='%s'].\n",
-                          rules, model, layout, variants, options);
+                        rules, model, layout, variants, options);
         #endif
 
         XkbSetRulesDflts(rules, model, layout, variants, options);
         XkbInitKeyboardDeviceStruct((void *)pDev, &names, &keySyms, modmap,
                                     nxagentBell, nxagentChangeKeyboardControl);
-        XkbDDXChangeControls((void *)pDev, xkb->ctrls, xkb->ctrls);
 
-XkbEnd:
+        if (!nxagentKeyboard ||
+               (nxagentKeyboard && (strcmp(nxagentKeyboard, "query") == 0)))
+        {
+          goto XkbError;
+        }
 
+XkbEnd:
         if (nxagentOption(Shadow) == 1 && pDev && pDev->key)
         {
           NXShadowInitKeymap(&(pDev->key->curKeySyms));

--
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