Commit 05e03b96 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

Keyboard.c: greatly simplify the code in nxagentKeyboardProc

most of the code was existing twice
parent d8bbbcf2
...@@ -828,20 +828,17 @@ XkbError: ...@@ -828,20 +828,17 @@ XkbError:
nxagentKeycodeConversionSetup(); nxagentKeycodeConversionSetup();
if (xkb == NULL || xkb->geom == NULL) if (xkb && xkb->geom)
{ {
#ifdef TEST XkbGetControls(nxagentDisplay, XkbAllControlsMask, xkb);
fprintf(stderr, "nxagentKeyboardProc: No current keyboard.\n");
if (xkb == NULL)
{
fprintf(stderr, "nxagentKeyboardProc: xkb is null.\n");
} }
#ifdef TEST
else else
{ {
fprintf(stderr, "nxagentKeyboardProc: xkb->geom is null.\n"); fprintf(stderr, "nxagentKeyboardProc: No current keyboard.\n");
} }
fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device.\n"); #endif
#endif
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device: " fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device: "
"[rules='%s',model='%s',layout='%s',variants='%s',options='%s'].\n", "[rules='%s',model='%s',layout='%s',variants='%s',options='%s'].\n",
...@@ -857,24 +854,9 @@ XkbError: ...@@ -857,24 +854,9 @@ XkbError:
goto XkbError; goto XkbError;
} }
goto XkbEnd; if (xkb && xkb->geom)
}
XkbGetControls(nxagentDisplay, XkbAllControlsMask, xkb);
#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);
if (!nxagentKeyboard || strcmp(nxagentKeyboard, "query") == 0)
{ {
goto XkbError; XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls);
} }
if (nxagentOption(Shadow) == 1 && pDev && pDev->key) if (nxagentOption(Shadow) == 1 && pDev && pDev->key)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment