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
fc05e5e0
You need to sign in or sign up before continuing.
Commit
fc05e5e0
authored
Oct 10, 2011
by
Reinhard Tartler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Imported nxagent-3.3.0-13.tar.gz
Summary: Imported nxagent-3.3.0-13.tar.gz Keywords: Imported nxagent-3.3.0-13.tar.gz into Git repository
parent
1a74e032
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
540 additions
and
2 deletions
+540
-2
CHANGELOG
nx-X11/programs/Xserver/hw/nxagent/CHANGELOG
+24
-0
Events.c
nx-X11/programs/Xserver/hw/nxagent/Events.c
+181
-0
Handlers.c
nx-X11/programs/Xserver/hw/nxagent/Handlers.c
+23
-0
Keystroke.c
nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
+53
-0
Options.c
nx-X11/programs/Xserver/hw/nxagent/Options.c
+5
-0
Options.h
nx-X11/programs/Xserver/hw/nxagent/Options.h
+2
-0
Reconnect.c
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
+8
-0
Screen.c
nx-X11/programs/Xserver/hw/nxagent/Screen.c
+19
-2
Screen.h
nx-X11/programs/Xserver/hw/nxagent/Screen.h
+3
-0
Window.c
nx-X11/programs/Xserver/hw/nxagent/Window.c
+2
-0
NXdispatch.c
nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c
+4
-0
NXdispatch.c.NX.original
...11/programs/Xserver/hw/nxagent/X/NXdispatch.c.NX.original
+4
-0
NXevents.c
nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c
+106
-0
NXevents.c.NX.original
nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original
+106
-0
No files found.
nx-X11/programs/Xserver/hw/nxagent/CHANGELOG
View file @
fc05e5e0
ChangeLog:
nxagent-3.3.0-13
- Handle the window unmap immediately. Don't add it to the configure
queue.
nxagent-3.3.0-12
- Fixed TR03G02200. Timestamps could be in the future in KeyRelease
events sent to the X clients.
- Added debug logging of input devices state Logging can be enabled
or disabled via the Ctrl+Alt+x shortcut. State info is dumped every
5 seconds.
- Added Ctrl+Alt+y shortcut used to deactivate input devices grab for
debug purposes.
nxagent-3.3.0-11
- Changed the message logging the screen size changes, in order to
show the fullscreen state.
- Handle the window unmapping in the nxagentConfigureWindow queue.
nxagent-3.3.0-10
- Fixed TR12F02146. Compare the drawable and the bitmap data before
...
...
nx-X11/programs/Xserver/hw/nxagent/Events.c
View file @
fc05e5e0
...
...
@@ -803,6 +803,11 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
nxagentLastEventTime
=
GetTimeInMillis
();
if
(
x
.
u
.
keyButtonPointer
.
time
>
nxagentLastEventTime
)
{
x
.
u
.
keyButtonPointer
.
time
=
nxagentLastEventTime
;
}
if
(
!
(
nxagentCheckSpecialKeystroke
(
&
X
.
xkey
,
&
result
)))
{
mieqEnqueue
(
&
x
);
...
...
@@ -4022,4 +4027,180 @@ void nxagentGuessDumpInputInfo(ClientPtr client, Atom property, char *data)
}
}
void
nxagentDeactivateInputDevicesGrabs
()
{
fprintf
(
stderr
,
"Info: Deactivating input devices grabs.
\n
"
);
if
(
inputInfo
.
pointer
->
grab
)
{
(
*
inputInfo
.
pointer
->
DeactivateGrab
)(
inputInfo
.
pointer
);
}
if
(
inputInfo
.
keyboard
->
grab
)
{
(
*
inputInfo
.
keyboard
->
DeactivateGrab
)(
inputInfo
.
keyboard
);
}
}
static
const
char
*
nxagentGrabStateToString
(
int
state
)
{
switch
(
state
)
{
case
0
:
return
"NOT_GRABBED"
;
case
1
:
return
"THAWED"
;
case
2
:
return
"THAWED_BOTH"
;
case
3
:
return
"FREEZE_NEXT_EVENT"
;
case
4
:
return
"FREEZE_BOTH_NEXT_EVENT"
;
case
5
:
return
"FROZEN_NO_EVENT"
;
case
6
:
return
"FROZEN_WITH_EVENT"
;
case
7
:
return
"THAW_OTHERS"
;
default:
return
"unknown state"
;
}
}
void
nxagentDumpInputDevicesState
(
void
)
{
int
i
,
k
;
int
mask
=
1
;
CARD8
val
;
DeviceIntPtr
dev
;
GrabPtr
grab
;
WindowPtr
pWin
=
NULL
;
fprintf
(
stderr
,
"
\n
*** Dump input devices state: BEGIN ***"
"
\n
Keys down:"
);
dev
=
inputInfo
.
keyboard
;
for
(
i
=
0
;
i
<
DOWN_LENGTH
;
i
++
)
{
val
=
dev
->
key
->
down
[
i
];
if
(
val
!=
0
)
{
for
(
k
=
0
;
k
<
8
;
k
++
)
{
if
(
val
&
(
mask
<<
k
))
{
fprintf
(
stderr
,
"
\n\t
[%d] [%s]"
,
i
*
8
+
k
,
XKeysymToString
(
XKeycodeToKeysym
(
nxagentDisplay
,
i
*
8
+
k
,
0
)));
}
}
}
}
fprintf
(
stderr
,
"
\n
Keyboard device state:
\n\t
device [%p]
\n\t
last grab time [%lu]"
"
\n\t
frozen [%s]
\n\t
state [%s]
\n\t
other [%p]
\n\t
event count [%d]"
"
\n\t
from passive grab [%s]
\n\t
activating key [%d]"
,
dev
,
dev
->
grabTime
.
milliseconds
,
dev
->
sync
.
frozen
?
"Yes"
:
"No"
,
nxagentGrabStateToString
(
dev
->
sync
.
state
),
dev
->
sync
.
other
,
dev
->
sync
.
evcount
,
dev
->
fromPassiveGrab
?
"Yes"
:
"No"
,
dev
->
activatingKey
);
grab
=
dev
->
grab
;
if
(
grab
)
{
fprintf
(
stderr
,
"
\n
Keyboard grab state:
\n\t
window pointer [%p]"
"
\n\t
owner events flag [%s]
\n\t
grab mode [%s]"
,
grab
->
window
,
grab
->
ownerEvents
?
"True"
:
"False"
,
grab
->
keyboardMode
?
"asynchronous"
:
"synchronous"
);
/*
* Passive grabs.
*/
pWin
=
grab
->
window
;
grab
=
wPassiveGrabs
(
pWin
);
while
(
grab
)
{
fprintf
(
stderr
,
"
\n
Passive grab state:
\n\t
device [%p]
\n\t
owner events flag [%s]"
"
\n\t
pointer grab mode [%s]
\n\t
keyboard grab mode [%s]
\n\t
event type [%d]"
"
\n\t
modifiers [%x]
\n\t
button/key [%u]
\n\t
event mask [%lx]"
,
grab
->
device
,
grab
->
ownerEvents
?
"True"
:
"False"
,
grab
->
pointerMode
?
"asynchronous"
:
"synchronous"
,
grab
->
keyboardMode
?
"asynchronous"
:
"synchronous"
,
grab
->
type
,
grab
->
modifiersDetail
.
exact
,
grab
->
detail
.
exact
,
grab
->
eventMask
);
grab
=
grab
->
next
;
}
}
fprintf
(
stderr
,
"
\n
Buttons down:"
);
dev
=
inputInfo
.
pointer
;
for
(
i
=
0
;
i
<
DOWN_LENGTH
;
i
++
)
{
val
=
dev
->
button
->
down
[
i
];
if
(
val
!=
0
)
{
for
(
k
=
0
;
k
<
8
;
k
++
)
{
if
(
val
&
(
mask
<<
k
))
{
fprintf
(
stderr
,
"
\n\t
[%d]"
,
i
*
8
+
k
);
}
}
}
}
fprintf
(
stderr
,
"
\n
Pointer device state:
\n\t
device [%p]
\n\t
last grab time [%lu]"
"
\n\t
frozen [%s]
\n\t
state [%s]
\n\t
other [%p]
\n\t
event count [%d]"
"
\n\t
from passive grab [%s]
\n\t
activating button [%d]"
,
dev
,
dev
->
grabTime
.
milliseconds
,
dev
->
sync
.
frozen
?
"Yes"
:
"No"
,
nxagentGrabStateToString
(
dev
->
sync
.
state
),
dev
->
sync
.
other
,
dev
->
sync
.
evcount
,
dev
->
fromPassiveGrab
?
"Yes"
:
"No"
,
dev
->
activatingKey
);
grab
=
dev
->
grab
;
if
(
grab
)
{
fprintf
(
stderr
,
"
\n
Pointer grab state:
\n\t
window pointer [%p]"
"
\n\t
owner events flag [%s]
\n\t
grab mode [%s]"
,
grab
->
window
,
grab
->
ownerEvents
?
"True"
:
"False"
,
grab
->
pointerMode
?
"asynchronous"
:
"synchronous"
);
if
(
grab
->
window
!=
pWin
)
{
/*
* Passive grabs.
*/
grab
=
wPassiveGrabs
(
grab
->
window
);
while
(
grab
)
{
fprintf
(
stderr
,
"
\n
Passive grab state:
\n\t
device [%p]
\n\t
owner events flag [%s]"
"
\n\t
pointer grab mode [%s]
\n\t
keyboard grab mode [%s]
\n\t
event type [%d]"
"
\n\t
modifiers [%x]
\n\t
button/key [%u]
\n\t
event mask [%lx]"
,
grab
->
device
,
grab
->
ownerEvents
?
"True"
:
"False"
,
grab
->
pointerMode
?
"asynchronous"
:
"synchronous"
,
grab
->
keyboardMode
?
"asynchronous"
:
"synchronous"
,
grab
->
type
,
grab
->
modifiersDetail
.
exact
,
grab
->
detail
.
exact
,
grab
->
eventMask
);
grab
=
grab
->
next
;
}
}
}
fprintf
(
stderr
,
"
\n
*** Dump input devices state: FINISH ***
\n
"
);
}
#endif
nx-X11/programs/Xserver/hw/nxagent/Handlers.c
View file @
fc05e5e0
...
...
@@ -105,6 +105,13 @@
#define MINIMUM_DISPLAY_BUFFER 512
#ifdef NX_DEBUG_INPUT
extern
int
nxagentDebugInputDevices
;
extern
unsigned
long
nxagentLastInputDevicesDumpTime
;
extern
void
nxagentDumpInputDevicesState
(
void
);
#endif
/*
* Used in the handling of the X desktop
* manager protocol.
...
...
@@ -186,6 +193,18 @@ void nxagentBlockHandler(pointer data, struct timeval **timeout, pointer mask)
now
=
GetTimeInMillis
();
#ifdef NX_DEBUG_INPUT
if
(
nxagentDebugInputDevices
==
1
&&
now
-
nxagentLastInputDevicesDumpTime
>
5000
)
{
nxagentLastInputDevicesDumpTime
=
now
;
nxagentDumpInputDevicesState
();
}
#endif
if
(
nxagentNeedConnectionChange
()
==
1
)
{
#ifdef TEST
...
...
@@ -540,6 +559,8 @@ void nxagentBlockHandler(pointer data, struct timeval **timeout, pointer mask)
#endif
nxagentPrintGeometry
();
#ifdef BLOCKS
fprintf
(
stderr
,
"[End block]
\n
"
);
#endif
...
...
@@ -820,6 +841,8 @@ FIXME: Must queue multiple writes and handle
#endif
nxagentPrintGeometry
();
#ifdef BLOCKS
fprintf
(
stderr
,
"[End block]
\n
"
);
#endif
...
...
nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
View file @
fc05e5e0
...
...
@@ -31,6 +31,12 @@
extern
Bool
nxagentWMIsRunning
;
extern
Bool
nxagentIpaq
;
#ifdef NX_DEBUG_INPUT
int
nxagentDebugInputDevices
=
0
;
unsigned
long
nxagentLastInputDevicesDumpTime
=
0
;
extern
void
nxagentDeactivateInputDevicesGrabs
();
#endif
/*
* Set here the required log level.
*/
...
...
@@ -209,6 +215,53 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
}
#endif
#ifdef NX_DEBUG_INPUT
case
XK_X
:
case
XK_x
:
{
/*
* Used to test the input devices state.
*/
if
(
X
->
type
==
KeyPress
)
{
if
(
nxagentDebugInputDevices
==
0
)
{
fprintf
(
stderr
,
"Info: Turning input devices debug ON.
\n
"
);
nxagentDebugInputDevices
=
1
;
}
else
{
fprintf
(
stderr
,
"Info: Turning input devices debug OFF.
\n
"
);
nxagentDebugInputDevices
=
0
;
nxagentLastInputDevicesDumpTime
=
0
;
}
}
return
1
;
}
case
XK_Y
:
case
XK_y
:
{
/*
* Used to deactivate input devices grab.
*/
if
(
X
->
type
==
KeyPress
)
{
nxagentDeactivateInputDevicesGrabs
();
}
return
1
;
}
#endif
}
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Options.c
View file @
fc05e5e0
...
...
@@ -39,6 +39,11 @@ AgentOptionsRec nxagentOptionsBackup;
AgentOptionsPtr
nxagentOptionsPtr
=
&
nxagentOptions
;
/*
* If this is set, print the geometry in the block handler.
*/
unsigned
int
nxagentPrintGeometryFlags
=
0
;
/*
* This must be called at startup to initialize
* the options repository to the default values.
*/
...
...
nx-X11/programs/Xserver/hw/nxagent/Options.h
View file @
fc05e5e0
...
...
@@ -29,6 +29,8 @@
#define UNDEFINED -1
#define COPY_UNLIMITED -1
extern
unsigned
int
nxagentPrintGeometryFlags
;
typedef
enum
_BackingStoreMode
{
BackingStoreUndefined
=
-
1
,
...
...
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
View file @
fc05e5e0
...
...
@@ -257,7 +257,11 @@ TODO: This should be reset only when
if
((
dispatchException
&
DE_TERMINATE
)
==
0
)
{
#ifdef NX_DEBUG_INPUT
fprintf
(
stderr
,
"Session: Session suspended at '%s' timestamp [%lu].
\n
"
,
GetTimeAsString
(),
GetTimeInMillis
());
#else
fprintf
(
stderr
,
"Session: Session suspended at '%s'.
\n
"
,
GetTimeAsString
());
#endif
}
nxagentResetDisplayHandlers
();
...
...
@@ -609,7 +613,11 @@ Bool nxagentReconnectSession(void)
goto
nxagentReconnectError
;
}
#ifdef NX_DEBUG_INPUT
fprintf
(
stderr
,
"Session: Session resumed at '%s' timestamp [%lu].
\n
"
,
GetTimeAsString
(),
GetTimeInMillis
());
#else
fprintf
(
stderr
,
"Session: Session resumed at '%s'.
\n
"
,
GetTimeAsString
());
#endif
nxagentRemoveSplashWindow
(
NULL
);
...
...
nx-X11/programs/Xserver/hw/nxagent/Screen.c
View file @
fc05e5e0
...
...
@@ -2373,8 +2373,7 @@ FIXME: We should try to restore the previously
nxagentPrintAgentGeometry
(
"After Resize Screen"
,
"nxagentResizeScreen:"
);
#endif
fprintf
(
stderr
,
"Info: Screen [%d] resized to geometry [%dx%d].
\n
"
,
pScreen
->
myNum
,
width
,
height
);
nxagentSetPrintGeometry
(
pScreen
->
myNum
);
return
1
;
...
...
@@ -3903,6 +3902,24 @@ void nxagentShadowAdaptToRatio(void)
REGION_UNINIT
(
pScreen
,
&
region
);
}
void
nxagentPrintGeometry
()
{
int
i
;
for
(
i
=
0
;
i
<
screenInfo
.
numScreens
;
i
++
)
{
if
(
nxagentPrintGeometryFlags
&&
(
1
<<
i
))
{
fprintf
(
stderr
,
"Info: Screen [%d] resized to geometry [%dx%d] "
"fullscreen [%d].
\n
"
,
i
,
screenInfo
.
screens
[
i
]
->
width
,
screenInfo
.
screens
[
i
]
->
height
,
nxagentOption
(
Fullscreen
));
}
}
nxagentPrintGeometryFlags
=
0
;
}
#ifdef DUMP
void
nxagentShowPixmap
(
PixmapPtr
pPixmap
,
int
x
,
int
y
,
int
width
,
int
height
)
...
...
nx-X11/programs/Xserver/hw/nxagent/Screen.h
View file @
fc05e5e0
...
...
@@ -36,6 +36,9 @@ is" without express or implied warranty.
#define MIN_NXAGENT_HEIGHT 60
#define NXAGENT_FRAME_WIDTH 2000
#define nxagentSetPrintGeometry(screen) \
nxagentPrintGeometryFlags = (1 << (screen));
extern
int
nxagentClients
;
extern
int
nxagentAutoDisconnectTimeout
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Window.c
View file @
fc05e5e0
...
...
@@ -908,6 +908,8 @@ void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn)
XMoveResizeWindow
(
nxagentDisplay
,
nxagentInputWindows
[
0
],
0
,
0
,
nxagentOption
(
Width
),
nxagentOption
(
Height
));
nxagentSetPrintGeometry
(
pScreen
->
myNum
);
}
#ifdef VIEWPORT_FRAME
...
...
nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c
View file @
fc05e5e0
...
...
@@ -515,7 +515,11 @@ Dispatch(void)
if
(
serverGeneration
>
nxagentMaxAllowedResets
)
{
#ifdef NX_DEBUG_INPUT
fprintf
(
stderr
,
"Session: Session started at '%s' timestamp [%lu].
\n
"
,
GetTimeAsString
(),
GetTimeInMillis
());
#else
fprintf
(
stderr
,
"Session: Session started at '%s'.
\n
"
,
GetTimeAsString
());
#endif
nxagentSessionState
=
SESSION_UP
;
}
...
...
nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.NX.original
View file @
fc05e5e0
...
...
@@ -515,7 +515,11 @@ Dispatch(void)
if (serverGeneration > nxagentMaxAllowedResets)
{
#ifdef NX_DEBUG_INPUT
fprintf(stderr, "Session: Session started at '%s' timestamp [%lu].\n", GetTimeAsString(), GetTimeInMillis());
#else
fprintf(stderr, "Session: Session started at '%s'.\n", GetTimeAsString());
#endif
nxagentSessionState = SESSION_UP;
}
...
...
nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c
View file @
fc05e5e0
...
...
@@ -191,6 +191,7 @@ xEvent *xeviexE;
#ifdef NX_DEBUG_INPUT
extern
int
nxagentDebugInput
;
extern
int
nxagentDebugInputDevices
;
#endif
extern
Display
*
nxagentDisplay
;
...
...
@@ -1865,6 +1866,12 @@ DeliverEventsToWindow(register WindowPtr pWin, xEvent *pEvents, int count,
tempGrab
.
pointerMode
=
GrabModeAsync
;
tempGrab
.
confineTo
=
NullWindow
;
tempGrab
.
cursor
=
NullCursor
;
#ifdef NX_DEBUG_INPUT
if
(
nxagentDebugInputDevices
==
1
)
{
fprintf
(
stderr
,
"DeliverEventsToWindow: Activating passive grab on pointer.
\n
"
);
}
#endif
(
*
inputInfo
.
pointer
->
ActivateGrab
)(
inputInfo
.
pointer
,
&
tempGrab
,
currentTime
,
TRUE
);
}
...
...
@@ -2735,6 +2742,13 @@ CheckPassiveGrabsOnWindow(
tempGrab
.
modifiersDetail
.
exact
&
(
~
0x1f00
);
}
#endif
#ifdef NX_DEBUG_INPUT
if
(
nxagentDebugInputDevices
==
1
)
{
fprintf
(
stderr
,
"CheckPassiveGrabsOnWindow: Activating passive grab on %s.
\n
"
,
device
==
inputInfo
.
keyboard
?
"keyboard"
:
"pointer"
);
}
#endif
(
*
device
->
ActivateGrab
)(
device
,
grab
,
currentTime
,
TRUE
);
FixUpEventFromWindow
(
xE
,
grab
->
window
,
None
,
TRUE
);
...
...
@@ -3093,7 +3107,17 @@ drawable.id:0;
else
DeliverFocusedEvent
(
keybd
,
xE
,
sprite
.
win
,
count
);
if
(
deactivateGrab
)
#ifdef NX_DEBUG_INPUT
{
if
(
nxagentDebugInputDevices
==
1
)
{
fprintf
(
stderr
,
"ProcessKeyboardEvent: Deactivating grab on keyboard.
\n
"
);
}
#endif
(
*
keybd
->
DeactivateGrab
)(
keybd
);
#ifdef NX_DEBUG_INPUT
}
#endif
}
#ifdef XKB
...
...
@@ -3320,7 +3344,17 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count
mouse
,
count
);
#endif
if
(
deactivateGrab
)
#ifdef NX_DEBUG_INPUT
{
if
(
nxagentDebugInputDevices
==
1
)
{
fprintf
(
stderr
,
"ProcessPointerEvent: Deactivating grab on pointer.
\n
"
);
}
#endif
(
*
mouse
->
DeactivateGrab
)(
mouse
);
#ifdef NX_DEBUG_INPUT
}
#endif
}
#define AtMostOneClient \
...
...
@@ -4041,6 +4075,12 @@ ProcGrabPointer(ClientPtr client)
pWin
=
SecurityLookupWindow
(
stuff
->
grabWindow
,
client
,
SecurityReadAccess
);
if
(
!
pWin
)
return
BadWindow
;
#ifdef NX_DEBUG_INPUT
if
(
nxagentDebugInputDevices
==
1
)
{
fprintf
(
stderr
,
"ProcGrabPointer: pWin [%p] client [%d].
\n
"
,
pWin
,
client
->
index
);
}
#endif
if
(
stuff
->
confineTo
==
None
)
confineTo
=
NullWindow
;
else
...
...
@@ -4100,6 +4140,12 @@ ProcGrabPointer(ClientPtr client)
tempGrab
.
keyboardMode
=
stuff
->
keyboardMode
;
tempGrab
.
pointerMode
=
stuff
->
pointerMode
;
tempGrab
.
device
=
device
;
#ifdef NX_DEBUG_INPUT
if
(
nxagentDebugInputDevices
==
1
)
{
fprintf
(
stderr
,
"ProcGrabPointer: Activating active grab on pointer.
\n
"
);
}
#endif
(
*
device
->
ActivateGrab
)(
device
,
&
tempGrab
,
time
,
FALSE
);
if
(
oldCursor
)
FreeCursor
(
oldCursor
,
(
Cursor
)
0
);
...
...
@@ -4163,6 +4209,12 @@ ProcUngrabPointer(ClientPtr client)
TimeStamp
time
;
REQUEST
(
xResourceReq
);
#ifdef NX_DEBUG_INPUT
if
(
nxagentDebugInputDevices
==
1
)
{
fprintf
(
stderr
,
"ProcUngrabPointer: client [%d].
\n
"
,
client
->
index
);
}
#endif
REQUEST_SIZE_MATCH
(
xResourceReq
);
UpdateCurrentTime
();
grab
=
device
->
grab
;
...
...
@@ -4170,7 +4222,25 @@ ProcUngrabPointer(ClientPtr client)
if
((
CompareTimeStamps
(
time
,
currentTime
)
!=
LATER
)
&&
(
CompareTimeStamps
(
time
,
device
->
grabTime
)
!=
EARLIER
)
&&
(
grab
)
&&
SameClient
(
grab
,
client
))
#ifdef NX_DEBUG_INPUT
{
if
(
nxagentDebugInputDevices
==
1
)
{
fprintf
(
stderr
,
"ProcUngrabPointer: Deactivating grab on pointer.
\n
"
);
}
#endif
(
*
device
->
DeactivateGrab
)(
device
);
#ifdef NX_DEBUG_INPUT
}
else
{
if
(
nxagentDebugInputDevices
==
1
)
{
fprintf
(
stderr
,
"ProcUngrabPointer: current time [%lu] request time [%lu] grab time [%lu].
\n
"
,
currentTime
.
milliseconds
,
time
.
milliseconds
,
device
->
grabTime
.
milliseconds
);
}
}
#endif
return
Success
;
}
...
...
@@ -4225,6 +4295,12 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev,
tempGrab
.
pointerMode
=
other_mode
;
tempGrab
.
eventMask
=
mask
;
tempGrab
.
device
=
dev
;
#ifdef NX_DEBUG_INPUT
if
(
nxagentDebugInputDevices
==
1
)
{
fprintf
(
stderr
,
"GrabDevice: Activating active grab on keyboard.
\n
"
);
}
#endif
(
*
dev
->
ActivateGrab
)(
dev
,
&
tempGrab
,
time
,
FALSE
);
*
status
=
GrabSuccess
;
}
...
...
@@ -4238,6 +4314,12 @@ ProcGrabKeyboard(ClientPtr client)
REQUEST
(
xGrabKeyboardReq
);
int
result
;
#ifdef NX_DEBUG_INPUT
if
(
nxagentDebugInputDevices
==
1
)
{
fprintf
(
stderr
,
"ProcGrabKeyboard: client [%d].
\n
"
,
client
->
index
);
}
#endif
REQUEST_SIZE_MATCH
(
xGrabKeyboardReq
);
#ifdef XCSECURITY
if
(
!
SecurityCheckDeviceAccess
(
client
,
inputInfo
.
keyboard
,
TRUE
))
...
...
@@ -4268,6 +4350,12 @@ ProcUngrabKeyboard(ClientPtr client)
TimeStamp
time
;
REQUEST
(
xResourceReq
);
#ifdef NX_DEBUG_INPUT
if
(
nxagentDebugInputDevices
==
1
)
{
fprintf
(
stderr
,
"ProcUngrabKeyboard: client [%d].
\n
"
,
client
->
index
);
}
#endif
REQUEST_SIZE_MATCH
(
xResourceReq
);
UpdateCurrentTime
();
grab
=
device
->
grab
;
...
...
@@ -4275,7 +4363,25 @@ ProcUngrabKeyboard(ClientPtr client)
if
((
CompareTimeStamps
(
time
,
currentTime
)
!=
LATER
)
&&
(
CompareTimeStamps
(
time
,
device
->
grabTime
)
!=
EARLIER
)
&&
(
grab
)
&&
SameClient
(
grab
,
client
))
#ifdef NX_DEBUG_INPUT
{
if
(
nxagentDebugInputDevices
==
1
)
{
fprintf
(
stderr
,
"ProcUngrabKeyboard: Deactivating grab on keyboard.
\n
"
);
}
#endif
(
*
device
->
DeactivateGrab
)(
device
);
#ifdef NX_DEBUG_INPUT
}
else
{
if
(
nxagentDebugInputDevices
==
1
)
{
fprintf
(
stderr
,
"ProcUngrabKeyboard: current time [%lu] request time [%lu] grab time [%lu].
\n
"
,
currentTime
.
milliseconds
,
time
.
milliseconds
,
device
->
grabTime
.
milliseconds
);
}
}
#endif
return
Success
;
}
...
...
nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original
View file @
fc05e5e0
...
...
@@ -191,6 +191,7 @@ xEvent *xeviexE;
#ifdef NX_DEBUG_INPUT
extern int nxagentDebugInput;
extern int nxagentDebugInputDevices;
#endif
extern Display *nxagentDisplay;
...
...
@@ -1865,6 +1866,12 @@ DeliverEventsToWindow(register WindowPtr pWin, xEvent *pEvents, int count,
tempGrab.pointerMode = GrabModeAsync;
tempGrab.confineTo = NullWindow;
tempGrab.cursor = NullCursor;
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "DeliverEventsToWindow: Activating passive grab on pointer.\n");
}
#endif
(*inputInfo.pointer->ActivateGrab)(inputInfo.pointer, &tempGrab,
currentTime, TRUE);
}
...
...
@@ -2735,6 +2742,13 @@ CheckPassiveGrabsOnWindow(
tempGrab.modifiersDetail.exact&(~0x1f00);
}
#endif
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "CheckPassiveGrabsOnWindow: Activating passive grab on %s.\n",
device == inputInfo.keyboard ? "keyboard" : "pointer");
}
#endif
(*device->ActivateGrab)(device, grab, currentTime, TRUE);
FixUpEventFromWindow(xE, grab->window, None, TRUE);
...
...
@@ -3093,7 +3107,17 @@ drawable.id:0;
else
DeliverFocusedEvent(keybd, xE, sprite.win, count);
if (deactivateGrab)
#ifdef NX_DEBUG_INPUT
{
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcessKeyboardEvent: Deactivating grab on keyboard.\n");
}
#endif
(*keybd->DeactivateGrab)(keybd);
#ifdef NX_DEBUG_INPUT
}
#endif
}
#ifdef XKB
...
...
@@ -3320,7 +3344,17 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count
mouse, count);
#endif
if (deactivateGrab)
#ifdef NX_DEBUG_INPUT
{
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcessPointerEvent: Deactivating grab on pointer.\n");
}
#endif
(*mouse->DeactivateGrab)(mouse);
#ifdef NX_DEBUG_INPUT
}
#endif
}
#define AtMostOneClient \
...
...
@@ -4041,6 +4075,12 @@ ProcGrabPointer(ClientPtr client)
pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess);
if (!pWin)
return BadWindow;
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcGrabPointer: pWin [%p] client [%d].\n", pWin, client -> index);
}
#endif
if (stuff->confineTo == None)
confineTo = NullWindow;
else
...
...
@@ -4100,6 +4140,12 @@ ProcGrabPointer(ClientPtr client)
tempGrab.keyboardMode = stuff->keyboardMode;
tempGrab.pointerMode = stuff->pointerMode;
tempGrab.device = device;
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcGrabPointer: Activating active grab on pointer.\n");
}
#endif
(*device->ActivateGrab)(device, &tempGrab, time, FALSE);
if (oldCursor)
FreeCursor (oldCursor, (Cursor)0);
...
...
@@ -4163,6 +4209,12 @@ ProcUngrabPointer(ClientPtr client)
TimeStamp time;
REQUEST(xResourceReq);
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcUngrabPointer: client [%d].\n", client -> index);
}
#endif
REQUEST_SIZE_MATCH(xResourceReq);
UpdateCurrentTime();
grab = device->grab;
...
...
@@ -4170,7 +4222,25 @@ ProcUngrabPointer(ClientPtr client)
if ((CompareTimeStamps(time, currentTime) != LATER) &&
(CompareTimeStamps(time, device->grabTime) != EARLIER) &&
(grab) && SameClient(grab, client))
#ifdef NX_DEBUG_INPUT
{
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcUngrabPointer: Deactivating grab on pointer.\n");
}
#endif
(*device->DeactivateGrab)(device);
#ifdef NX_DEBUG_INPUT
}
else
{
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcUngrabPointer: current time [%lu] request time [%lu] grab time [%lu].\n",
currentTime.milliseconds, time.milliseconds, device->grabTime.milliseconds);
}
}
#endif
return Success;
}
...
...
@@ -4225,6 +4295,12 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev,
tempGrab.pointerMode = other_mode;
tempGrab.eventMask = mask;
tempGrab.device = dev;
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "GrabDevice: Activating active grab on keyboard.\n");
}
#endif
(*dev->ActivateGrab)(dev, &tempGrab, time, FALSE);
*status = GrabSuccess;
}
...
...
@@ -4238,6 +4314,12 @@ ProcGrabKeyboard(ClientPtr client)
REQUEST(xGrabKeyboardReq);
int result;
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcGrabKeyboard: client [%d].\n", client -> index);
}
#endif
REQUEST_SIZE_MATCH(xGrabKeyboardReq);
#ifdef XCSECURITY
if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE))
...
...
@@ -4268,6 +4350,12 @@ ProcUngrabKeyboard(ClientPtr client)
TimeStamp time;
REQUEST(xResourceReq);
#ifdef NX_DEBUG_INPUT
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcUngrabKeyboard: client [%d].\n", client -> index);
}
#endif
REQUEST_SIZE_MATCH(xResourceReq);
UpdateCurrentTime();
grab = device->grab;
...
...
@@ -4275,7 +4363,25 @@ ProcUngrabKeyboard(ClientPtr client)
if ((CompareTimeStamps(time, currentTime) != LATER) &&
(CompareTimeStamps(time, device->grabTime) != EARLIER) &&
(grab) && SameClient(grab, client))
#ifdef NX_DEBUG_INPUT
{
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcUngrabKeyboard: Deactivating grab on keyboard.\n");
}
#endif
(*device->DeactivateGrab)(device);
#ifdef NX_DEBUG_INPUT
}
else
{
if (nxagentDebugInputDevices == 1)
{
fprintf(stderr, "ProcUngrabKeyboard: current time [%lu] request time [%lu] grab time [%lu].\n",
currentTime.milliseconds, time.milliseconds, device->grabTime.milliseconds);
}
}
#endif
return Success;
}
...
...
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