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
7f4b50de
Unverified
Commit
7f4b50de
authored
Aug 16, 2019
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/no_keystroke_passthrough' into 3.6.x
Attributes GH PR #823:
https://github.com/ArcticaProject/nx-libs/pull/823
parents
360cb5dd
ceeb53f0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
8 deletions
+31
-8
Events.c
nx-X11/programs/Xserver/hw/nxagent/Events.c
+27
-7
Keystroke.c
nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
+4
-1
No files found.
nx-X11/programs/Xserver/hw/nxagent/Events.c
View file @
7f4b50de
...
...
@@ -1113,8 +1113,8 @@ FIXME: If we don't flush the queue here, it could happen
/*
FIXME: Don't enqueue the KeyRelease event if the key was
not already pressed. This workaround avoids a fake
KeyPress
is
enqueued by the XKEYBOARD extension.
Another solution would be to let the events
are
KeyPress
being
enqueued by the XKEYBOARD extension.
Another solution would be to let the events
enqueued and to remove the KeyPress afterwards.
*/
if
(
BitIsOn
(
inputInfo
.
keyboard
->
key
->
down
,
...
...
@@ -1153,6 +1153,9 @@ FIXME: Don't enqueue the KeyRelease event if the key was
nxagentXkbNumTrap
=
0
;
}
/* Calculate the time elapsed between this and the last event we
received. Add this delta to time we recorded for the last
KeyPress event we passed on to our clients. */
memset
(
&
x
,
0
,
sizeof
(
xEvent
));
x
.
u
.
u
.
type
=
KeyRelease
;
x
.
u
.
u
.
detail
=
nxagentConvertKeycode
(
X
.
xkey
.
keycode
);
...
...
@@ -1168,8 +1171,14 @@ FIXME: Don't enqueue the KeyRelease event if the key was
x
.
u
.
keyButtonPointer
.
time
=
nxagentLastEventTime
;
}
if
(
!
(
nxagentCheckSpecialKeystroke
(
&
X
.
xkey
,
&
result
))
&&
sendKey
==
1
)
/* do not send a KeyRelease for a special keystroke since we
also did not send a KeyPress event in that case */
if
(
!
(
nxagentCheckSpecialKeystroke
(
&
X
.
xkey
,
&
result
))
&&
(
sendKey
==
1
))
{
#ifdef TEST
fprintf
(
stderr
,
"%s: passing KeyRelease event to clients
\n
"
,
__func__
);
#endif
mieqEnqueue
(
&
x
);
CriticalOutputPending
=
1
;
...
...
@@ -1181,6 +1190,12 @@ FIXME: Don't enqueue the KeyRelease event if the key was
NXShadowEvent
(
nxagentDisplay
,
X
);
}
}
else
{
#ifdef TEST
fprintf
(
stderr
,
"%s: NOT passing KeyRelease event to clients
\n
"
,
__func__
);
#endif
}
break
;
}
...
...
@@ -2225,8 +2240,6 @@ FIXME: Don't enqueue the KeyRelease event if the key was
int
nxagentHandleKeyPress
(
XEvent
*
X
,
enum
HandleEventResult
*
result
)
{
xEvent
x
;
if
(
nxagentXkbState
.
Initialized
==
0
)
{
if
(
X
->
xkey
.
keycode
==
nxagentCapsLockKeycode
)
...
...
@@ -2246,6 +2259,9 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result)
if
(
nxagentCheckSpecialKeystroke
(
&
X
->
xkey
,
result
))
{
#ifdef TEST
fprintf
(
stderr
,
"%s: NOT passing KeyPress event to clients
\n
"
,
__func__
);
#endif
return
1
;
}
...
...
@@ -2258,14 +2274,18 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result)
nxagentXkbState
.
Num
=
(
~
nxagentXkbState
.
Num
&
1
);
}
nxagentLastServerTime
=
X
->
xkey
.
time
;
nxagentLastEventTime
=
nxagentLastKeyPressTime
=
GetTimeInMillis
();
memset
(
&
x
,
0
,
sizeof
(
xEvent
))
;
xEvent
x
=
{
0
}
;
x
.
u
.
u
.
type
=
KeyPress
;
x
.
u
.
u
.
detail
=
nxagentConvertKeycode
(
X
->
xkey
.
keycode
);
x
.
u
.
keyButtonPointer
.
time
=
nxagentLastKeyPressTime
;
nxagentLastServerTime
=
X
->
xkey
.
time
;
#ifdef TEST
fprintf
(
stderr
,
"%s: passing KeyPress event to clients
\n
"
,
__func__
);
#endif
mieqEnqueue
(
&
x
);
...
...
nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
View file @
7f4b50de
...
...
@@ -480,6 +480,9 @@ static enum nxagentSpecialKeystroke find_keystroke(XKeyEvent *X)
return
ret
;
}
/*
* returns True if a special keystroke has been pressed. *result will contain the action.
*/
Bool
nxagentCheckSpecialKeystroke
(
XKeyEvent
*
X
,
enum
HandleEventResult
*
result
)
{
enum
nxagentSpecialKeystroke
stroke
=
find_keystroke
(
X
);
...
...
@@ -629,5 +632,5 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
case
KEYSTROKE_MAX
:
break
;
}
return
(
*
result
=
=
doNothing
);
return
(
*
result
!
=
doNothing
);
}
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