diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-02-16 21:16:50 +0000 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-07-03 16:29:16 +0200 |
commit | cc27ebb2558770f97448e38cc3f017b60f02d6b8 (patch) | |
tree | f63489b5af204f67b22af5c493a7c22cda77324a /nx-X11/programs/Xserver/hw | |
parent | b1e4d6e849c54b61fe1c7de0cde58394225d20bf (diff) | |
download | nx-libs-cc27ebb2558770f97448e38cc3f017b60f02d6b8.tar.gz nx-libs-cc27ebb2558770f97448e38cc3f017b60f02d6b8.tar.bz2 nx-libs-cc27ebb2558770f97448e38cc3f017b60f02d6b8.zip |
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
Diffstat (limited to 'nx-X11/programs/Xserver/hw')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 104 |
1 files 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 51a11b4f4..545408146 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)); |