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
b7169bdc
Commit
b7169bdc
authored
Jan 18, 2020
by
Ulrich Sibiller
Committed by
Mike Gabriel
May 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nxagent: make all traps Booleans
and use True/False instead of 1/0
parent
6d967988
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
100 additions
and
102 deletions
+100
-102
Drawable.c
nx-X11/programs/Xserver/hw/nxagent/Drawable.c
+10
-10
Events.c
nx-X11/programs/Xserver/hw/nxagent/Events.c
+18
-18
GC.c
nx-X11/programs/Xserver/hw/nxagent/GC.c
+1
-1
GCOps.c
nx-X11/programs/Xserver/hw/nxagent/GCOps.c
+1
-1
NXglxext.c
nx-X11/programs/Xserver/hw/nxagent/NXglxext.c
+2
-2
NXrender.c
nx-X11/programs/Xserver/hw/nxagent/NXrender.c
+4
-4
NXshm.c
nx-X11/programs/Xserver/hw/nxagent/NXshm.c
+8
-8
NXxvdisp.c
nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c
+4
-4
Pixmap.c
nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
+9
-9
Reconnect.c
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
+1
-1
Render.c
nx-X11/programs/Xserver/hw/nxagent/Render.c
+2
-2
Rootless.c
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
+2
-2
Trap.c
nx-X11/programs/Xserver/hw/nxagent/Trap.c
+30
-40
Trap.h
nx-X11/programs/Xserver/hw/nxagent/Trap.h
+8
-0
No files found.
nx-X11/programs/Xserver/hw/nxagent/Drawable.c
View file @
b7169bdc
...
...
@@ -160,15 +160,15 @@ int nxagentSynchronizeDrawable(DrawablePtr pDrawable, int wait, unsigned int bre
* so that the image will be transferred in a single operation.
*/
nxagentFBTrap
=
1
;
nxagentFBTrap
=
True
;
nxagentSplitTrap
=
1
;
nxagentSplitTrap
=
True
;
int
result
=
nxagentSynchronizeDrawableData
(
pDrawable
,
breakMask
,
owner
);
nxagentSplitTrap
=
0
;
nxagentSplitTrap
=
False
;
nxagentFBTrap
=
0
;
nxagentFBTrap
=
False
;
if
(
wait
==
DO_WAIT
&&
nxagentSplitResource
(
pDrawable
)
!=
NULL
)
{
...
...
@@ -495,11 +495,11 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
int
saveTrap
=
nxagentGCTrap
;
nxagentGCTrap
=
0
;
nxagentGCTrap
=
False
;
nxagentFBTrap
=
1
;
nxagentFBTrap
=
True
;
nxagentSplitTrap
=
1
;
nxagentSplitTrap
=
True
;
pGC
=
nxagentGetGraphicContext
(
pDrawable
);
...
...
@@ -839,9 +839,9 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
nxagentSynchronizeRegionStop:
nxagentSplitTrap
=
0
;
nxagentSplitTrap
=
False
;
nxagentFBTrap
=
0
;
nxagentFBTrap
=
False
;
nxagentGCTrap
=
saveTrap
;
...
...
@@ -2412,7 +2412,7 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable)
int
saveTrap
=
nxagentGCTrap
;
nxagentGCTrap
=
1
;
nxagentGCTrap
=
True
;
if
(
nxagentDrawableStatus
(
pDrawable
)
==
Synchronized
)
{
...
...
nx-X11/programs/Xserver/hw/nxagent/Events.c
View file @
b7169bdc
...
...
@@ -1142,17 +1142,17 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
{
if
(
X
.
xkey
.
keycode
==
nxagentCapsLockKeycode
)
{
nxagentXkbCapsTrap
=
1
;
nxagentXkbCapsTrap
=
True
;
}
else
if
(
X
.
xkey
.
keycode
==
nxagentNumLockKeycode
)
{
nxagentXkbNumTrap
=
1
;
nxagentXkbNumTrap
=
True
;
}
nxagentInitXkbKeyboardState
();
nxagentXkbCapsTrap
=
0
;
nxagentXkbNumTrap
=
0
;
nxagentXkbCapsTrap
=
False
;
nxagentXkbNumTrap
=
False
;
}
/* Calculate the time elapsed between this and the last event
...
...
@@ -1712,11 +1712,11 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
Mask
mask
=
CWX
|
CWY
;
nxagentScreenTrap
=
1
;
nxagentScreenTrap
=
True
;
ConfigureWindow
(
pWin
,
mask
,
(
XID
*
)
values
,
wClient
(
pWin
));
nxagentScreenTrap
=
0
;
nxagentScreenTrap
=
False
;
}
if
(
nxagentOption
(
Fullscreen
)
==
1
&&
...
...
@@ -2006,11 +2006,11 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
((
pWin
=
nxagentWindowPtr
(
X
.
xunmap
.
window
))
!=
NULL
&&
nxagentWindowTopLevel
(
pWin
)
==
1
))
{
nxagentScreenTrap
=
1
;
nxagentScreenTrap
=
True
;
UnmapWindow
(
pWin
,
False
);
nxagentScreenTrap
=
0
;
nxagentScreenTrap
=
False
;
}
}
...
...
@@ -2037,11 +2037,11 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
((
pWin
=
nxagentWindowPtr
(
X
.
xmap
.
window
))
!=
NULL
&&
nxagentWindowTopLevel
(
pWin
)
==
1
))
{
nxagentScreenTrap
=
1
;
nxagentScreenTrap
=
True
;
MapWindow
(
pWin
,
wClient
(
pWin
));
nxagentScreenTrap
=
0
;
nxagentScreenTrap
=
False
;
}
if
(
pWin
!=
NULL
)
...
...
@@ -2262,17 +2262,17 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result)
{
if
(
X
->
xkey
.
keycode
==
nxagentCapsLockKeycode
)
{
nxagentXkbCapsTrap
=
1
;
nxagentXkbCapsTrap
=
True
;
}
else
if
(
X
->
xkey
.
keycode
==
nxagentNumLockKeycode
)
{
nxagentXkbNumTrap
=
1
;
nxagentXkbNumTrap
=
True
;
}
nxagentInitXkbKeyboardState
();
nxagentXkbCapsTrap
=
0
;
nxagentXkbNumTrap
=
0
;
nxagentXkbCapsTrap
=
False
;
nxagentXkbNumTrap
=
False
;
}
if
(
nxagentCheckSpecialKeystroke
(
&
X
->
xkey
,
result
))
...
...
@@ -2900,9 +2900,9 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X)
* identify that situation during Callback processing we could
* get rid of the Trap...
*/
nxagentExternalClipboardEventTrap
=
1
;
nxagentExternalClipboardEventTrap
=
True
;
CallCallbacks
(
&
SelectionCallback
,
&
info
);
nxagentExternalClipboardEventTrap
=
0
;
nxagentExternalClipboardEventTrap
=
False
;
}
}
return
1
;
...
...
@@ -3199,11 +3199,11 @@ int nxagentHandleConfigureNotify(XEvent* X)
* nxagentWindowPriv(pWinWindow)->height = X -> xconfigure.height;
*/
nxagentScreenTrap
=
1
;
nxagentScreenTrap
=
True
;
ConfigureWindow
(
pWinWindow
,
mask
,
(
XID
*
)
values
,
wClient
(
pWinWindow
));
nxagentScreenTrap
=
0
;
nxagentScreenTrap
=
False
;
nxagentCheckWindowConfiguration
((
XConfigureEvent
*
)
X
);
...
...
nx-X11/programs/Xserver/hw/nxagent/GC.c
View file @
b7169bdc
...
...
@@ -1264,7 +1264,7 @@ GCPtr nxagentGetScratchGC(unsigned depth, ScreenPtr pScreen)
int
nxagentSaveGCTrap
=
nxagentGCTrap
;
nxagentGCTrap
=
0
;
nxagentGCTrap
=
False
;
GCPtr
pGC
=
GetScratchGC
(
depth
,
pScreen
);
...
...
nx-X11/programs/Xserver/hw/nxagent/GCOps.c
View file @
b7169bdc
...
...
@@ -80,7 +80,7 @@ static int nxagentSaveGCTrap;
{ \
nxagentSaveGCTrap = nxagentGCTrap;\
\
nxagentGCTrap =
1
; \
nxagentGCTrap =
True
; \
}
#define RESET_GC_TRAP() \
...
...
nx-X11/programs/Xserver/hw/nxagent/NXglxext.c
View file @
b7169bdc
...
...
@@ -64,7 +64,7 @@ static int __glXDispatch(ClientPtr client)
* dispatching a GLX operation.
*/
nxagentGlxTrap
=
1
;
nxagentGlxTrap
=
True
;
#ifdef TEST
fprintf
(
stderr
,
"__glXDispatch: Going to dispatch GLX operation [%d] for client [%d].
\n
"
,
...
...
@@ -73,7 +73,7 @@ static int __glXDispatch(ClientPtr client)
retval
=
xorg__glXDispatch
(
client
);
nxagentGlxTrap
=
0
;
nxagentGlxTrap
=
False
;
#ifdef TEST
fprintf
(
stderr
,
"__glXDispatch: Dispatched GLX operation [%d] for client [%d].
\n
"
,
...
...
nx-X11/programs/Xserver/hw/nxagent/NXrender.c
View file @
b7169bdc
...
...
@@ -1766,11 +1766,11 @@ ProcRenderDispatch (ClientPtr client)
* operation to avoid reentrancy in GCOps.c.
*/
nxagentGCTrap
=
1
;
nxagentGCTrap
=
True
;
int
result
=
xorg_ProcRenderDispatch
(
client
);
nxagentGCTrap
=
0
;
nxagentGCTrap
=
False
;
return
result
;
}
...
...
@@ -1793,11 +1793,11 @@ SProcRenderDispatch (ClientPtr client)
* operation to avoid reentrancy in GCOps.c.
*/
nxagentGCTrap
=
1
;
nxagentGCTrap
=
True
;
int
result
=
xorg_SProcRenderDispatch
(
client
);
nxagentGCTrap
=
0
;
nxagentGCTrap
=
False
;
return
result
;
}
nx-X11/programs/Xserver/hw/nxagent/NXshm.c
View file @
b7169bdc
...
...
@@ -171,11 +171,11 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
{
/* Careful! This wrapper DEACTIVATES the trap! */
nxagentShmTrap
=
0
;
nxagentShmTrap
=
False
;
xorg_miShmPutImage
(
dst
,
pGC
,
depth
,
format
,
w
,
h
,
sx
,
sy
,
sw
,
sh
,
dx
,
dy
,
data
);
nxagentShmTrap
=
1
;
nxagentShmTrap
=
True
;
return
;
}
...
...
@@ -439,11 +439,11 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr)
{
PixmapPtr
result
;
nxagentShmPixmapTrap
=
1
;
nxagentShmPixmapTrap
=
True
;
result
=
nxagent_fbShmCreatePixmap
(
pScreen
,
width
,
height
,
depth
,
addr
);
nxagentShmPixmapTrap
=
0
;
nxagentShmPixmapTrap
=
False
;
return
result
;
}
...
...
@@ -465,11 +465,11 @@ ProcShmDispatch (register ClientPtr client)
}
#endif
nxagentShmTrap
=
1
;
nxagentShmTrap
=
True
;
result
=
xorg_ProcShmDispatch
(
client
);
nxagentShmTrap
=
0
;
nxagentShmTrap
=
False
;
return
result
;
}
...
...
@@ -488,11 +488,11 @@ SProcShmDispatch (register ClientPtr client)
}
#endif
nxagentShmTrap
=
1
;
nxagentShmTrap
=
True
;
result
=
xorg_SProcShmDispatch
(
client
);
nxagentShmTrap
=
0
;
nxagentShmTrap
=
False
;
return
result
;
}
nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c
View file @
b7169bdc
...
...
@@ -79,11 +79,11 @@ ProcXvDispatch(ClientPtr client)
stuff
->
data
,
client
->
index
);
#endif
nxagentXvTrap
=
1
;
nxagentXvTrap
=
True
;
result
=
xorg_ProcXvDispatch
(
client
);
nxagentXvTrap
=
0
;
nxagentXvTrap
=
False
;
#ifdef TEST
fprintf
(
stderr
,
"ProcXvDispatch: Dispatched XVideo operation [%d] for client [%d].
\n
"
,
...
...
@@ -108,11 +108,11 @@ SProcXvDispatch(ClientPtr client)
stuff
->
data
,
client
->
index
);
#endif
nxagentXvTrap
=
1
;
nxagentXvTrap
=
True
;
result
=
xorg_SProcXvDispatch
(
client
);
nxagentXvTrap
=
0
;
nxagentXvTrap
=
False
;
#ifdef TEST
fprintf
(
stderr
,
"SProcXvDispatch: Dispatched XVideo operation [%d] for client [%d].
\n
"
,
...
...
nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
View file @
b7169bdc
...
...
@@ -157,7 +157,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height,
* synchronized with the remote X Server.
*/
if
(
pPixmapPriv
->
isShared
==
1
)
if
(
pPixmapPriv
->
isShared
)
{
BoxRec
box
=
{
.
x1
=
0
,
.
y1
=
0
,
.
x2
=
width
,
.
y2
=
height
};
...
...
@@ -773,11 +773,11 @@ void nxagentReconnectPixmap(void *p0, XID x1, void *p2)
return
;
}
nxagentSplitTrap
=
1
;
nxagentSplitTrap
=
True
;
*
pBool
=
nxagentSynchronizeDrawableData
((
DrawablePtr
)
pPixmap
,
NEVER_BREAK
,
NULL
);
nxagentSplitTrap
=
0
;
nxagentSplitTrap
=
False
;
if
(
!*
pBool
)
{
...
...
@@ -1095,13 +1095,13 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict,
int
length
=
nxagentImageLength
(
width
,
height
,
format
,
0
,
depth
);
int
saveTrap
=
nxagentGCTrap
;
Bool
saveTrap
=
nxagentGCTrap
;
nxagentGCTrap
=
0
;
nxagentGCTrap
=
False
;
nxagentSplitTrap
=
1
;
nxagentSplitTrap
=
True
;
nxagentFBTrap
=
1
;
nxagentFBTrap
=
True
;
char
*
data
=
malloc
(
length
);
...
...
@@ -1124,9 +1124,9 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict,
nxagentGCTrap
=
saveTrap
;
nxagentSplitTrap
=
0
;
nxagentSplitTrap
=
False
;
nxagentFBTrap
=
0
;
nxagentFBTrap
=
False
;
nxagentFreeScratchGC
(
pGC
);
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
View file @
b7169bdc
...
...
@@ -340,7 +340,7 @@ void nxagentInitializeRecLossyLevel(void)
void
nxagentInitReconnector
(
void
)
{
nxagentReconnectTrap
=
0
;
nxagentReconnectTrap
=
False
;
reconnectLossyLevel
[
DISPLAY_STEP
]
=
malloc
(
sizeof
(
int
));
reconnectLossyLevel
[
SCREEN_STEP
]
=
malloc
(
sizeof
(
int
));
...
...
nx-X11/programs/Xserver/hw/nxagent/Render.c
View file @
b7169bdc
...
...
@@ -532,11 +532,11 @@ void nxagentRenderRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
* if the cursor was already encoded with the best quality.
*/
nxagentLosslessTrap
=
1
;
nxagentLosslessTrap
=
True
;
nxagentSynchronizeDrawable
(
pPicture
->
pDrawable
,
DO_WAIT
,
NEVER_BREAK
,
NULL
);
nxagentLosslessTrap
=
0
;
nxagentLosslessTrap
=
False
;
nxagentCursor
(
pCursor
,
pScreen
)
=
XRenderCreateCursor
(
nxagentDisplay
,
nxagentPicture
(
pPicture
),
x
,
y
);
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
View file @
b7169bdc
...
...
@@ -341,9 +341,9 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
Mask
mask
=
CWSibling
|
CWStackMode
;
values
[
0
]
=
pWin
->
drawable
.
id
;
ClientPtr
pClient
=
wClient
(
toplevel
[
i
]);
nxagentScreenTrap
=
1
;
nxagentScreenTrap
=
True
;
ConfigureWindow
(
toplevel
[
i
],
mask
,
values
,
pClient
);
nxagentScreenTrap
=
0
;
nxagentScreenTrap
=
False
;
#ifdef TEST
fprintf
(
stderr
,
"%s: Restacked window [%p].
\n
"
,
__func__
,
(
void
*
)
toplevel
[
i
]);
...
...
nx-X11/programs/Xserver/hw/nxagent/Trap.c
View file @
b7169bdc
...
...
@@ -25,94 +25,84 @@
#include "Trap.h"
#include <nx-X11/Xdefs.h>
/*
* Set if we are dispatching a render
* extension request. Used to avoid
* Set if we are dispatching a render extension request. Used to avoid
* reentrancy in GC operations.
*/
int
nxagentGCTrap
=
0
;
Bool
nxagentGCTrap
=
False
;
/*
* Set if we are enqueing an internal
* operation, CreateWindow and Reparent-
* Window. Used to remove any screen operation.
* Set if we are enqueing an internal operation, CreateWindow and
* Reparent- Window. Used to remove any screen operation.
*/
int
nxagentScreenTrap
=
0
;
Bool
nxagentScreenTrap
=
False
;
/*
* Set if we are executing a GC operation
* only on the X side. Used to avoid
* reentrancy in FB layer.
* Set if we are executing a GC operation only on the X side. Used to
* avoid reentrancy in FB layer.
*/
int
nxagentFBTrap
=
0
;
Bool
nxagentFBTrap
=
False
;
/*
* Set if we are dispatching a shared
* memory extension request.
* Set if we are dispatching a shared memory extension request.
*/
int
nxagentShmTrap
=
0
;
Bool
nxagentShmTrap
=
False
;
/*
* Set if a shared pixmap operation is
* requested by the client.
* Set if a shared pixmap operation is requested by the client.
*/
int
nxagentShmPixmapTrap
=
0
;
Bool
nxagentShmPixmapTrap
=
False
;
/*
* Set if we are dispatching a XVideo
* extension request.
* Set if we are dispatching a XVideo extension request.
*/
int
nxagentXvTrap
=
0
;
Bool
nxagentXvTrap
=
False
;
/*
* Set if we are dispatching a GLX
* extension request.
* Set if we are dispatching a GLX extension request.
*/
int
nxagentGlxTrap
=
0
;
Bool
nxagentGlxTrap
=
False
;
/*
* Set while we are resuming the session.
*/
int
nxagentReconnectTrap
=
0
;
Bool
nxagentReconnectTrap
=
False
;
/*
* Set if we need to realize a drawable
* by using a lossless encoding.
* Set if we need to realize a drawable by using a lossless encoding.
*/
int
nxagentLosslessTrap
=
0
;
Bool
nxagentLosslessTrap
=
False
;
/*
* Set to force the synchronization of
* a drawable.
* Set to force the synchronization of a drawable.
*/
int
nxagentSplitTrap
=
0
;
Bool
nxagentSplitTrap
=
False
;
/*
* Set to avoid CapsLock synchronization
* problems when CapsLock is the first
* key to be pressed in the session.
* Set to avoid CapsLock synchronization problems when CapsLock is the
* first key to be pressed in the session.
*/
int
nxagentXkbCapsTrap
=
0
;
Bool
nxagentXkbCapsTrap
=
False
;
/*
* Set to avoid NumLock synchronization
* problems when NumLock is the first
* key to be pressed in the session.
* Set to avoid NumLock synchronization problems when NumLock is the
* first key to be pressed in the session.
*/
int
nxagentXkbNumTrap
=
0
;
Bool
nxagentXkbNumTrap
=
False
;
/*
* Set to indicate we are processing a clipboard event triggered by
...
...
@@ -120,4 +110,4 @@ int nxagentXkbNumTrap = 0;
* would trigger another event by the real X server
*/
int
nxagentExternalClipboardEventTrap
=
0
;
Bool
nxagentExternalClipboardEventTrap
=
False
;
nx-X11/programs/Xserver/hw/nxagent/Trap.h
View file @
b7169bdc
...
...
@@ -26,6 +26,14 @@
#ifndef __Traps_H__
#define __Traps_H__
#ifndef False
#define False 0
#endif
#ifndef True
#define True 1
#endif
/*
* Set if we are dispatching a render extension request. Used to avoid
* reentrancy in GC operations.
...
...
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