diff options
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Reconnect.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 48 |
1 files changed, 22 insertions, 26 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index e29fc3200..5ff0c6506 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -458,15 +458,6 @@ Bool nxagentReconnectSession(void) nxagentProcessOptions(nxagentOptionsFilenameOrString); - if (nxagentKeyboard && (strcmp(nxagentKeyboard, "null/null") == 0)) - { - #ifdef TEST - fprintf(stderr, "nxagentReconnect: changing nxagentKeyboard from [null/null] to [clone].\n"); - #endif - - SAFE_free(nxagentKeyboard); - nxagentKeyboard = strdup("clone"); - } if (nxagentReconnectDisplay(reconnectLossyLevel[DISPLAY_STEP]) == 0) { @@ -608,29 +599,34 @@ Bool nxagentReconnectSession(void) nxagentOldKeyboard = NULL; } - if (nxagentOption(ResetKeyboardAtResume) == 1 && - (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL || - strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 || - strcmp(nxagentKeyboard, "query") == 0 || - strcmp(nxagentKeyboard, "clone") == 0)) + /* Reset the keyboard only if we detect any changes. */ + if (nxagentOption(ResetKeyboardAtResume) == 1) { - if (nxagentResetKeyboard() == 0) + if (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL || + strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 || + strcmp(nxagentKeyboard, "query") == 0 || + strcmp(nxagentKeyboard, "clone") == 0) { - #ifdef WARNING - if (nxagentVerbose == 1) + if (nxagentResetKeyboard() == 0) { - fprintf(stderr, "nxagentReconnectSession: Failed to reset keyboard device.\n"); - } - #endif + #ifdef WARNING + if (nxagentVerbose == 1) + { + fprintf(stderr, "%s: Failed to reset keyboard device.\n", __func__); + } + #endif - failedStep = WINDOW_STEP; + failedStep = WINDOW_STEP; - goto nxagentReconnectError; + goto nxagentReconnectError; + } + } + else + { + #ifdef DEBUG + fprintf(stderr, "%s: keyboard unchanged - skipping keyboard reset.\n", __func__); + #endif } - } - else - { - nxagentKeycodeConversionSetup(); } nxagentXkbState.Initialized = 0; |