Commit d5c9733b authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

nxagent: simplify keycode conversion setup

parent 1d6c241d
...@@ -1691,10 +1691,14 @@ void nxagentWriteKeyboardFile(char *rules, char *model, char *layout, char *vari ...@@ -1691,10 +1691,14 @@ void nxagentWriteKeyboardFile(char *rules, char *model, char *layout, char *vari
void nxagentKeycodeConversionSetup(void) void nxagentKeycodeConversionSetup(void)
{ {
nxagentKeycodeConversion = False;
if (nxagentXkbInfo.Opcode == -1)
return;
if (nxagentOption(KeycodeConversion) == KeycodeConversionOff) if (nxagentOption(KeycodeConversion) == KeycodeConversionOff)
{ {
fprintf(stderr, "Info: Keycode conversion is off\n"); fprintf(stderr, "Info: Keycode conversion is off\n");
nxagentKeycodeConversion = False;
} }
else if (nxagentOption(KeycodeConversion) == KeycodeConversionOn) else if (nxagentOption(KeycodeConversion) == KeycodeConversionOn)
{ {
...@@ -1721,23 +1725,10 @@ void nxagentKeycodeConversionSetup(void) ...@@ -1721,23 +1725,10 @@ void nxagentKeycodeConversionSetup(void)
#endif #endif
fprintf(stderr, "Info: Keycode conversion auto-determined as off\n"); fprintf(stderr, "Info: Keycode conversion auto-determined as off\n");
nxagentKeycodeConversion = False;
} }
} }
} }
void nxagentResetKeycodeConversion(void)
{
if (nxagentXkbInfo.Opcode != -1)
{
nxagentKeycodeConversionSetup();
}
else
{
nxagentKeycodeConversion = False;
}
}
Bool nxagentGetRemoteXkbExtension(void) Bool nxagentGetRemoteXkbExtension(void)
{ {
Bool result; Bool result;
......
...@@ -117,7 +117,7 @@ void nxagentEnableXkbExtension(void); ...@@ -117,7 +117,7 @@ void nxagentEnableXkbExtension(void);
void nxagentTuneXkbWrapper(void); void nxagentTuneXkbWrapper(void);
void nxagentResetKeycodeConversion(void); void nxagentKeycodeConversionSetup(void);
Bool nxagentGetRemoteXkbExtension(void); Bool nxagentGetRemoteXkbExtension(void);
#endif #endif
......
...@@ -620,7 +620,7 @@ Bool nxagentReconnectSession(void) ...@@ -620,7 +620,7 @@ Bool nxagentReconnectSession(void)
} }
else else
{ {
nxagentResetKeycodeConversion(); nxagentKeycodeConversionSetup();
} }
nxagentXkbState.Initialized = 0; nxagentXkbState.Initialized = 0;
......
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