Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
60e0566d
Unverified
Commit
60e0566d
authored
Jan 05, 2020
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/fix_keyconv_on_reconnect' into 3.6.x
Attributes GH PR #887:
https://github.com/ArcticaProject/nx-libs/pull/887
parents
cf24c658
6f390f82
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
28 deletions
+70
-28
Args.c
nx-X11/programs/Xserver/hw/nxagent/Args.c
+60
-14
Keyboard.c
nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
+0
-0
Reconnect.c
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
+10
-14
No files found.
nx-X11/programs/Xserver/hw/nxagent/Args.c
View file @
60e0566d
...
@@ -687,7 +687,20 @@ int ddxProcessArgument(int argc, char *argv[], int i)
...
@@ -687,7 +687,20 @@ int ddxProcessArgument(int argc, char *argv[], int i)
{
{
SAFE_free
(
nxagentKeyboard
);
SAFE_free
(
nxagentKeyboard
);
if
(
nxagentX2go
&&
strcmp
(
argv
[
i
],
"null/null"
)
==
0
)
{
#ifdef TEST
fprintf
(
stderr
,
"%s: changing nxagentKeyboard from [null/null] to [clone].
\n
"
,
__func__
);
#endif
SAFE_free
(
nxagentKeyboard
);
nxagentKeyboard
=
strdup
(
"clone"
);
}
else
{
nxagentKeyboard
=
strdup
(
argv
[
i
]);
nxagentKeyboard
=
strdup
(
argv
[
i
]);
}
if
(
nxagentKeyboard
==
NULL
)
if
(
nxagentKeyboard
==
NULL
)
{
{
FatalError
(
"malloc failed"
);
FatalError
(
"malloc failed"
);
...
@@ -1489,27 +1502,36 @@ static void nxagentParseOptionString(char *string)
...
@@ -1489,27 +1502,36 @@ static void nxagentParseOptionString(char *string)
char
*
option
=
NULL
;
char
*
option
=
NULL
;
/*
/*
* we must not modify string, but strtok will insert \0. So let's
* work with a copy
*/
char
*
dup
=
strdup
(
string
);
/*
* Remove the port specification.
* Remove the port specification.
*/
*/
char
*
delimiter
=
rindex
(
string
,
':'
);
char
*
delimiter
=
rindex
(
dup
,
':'
);
if
(
delimiter
)
if
(
delimiter
)
{
{
*
delimiter
=
0
;
#ifdef DEBUG
fprintf
(
stderr
,
"%s: stripping port specification [%s]
\n
"
,
__func__
,
delimiter
);
#endif
*
delimiter
=
'\0'
;
}
}
else
else
{
{
fprintf
(
stderr
,
"Warning: Option file doesn't contain a port specification.
\n
"
);
fprintf
(
stderr
,
"Warning: Option file doesn't contain a port specification.
\n
"
);
}
}
while
((
option
=
strtok
(
option
?
NULL
:
string
,
","
)))
while
((
option
=
strtok
(
option
?
NULL
:
dup
,
","
)))
{
{
delimiter
=
rindex
(
option
,
'='
);
delimiter
=
rindex
(
option
,
'='
);
if
(
delimiter
)
if
(
delimiter
)
{
{
*
delimiter
=
0
;
*
delimiter
=
'\0'
;
value
=
delimiter
+
1
;
value
=
delimiter
+
1
;
}
}
else
else
...
@@ -1519,6 +1541,31 @@ static void nxagentParseOptionString(char *string)
...
@@ -1519,6 +1541,31 @@ static void nxagentParseOptionString(char *string)
nxagentParseSingleOption
(
option
,
value
);
nxagentParseSingleOption
(
option
,
value
);
}
}
SAFE_free
(
dup
);
}
char
*
nxagentSkipNXMarker
(
char
*
string
)
{
if
(
strncasecmp
(
string
,
"nx/nx,"
,
6
)
==
0
||
strncasecmp
(
string
,
"nx/nx:"
,
6
)
==
0
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: skipping [%6.6s]
\n
"
,
__func__
,
string
);
#endif
return
string
+
6
;
}
else
if
(
strncasecmp
(
string
,
"nx,"
,
3
)
==
0
||
strncasecmp
(
string
,
"nx:"
,
3
)
==
0
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: skipping [%3.3s]
\n
"
,
__func__
,
string
);
#endif
return
string
+
3
;
}
else
{
return
string
;
}
}
}
void
nxagentProcessOptions
(
char
*
string
)
void
nxagentProcessOptions
(
char
*
string
)
...
@@ -1533,15 +1580,10 @@ void nxagentProcessOptions(char * string)
...
@@ -1533,15 +1580,10 @@ void nxagentProcessOptions(char * string)
/* if the "filename" starts with an nx marker treat it
/* if the "filename" starts with an nx marker treat it
as an option _string_ instead of a filename */
as an option _string_ instead of a filename */
if
(
strncasecmp
(
string
,
"nx/nx,"
,
6
)
==
0
||
char
*
skipped
=
nxagentSkipNXMarker
(
string
);
strncasecmp
(
string
,
"nx/nx:"
,
6
)
==
0
)
if
(
skipped
!=
string
)
{
nxagentParseOptionString
(
string
+
6
);
}
else
if
(
strncasecmp
(
string
,
"nx,"
,
3
)
==
0
||
strncasecmp
(
string
,
"nx:"
,
3
)
==
0
)
{
{
nxagentParseOptionString
(
s
tring
+
3
);
nxagentParseOptionString
(
s
kipped
);
}
}
else
else
{
{
...
@@ -1650,9 +1692,13 @@ void nxagentProcessOptionsFile(char * filename)
...
@@ -1650,9 +1692,13 @@ void nxagentProcessOptionsFile(char * filename)
for
(
offset
=
0
;
(
offset
<
sizeOfFile
)
&&
(
data
[
offset
]
!=
'\n'
);
offset
++
);
for
(
offset
=
0
;
(
offset
<
sizeOfFile
)
&&
(
data
[
offset
]
!=
'\n'
);
offset
++
);
data
[
offset
]
=
0
;
data
[
offset
]
=
'\0'
;
#ifdef DEBUG
fprintf
(
stderr
,
"%s: first line of options file [%s]
\n
"
,
__func__
,
data
);
#endif
nxagentParseOptionString
(
data
);
nxagentParseOptionString
(
nxagentSkipNXMarker
(
data
)
);
nxagentProcessOptionsFileExit:
nxagentProcessOptionsFileExit:
...
...
nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
View file @
60e0566d
This diff is collapsed.
Click to expand it.
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
View file @
60e0566d
...
@@ -458,15 +458,6 @@ Bool nxagentReconnectSession(void)
...
@@ -458,15 +458,6 @@ Bool nxagentReconnectSession(void)
nxagentProcessOptions
(
nxagentOptionsFilenameOrString
);
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
)
if
(
nxagentReconnectDisplay
(
reconnectLossyLevel
[
DISPLAY_STEP
])
==
0
)
{
{
...
@@ -608,18 +599,20 @@ Bool nxagentReconnectSession(void)
...
@@ -608,18 +599,20 @@ Bool nxagentReconnectSession(void)
nxagentOldKeyboard
=
NULL
;
nxagentOldKeyboard
=
NULL
;
}
}
if
(
nxagentOption
(
ResetKeyboardAtResume
)
==
1
&&
/* Reset the keyboard only if we detect any changes. */
(
nxagentKeyboard
==
NULL
||
nxagentOldKeyboard
==
NULL
||
if
(
nxagentOption
(
ResetKeyboardAtResume
)
==
1
)
{
if
(
nxagentKeyboard
==
NULL
||
nxagentOldKeyboard
==
NULL
||
strcmp
(
nxagentKeyboard
,
nxagentOldKeyboard
)
!=
0
||
strcmp
(
nxagentKeyboard
,
nxagentOldKeyboard
)
!=
0
||
strcmp
(
nxagentKeyboard
,
"query"
)
==
0
||
strcmp
(
nxagentKeyboard
,
"query"
)
==
0
||
strcmp
(
nxagentKeyboard
,
"clone"
)
==
0
)
)
strcmp
(
nxagentKeyboard
,
"clone"
)
==
0
)
{
{
if
(
nxagentResetKeyboard
()
==
0
)
if
(
nxagentResetKeyboard
()
==
0
)
{
{
#ifdef WARNING
#ifdef WARNING
if
(
nxagentVerbose
==
1
)
if
(
nxagentVerbose
==
1
)
{
{
fprintf
(
stderr
,
"nxagentReconnectSession: Failed to reset keyboard device.
\n
"
);
fprintf
(
stderr
,
"%s: Failed to reset keyboard device.
\n
"
,
__func__
);
}
}
#endif
#endif
...
@@ -630,7 +623,10 @@ Bool nxagentReconnectSession(void)
...
@@ -630,7 +623,10 @@ Bool nxagentReconnectSession(void)
}
}
else
else
{
{
nxagentKeycodeConversionSetup
();
#ifdef DEBUG
fprintf
(
stderr
,
"%s: keyboard unchanged - skipping keyboard reset.
\n
"
,
__func__
);
#endif
}
}
}
nxagentXkbState
.
Initialized
=
0
;
nxagentXkbState
.
Initialized
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment