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
36f679fb
Commit
36f679fb
authored
Sep 05, 2019
by
Ulrich Sibiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Events.c: reformat comments
save some lines
parent
f48e2da3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
109 additions
and
148 deletions
+109
-148
Events.c
nx-X11/programs/Xserver/hw/nxagent/Events.c
+109
-148
No files found.
nx-X11/programs/Xserver/hw/nxagent/Events.c
View file @
36f679fb
...
@@ -105,9 +105,8 @@
...
@@ -105,9 +105,8 @@
#include "compext/Compext.h"
#include "compext/Compext.h"
/*
/*
* Set here the required log level. Please note
* Set here the required log level. Please note that if you want to
* that if you want to enable DEBUG here, then
* enable DEBUG here, then you need to enable DEBUG even in Rootless.c
* you need to enable DEBUG even in Rootless.c
*/
*/
#define PANIC
#define PANIC
...
@@ -163,8 +162,7 @@ PropertyRequestRec nxagentPropertyRequests[NXNumberOfResources];
...
@@ -163,8 +162,7 @@ PropertyRequestRec nxagentPropertyRequests[NXNumberOfResources];
void
nxagentHandleCollectPropertyEvent
(
XEvent
*
);
void
nxagentHandleCollectPropertyEvent
(
XEvent
*
);
/*
/*
* Finalize the asynchronous handling
* Finalize the asynchronous handling of the X_GrabPointer requests.
* of the X_GrabPointer requests.
*/
*/
void
nxagentHandleCollectGrabPointerEvent
(
int
resource
);
void
nxagentHandleCollectGrabPointerEvent
(
int
resource
);
...
@@ -172,8 +170,8 @@ void nxagentHandleCollectGrabPointerEvent(int resource);
...
@@ -172,8 +170,8 @@ void nxagentHandleCollectGrabPointerEvent(int resource);
Bool
nxagentCollectGrabPointerPredicate
(
Display
*
display
,
XEvent
*
X
,
XPointer
ptr
);
Bool
nxagentCollectGrabPointerPredicate
(
Display
*
display
,
XEvent
*
X
,
XPointer
ptr
);
/*
/*
* Used in Handlers.c to synchronize
* Used in Handlers.c to synchronize
the agent with the remote X
*
the agent with the remote X
server.
* server.
*/
*/
void
nxagentHandleCollectInputFocusEvent
(
int
resource
);
void
nxagentHandleCollectInputFocusEvent
(
int
resource
);
...
@@ -193,12 +191,12 @@ static Cursor viewportCursor;
...
@@ -193,12 +191,12 @@ static Cursor viewportCursor;
#define nextinc(x) ((x) < MAX_INC ? (x) += INC_STEP : (x))
#define nextinc(x) ((x) < MAX_INC ? (x) += INC_STEP : (x))
/*
/*
* Keyboard and pointer are handled as they were real devices by
* Keyboard and pointer are handled as they were real devices by
Xnest
*
Xnest and we inherit this behaviour. The following mask will
*
and we inherit this behaviour. The following mask will contain the
*
contain the event mask selected for the root window of
the
*
event mask selected for the root window of the agent. All
the
*
agent. All the keyboard and pointer events will be translate
d
*
keyboard and pointer events will be translated by the agent an
d
*
by the agent and sent to the internal clients according to
*
sent to the internal clients according to events selected by the
*
events selected by the
inferior windows.
* inferior windows.
*/
*/
static
Mask
defaultEventMask
;
static
Mask
defaultEventMask
;
...
@@ -206,9 +204,8 @@ static Mask defaultEventMask;
...
@@ -206,9 +204,8 @@ static Mask defaultEventMask;
static
int
lastEventSerial
=
0
;
static
int
lastEventSerial
=
0
;
/*
/*
* Used to mask the appropriate bits in
* Used to mask the appropriate bits in the state reported by
* the state reported by XkbStateNotify
* XkbStateNotify and XkbGetIndicatorState.
* and XkbGetIndicatorState.
*/
*/
#define CAPSFLAG_IN_REPLY 1
#define CAPSFLAG_IN_REPLY 1
...
@@ -221,8 +218,8 @@ CARD32 nxagentLastKeyPressTime = 0;
...
@@ -221,8 +218,8 @@ CARD32 nxagentLastKeyPressTime = 0;
Time
nxagentLastServerTime
=
0
;
Time
nxagentLastServerTime
=
0
;
/*
/*
* Used for storing windows that need to
* Used for storing windows that need to
receive expose events from
*
receive expose events from
the agent.
* the agent.
*/
*/
#define nxagentExposeQueueHead nxagentExposeQueue.exposures[nxagentExposeQueue.start]
#define nxagentExposeQueueHead nxagentExposeQueue.exposures[nxagentExposeQueue.start]
...
@@ -246,16 +243,14 @@ int GetWindowProperty(WindowPtr pWin, Atom property, long longOffset,
...
@@ -246,16 +243,14 @@ int GetWindowProperty(WindowPtr pWin, Atom property, long longOffset,
unsigned
char
**
propData
);
unsigned
char
**
propData
);
/*
/*
* Associate a resource to a drawable and
* Associate a resource to a drawable and store the region affected by
* store the region affected by the split
* the split operation.
* operation.
*/
*/
SplitResourceRec
nxagentSplitResources
[
NXNumberOfResources
];
SplitResourceRec
nxagentSplitResources
[
NXNumberOfResources
];
/*
/*
* Associate a resource to an unpack
* Associate a resource to an unpack operation.
* operation.
*/
*/
UnpackResourceRec
nxagentUnpackResources
[
NXNumberOfResources
];
UnpackResourceRec
nxagentUnpackResources
[
NXNumberOfResources
];
...
@@ -269,8 +264,7 @@ Bool nxagentLastWindowDestroyed = False;
...
@@ -269,8 +264,7 @@ Bool nxagentLastWindowDestroyed = False;
Time
nxagentLastWindowDestroyedTime
=
0
;
Time
nxagentLastWindowDestroyedTime
=
0
;
/*
/*
* Set this flag when an user input event
* Set this flag when an user input event is received.
* is received.
*/
*/
int
nxagentInputEvent
=
0
;
int
nxagentInputEvent
=
0
;
...
@@ -728,9 +722,8 @@ static void nxagentToggleAutoGrab(void)
...
@@ -728,9 +722,8 @@ static void nxagentToggleAutoGrab(void)
static
Bool
nxagentExposurePredicate
(
Display
*
display
,
XEvent
*
event
,
XPointer
window
)
static
Bool
nxagentExposurePredicate
(
Display
*
display
,
XEvent
*
event
,
XPointer
window
)
{
{
/*
/*
* Handle both Expose and ProcessedExpose events.
* Handle both Expose and ProcessedExpose events. The latters are
* The latters are those not filtered by function
* those not filtered by function nxagentWindowExposures().
* nxagentWindowExposures().
*/
*/
if
(
window
)
if
(
window
)
...
@@ -876,13 +869,11 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
...
@@ -876,13 +869,11 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
}
}
/*
/*
* We must read here, even if apparently there is
* We must read here, even if apparently there is nothing to
* nothing to read. The ioctl() based readable
* read. The ioctl() based readable function, in fact, is often
* function, in fact, is often unable to detect a
* unable to detect a failure of the socket, in particular if the
* failure of the socket, in particular if the
* agent was connected to the proxy and the proxy is gone. Thus we
* agent was connected to the proxy and the proxy
* must trust the wakeup handler that called us after the select().
* is gone. Thus we must trust the wakeup handler
* that called us after the select().
*/
*/
#ifdef TEST
#ifdef TEST
...
@@ -895,11 +886,10 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
...
@@ -895,11 +886,10 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
#endif
#endif
/*
/*
* We want to process all the events already in
* We want to process all the events already in the queue, plus any
* the queue, plus any additional event that may
* additional event that may be read from the network. If no event
* be read from the network. If no event can be
* can be read, we want to continue handling our clients without
* read, we want to continue handling our clients
* flushing the output buffer.
* without flushing the output buffer.
*/
*/
while
(
nxagentCheckEvents
(
nxagentDisplay
,
&
X
,
predicate
!=
NULL
?
predicate
:
while
(
nxagentCheckEvents
(
nxagentDisplay
,
&
X
,
predicate
!=
NULL
?
predicate
:
...
@@ -1126,13 +1116,11 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
...
@@ -1126,13 +1116,11 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
}
}
/*
/*
* Elide multiple KeyPress/KeyRelease events of
* Elide multiple KeyPress/KeyRelease events of the same key
* the same key and generate a single pair. This
* and generate a single pair. This is intended to reduce the
* is intended to reduce the impact of the laten-
* impact of the latency on the key auto-repeat, handled by
* cy on the key auto-repeat, handled by the re-
* the remote X server. We may optionally do that only if the
* mote X server. We may optionally do that only
* timestamps in the events show an exces- sive delay.
* if the timestamps in the events show an exces-
* sive delay.
*/
*/
keysym
=
XKeycodeToKeysym
(
nxagentDisplay
,
X
.
xkey
.
keycode
,
0
);
keysym
=
XKeycodeToKeysym
(
nxagentDisplay
,
X
.
xkey
.
keycode
,
0
);
...
@@ -1157,18 +1145,17 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
...
@@ -1157,18 +1145,17 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
int
sendKey
=
0
;
int
sendKey
=
0
;
/*
/*
FIXME: If we don't flush the queue here, it could happen
FIXME: If we don't flush the queue here, it could happen
that the
that the inputInfo structure will not be up to dat
e
inputInfo structure will not be up to date when we perform th
e
when we perform the
following check on down keys.
following check on down keys.
*/
*/
ProcessInputEvents
();
ProcessInputEvents
();
/*
/*
FIXME: Don't enqueue the KeyRelease event if the key was
FIXME: Don't enqueue the KeyRelease event if the key was not already
not already pressed. This workaround avoids a fake
pressed. This workaround avoids a fake KeyPress being enqueued
KeyPress being enqueued by the XKEYBOARD extension.
by the XKEYBOARD extension. Another solution would be to let
Another solution would be to let the events
the events enqueued and to remove the KeyPress afterwards.
enqueued and to remove the KeyPress afterwards.
*/
*/
if
(
BitIsOn
(
inputInfo
.
keyboard
->
key
->
down
,
if
(
BitIsOn
(
inputInfo
.
keyboard
->
key
->
down
,
nxagentConvertKeycode
(
X
.
xkey
.
keycode
)))
nxagentConvertKeycode
(
X
.
xkey
.
keycode
)))
...
@@ -1206,9 +1193,9 @@ FIXME: Don't enqueue the KeyRelease event if the key was
...
@@ -1206,9 +1193,9 @@ FIXME: Don't enqueue the KeyRelease event if the key was
nxagentXkbNumTrap
=
0
;
nxagentXkbNumTrap
=
0
;
}
}
/* Calculate the time elapsed between this and the last event
we
/* Calculate the time elapsed between this and the last event
received. Add this delta to time we recorded for the last
we received. Add this delta to time we recorded for the
KeyPress event we passed on to our clients.
*/
last KeyPress event we passed on to our clients.
*/
memset
(
&
x
,
0
,
sizeof
(
xEvent
));
memset
(
&
x
,
0
,
sizeof
(
xEvent
));
x
.
u
.
u
.
type
=
KeyRelease
;
x
.
u
.
u
.
type
=
KeyRelease
;
x
.
u
.
u
.
detail
=
nxagentConvertKeycode
(
X
.
xkey
.
keycode
);
x
.
u
.
u
.
detail
=
nxagentConvertKeycode
(
X
.
xkey
.
keycode
);
...
@@ -1564,9 +1551,8 @@ FIXME: Don't enqueue the KeyRelease event if the key was
...
@@ -1564,9 +1551,8 @@ FIXME: Don't enqueue the KeyRelease event if the key was
#endif
#endif
/*
/*
* Here we change the focus state in the agent.
* Here we change the focus state in the agent. It looks like
* It looks like this is needed only for root-
* this is needed only for rootless mode at present.
* less mode at the present moment.
*/
*/
if
(
nxagentOption
(
Rootless
)
&&
if
(
nxagentOption
(
Rootless
)
&&
...
@@ -1743,9 +1729,9 @@ FIXME: Don't enqueue the KeyRelease event if the key was
...
@@ -1743,9 +1729,9 @@ FIXME: Don't enqueue the KeyRelease event if the key was
pWin
->
drawable
.
y
!=
X
.
xcrossing
.
y_root
-
X
.
xcrossing
.
y
-
pWin
->
borderWidth
))
pWin
->
drawable
.
y
!=
X
.
xcrossing
.
y_root
-
X
.
xcrossing
.
y
-
pWin
->
borderWidth
))
{
{
/*
/*
* This code is useful for finding the window
* This code is useful for finding the window
position. It
*
position. It should be re-implemented by
*
should be re-implemented by following the ICCCM 4.1.5
*
following the ICCCM 4.1.5
recommendations.
* recommendations.
*/
*/
XID
values
[
4
];
XID
values
[
4
];
...
@@ -2141,8 +2127,8 @@ FIXME: Don't enqueue the KeyRelease event if the key was
...
@@ -2141,8 +2127,8 @@ FIXME: Don't enqueue the KeyRelease event if the key was
/*
/*
* without window manager there will be no ConfigureNotify
* without window manager there will be no ConfigureNotify
* event that would trigger xinerama updates. So we do that
once
* event that would trigger xinerama updates. So we do that
* the nxagent window gets mapped.
*
once
the nxagent window gets mapped.
*/
*/
if
(
!
nxagentWMIsRunning
&&
if
(
!
nxagentWMIsRunning
&&
X
.
xmap
.
window
==
nxagentDefaultWindows
[
nxagentScreen
(
X
.
xmap
.
window
)
->
myNum
])
X
.
xmap
.
window
==
nxagentDefaultWindows
[
nxagentScreen
(
X
.
xmap
.
window
)
->
myNum
])
...
@@ -2171,8 +2157,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
...
@@ -2171,8 +2157,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
default:
default:
{
{
/*
/*
* Let's check if this is a XKB
* Let's check if this is a XKB state modification event.
* state modification event.
*/
*/
if
(
nxagentHandleXkbKeyboardStateEvent
(
&
X
)
==
0
&&
nxagentHandleXFixesSelectionNotify
(
&
X
)
==
0
)
if
(
nxagentHandleXkbKeyboardStateEvent
(
&
X
)
==
0
&&
nxagentHandleXFixesSelectionNotify
(
&
X
)
==
0
)
...
@@ -2280,8 +2265,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
...
@@ -2280,8 +2265,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
#endif
#endif
/*
/*
* Let the underlying X server code
* Let the underlying X server code process the input events.
* process the input events.
*/
*/
#ifdef BLOCKS
#ifdef BLOCKS
...
@@ -2296,9 +2280,8 @@ FIXME: Don't enqueue the KeyRelease event if the key was
...
@@ -2296,9 +2280,8 @@ FIXME: Don't enqueue the KeyRelease event if the key was
#endif
#endif
/*
/*
* Write the events to our clients. We may
* Write the events to our clients. We may flush only in the case of
* flush only in the case of critical output
* critical output but this doesn't seem beneficial.
* but this doesn't seem beneficial.
*
*
* if (CriticalOutputPending == 1)
* if (CriticalOutputPending == 1)
* {
* {
...
@@ -2330,8 +2313,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
...
@@ -2330,8 +2313,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
}
}
/*
/*
* Functions providing the ad-hoc handling
* Functions providing the ad-hoc handling of the remote X events.
* of the remote X events.
*/
*/
int
nxagentHandleKeyPress
(
XEvent
*
X
,
enum
HandleEventResult
*
result
)
int
nxagentHandleKeyPress
(
XEvent
*
X
,
enum
HandleEventResult
*
result
)
...
@@ -2558,9 +2540,9 @@ FIXME: This can be maybe optimized by consuming the
...
@@ -2558,9 +2540,9 @@ FIXME: This can be maybe optimized by consuming the
int
nxagentHandleGraphicsExposeEvent
(
XEvent
*
X
)
int
nxagentHandleGraphicsExposeEvent
(
XEvent
*
X
)
{
{
/*
/*
* Send an expose event to client, instead of graphics
* Send an expose event to client, instead of graphics
expose. If
*
expose. If target drawable is a backing pixmap, send
*
target drawable is a backing pixmap, send expose event for the
*
expose event for the
saved window, else do nothing.
* saved window, else do nothing.
*/
*/
RegionPtr
exposeRegion
;
RegionPtr
exposeRegion
;
...
@@ -2609,8 +2591,7 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X)
...
@@ -2609,8 +2591,7 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X)
}
}
/*
/*
* Rectangle affected by GraphicsExpose
* Rectangle affected by GraphicsExpose event.
* event.
*/
*/
rect
.
x1
=
X
->
xgraphicsexpose
.
x
;
rect
.
x1
=
X
->
xgraphicsexpose
.
x
;
...
@@ -2628,19 +2609,17 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X)
...
@@ -2628,19 +2609,17 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X)
#endif
#endif
/*
/*
* The exposeRegion coordinates are relative
* The exposeRegion coordinates are relative to the pixmap to
* to the pixmap to which GraphicsExpose
* which GraphicsExpose event refers. But the BS coordinates of
* event refers. But the BS coordinates of
* the savedRegion are relative to the window.
* the savedRegion are relative to the
* window.
*/
*/
RegionTranslate
(
exposeRegion
,
pStoringPixmapRec
->
backingStoreX
,
RegionTranslate
(
exposeRegion
,
pStoringPixmapRec
->
backingStoreX
,
pStoringPixmapRec
->
backingStoreY
);
pStoringPixmapRec
->
backingStoreY
);
/*
/*
* We remove from SavedRegion the part
* We remove from SavedRegion the part
affected by the
*
affected by the
GraphicsExpose event.
* GraphicsExpose event.
*/
*/
RegionSubtract
(
&
(
pBSwindow
->
SavedRegion
),
&
(
pBSwindow
->
SavedRegion
),
RegionSubtract
(
&
(
pBSwindow
->
SavedRegion
),
&
(
pBSwindow
->
SavedRegion
),
...
@@ -2648,9 +2627,8 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X)
...
@@ -2648,9 +2627,8 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X)
}
}
/*
/*
* Store the exposeRegion in order to send
* Store the exposeRegion in order to send the expose event
* the expose event later. The coordinates
* later. The coordinates must be relative to the screen.
* must be relative to the screen.
*/
*/
RegionTranslate
(
exposeRegion
,
pWin
->
drawable
.
x
,
pWin
->
drawable
.
y
);
RegionTranslate
(
exposeRegion
,
pWin
->
drawable
.
x
,
pWin
->
drawable
.
y
);
...
@@ -2673,8 +2651,8 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result)
...
@@ -2673,8 +2651,8 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result)
#endif
#endif
/*
/*
* If window is 0, message_type is 0 and format is
* If window is 0, message_type is 0 and format is
32 then we assume
*
32 then we assume
event is coming from proxy.
* event is coming from proxy.
*/
*/
if
(
X
->
xclient
.
window
==
0
&&
if
(
X
->
xclient
.
window
==
0
&&
...
@@ -3007,10 +2985,8 @@ int nxagentHandleProxyEvent(XEvent *X)
...
@@ -3007,10 +2985,8 @@ int nxagentHandleProxyEvent(XEvent *X)
case
NXStartSplitNotify
:
case
NXStartSplitNotify
:
{
{
/*
/*
* We should never receive such events
* We should never receive such events in the event loop, as
* in the event loop, as they should
* they should be caught at the time the split is initiated.
* be caught at the time the split is
* initiated.
*/
*/
#ifdef PANIC
#ifdef PANIC
...
@@ -3035,10 +3011,9 @@ int nxagentHandleProxyEvent(XEvent *X)
...
@@ -3035,10 +3011,9 @@ int nxagentHandleProxyEvent(XEvent *X)
case
NXCommitSplitNotify
:
case
NXCommitSplitNotify
:
{
{
/*
/*
* We need to commit an image. Image can be the
* We need to commit an image. Image can be the result of a
* result of a PutSubImage() generated by Xlib,
* PutSubImage() generated by Xlib, so there can be more than a
* so there can be more than a single image to
* single image to commit, even if only one PutImage was perfor-
* commit, even if only one PutImage was perfor-
* med by the agent.
* med by the agent.
*/
*/
...
@@ -3059,8 +3034,8 @@ int nxagentHandleProxyEvent(XEvent *X)
...
@@ -3059,8 +3034,8 @@ int nxagentHandleProxyEvent(XEvent *X)
case
NXEndSplitNotify
:
case
NXEndSplitNotify
:
{
{
/*
/*
* All images for the split were transferred and
* All images for the split were transferred and
we need to
*
we need to
restart the client.
* restart the client.
*/
*/
int
client
=
(
int
)
X
->
xclient
.
data
.
l
[
1
];
int
client
=
(
int
)
X
->
xclient
.
data
.
l
[
1
];
...
@@ -3148,9 +3123,8 @@ int nxagentHandleProxyEvent(XEvent *X)
...
@@ -3148,9 +3123,8 @@ int nxagentHandleProxyEvent(XEvent *X)
}
}
/*
/*
* In this function it is assumed that we never
* In this function it is assumed that we never get a configure with
* get a configure with both stacking order and
* both stacking order and geometry changed, this way we can ignore
* geometry changed, this way we can ignore
* stacking changes if the geometry has changed.
* stacking changes if the geometry has changed.
*/
*/
...
@@ -3317,9 +3291,8 @@ int nxagentHandleConfigureNotify(XEvent* X)
...
@@ -3317,9 +3291,8 @@ int nxagentHandleConfigureNotify(XEvent* X)
nxagentCheckWindowConfiguration
((
XConfigureEvent
*
)
X
);
nxagentCheckWindowConfiguration
((
XConfigureEvent
*
)
X
);
/*
/*
* This workaround should help with
* This workaround should help with Java 1.6.0 that seems to
* Java 1.6.0 that seems to ignore
* ignore non-synthetic events.
* non-synthetic events.
*/
*/
if
(
nxagentOption
(
ClientOs
)
==
ClientOsWinnt
)
if
(
nxagentOption
(
ClientOs
)
==
ClientOsWinnt
)
...
@@ -3367,15 +3340,14 @@ int nxagentHandleConfigureNotify(XEvent* X)
...
@@ -3367,15 +3340,14 @@ int nxagentHandleConfigureNotify(XEvent* X)
else
else
{
{
/*
/*
* Save the position of the agent default window. Don't
* Save the position of the agent default window. Don't
save the
*
save the
values if the agent is in fullscreen mode.
* values if the agent is in fullscreen mode.
*
*
* If we use these values to restore the position of a
* If we use these values to restore the position of a window
* window after that we have dynamically changed the
* after that we have dynamically changed the fullscreen
* fullscreen attribute, depending on the behaviour of
* attribute, depending on the behaviour of window manager, we
* window manager, we could be not able to place the
* could be not able to place the window exactly in the requested
* window exactly in the requested position, so let the
* position, so let the window manager do the job for us.
* window manager do the job for us.
*/
*/
ScreenPtr
pScreen
=
nxagentScreen
(
X
->
xconfigure
.
window
);
ScreenPtr
pScreen
=
nxagentScreen
(
X
->
xconfigure
.
window
);
...
@@ -3584,9 +3556,8 @@ int nxagentHandleReparentNotify(XEvent* X)
...
@@ -3584,9 +3556,8 @@ int nxagentHandleReparentNotify(XEvent* X)
if
(
nxagentWindowTopLevel
(
pWin
))
if
(
nxagentWindowTopLevel
(
pWin
))
{
{
/*
/*
* If the window manager reparents our top level
* If the window manager reparents our top level window, we need
* window, we need to know the new top level
* to know the new top level ancestor.
* ancestor.
*/
*/
w
=
None
;
w
=
None
;
...
@@ -3919,10 +3890,9 @@ void nxagentGrabPointerAndKeyboard(XEvent *X)
...
@@ -3919,10 +3890,9 @@ void nxagentGrabPointerAndKeyboard(XEvent *X)
#endif
#endif
/*
/*
* The smart scheduler could be stopped while
* The smart scheduler could be stopped while waiting for the
* waiting for the reply. In this case we need
* reply. In this case we need to yield explicitly to avoid to be
* to yield explicitly to avoid to be stuck in
* stuck in the dispatch loop forever.
* the dispatch loop forever.
*/
*/
isItTimeToYield
=
1
;
isItTimeToYield
=
1
;
...
@@ -4355,9 +4325,8 @@ int nxagentClipAndSendExpose(WindowPtr pWin, void * ptr)
...
@@ -4355,9 +4325,8 @@ int nxagentClipAndSendExpose(WindowPtr pWin, void * ptr)
#endif
#endif
/*
/*
* The miWindowExposures() clears out the
* The miWindowExposures() clears out the region parameters, so
* region parameters, so the subtract ope-
* the subtract ope- ration must be done before calling it.
* ration must be done before calling it.
*/
*/
RegionSubtract
(
remoteExposeRgn
,
remoteExposeRgn
,
exposeRgn
);
RegionSubtract
(
remoteExposeRgn
,
remoteExposeRgn
,
exposeRgn
);
...
@@ -4391,13 +4360,10 @@ int nxagentUserInput(void *p)
...
@@ -4391,13 +4360,10 @@ int nxagentUserInput(void *p)
int
result
=
0
;
int
result
=
0
;
/*
/*
* This function is used as callback in
* This function is used as callback in the polling handler of agent
* the polling handler of agent in shadow
* in shadow mode. When inside the polling loop the handlers are
* mode. When inside the polling loop the
* never called, so we have to dispatch enqueued events to
* handlers are never called, so we have
* eventually change the nxagentInputEvent status.
* to dispatch enqueued events to eventu-
* ally change the nxagentInputEvent sta-
* tus.
*/
*/
if
(
nxagentOption
(
Shadow
)
==
1
&&
if
(
nxagentOption
(
Shadow
)
==
1
&&
...
@@ -4414,11 +4380,9 @@ int nxagentUserInput(void *p)
...
@@ -4414,11 +4380,9 @@ int nxagentUserInput(void *p)
}
}
/*
/*
* The agent working in shadow mode synch-
* The agent working in shadow mode synchronizes the remote X server
* ronizes the remote X server even if a
* even if a button/key is not released (i.e. when scrolling a long
* button/key is not released (i.e. when
* browser's page), in order to update the screen smoothly.
* scrolling a long browser's page), in
* order to update the screen smoothly.
*/
*/
if
(
nxagentOption
(
Shadow
)
==
1
)
if
(
nxagentOption
(
Shadow
)
==
1
)
...
@@ -4429,9 +4393,8 @@ int nxagentUserInput(void *p)
...
@@ -4429,9 +4393,8 @@ int nxagentUserInput(void *p)
if
(
result
==
0
)
if
(
result
==
0
)
{
{
/*
/*
* If there is at least one button/key down,
* If there is at least one button/key down, we are receiving an
* we are receiving an input. This is not a
* input. This is not a condition to break a synchronization loop
* condition to break a synchronization loop
* if there is enough bandwidth.
* if there is enough bandwidth.
*/
*/
...
@@ -4471,13 +4434,11 @@ int nxagentHandleRRScreenChangeNotify(XEvent *X)
...
@@ -4471,13 +4434,11 @@ int nxagentHandleRRScreenChangeNotify(XEvent *X)
}
}
/*
/*
* Returns true if there is any event waiting to
* Returns true if there is any event waiting to be dispatched. This
* be dispatched. This function is critical for
* function is critical for the performance because it is called very,
* the performance because it is called very,
* very often. It must also handle the case when the display is
* very often. It must also handle the case when
* down. The display descriptor, in fact, may have been reused by some
* the display is down. The display descriptor,
* other client.
* in fact, may have been reused by some other
* client.
*/
*/
int
nxagentPendingEvents
(
Display
*
dpy
)
int
nxagentPendingEvents
(
Display
*
dpy
)
...
...
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