aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2020-01-03 01:01:24 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-01-05 21:44:12 +0100
commit6f390f8207689b1b807048ef39ca956978472e32 (patch)
tree5aca8094bfae80ef11b9e887133c0140a01c4e87 /nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
parenta59020b1d4c7a7b23cae328067b589a2aa1d787f (diff)
downloadnx-libs-6f390f8207689b1b807048ef39ca956978472e32.tar.gz
nx-libs-6f390f8207689b1b807048ef39ca956978472e32.tar.bz2
nx-libs-6f390f8207689b1b807048ef39ca956978472e32.zip
nxagent: remove additional keyboard handling from Reconnect.c
At reconnect we check if a keyboard reset is required. If so, we are calling the corresponding code from Keyboard.c. No explicit keyboard code in Reconnect.c required. fixes ArcticaProject/nx-libs#886
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Reconnect.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Reconnect.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
index 69a3011f9..5ff0c6506 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
@@ -599,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;