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
141d6bea
Commit
141d6bea
authored
Jan 03, 2020
by
Ulrich Sibiller
Committed by
Mike Gabriel
Jan 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display.c: scope improvements
parent
89280481
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
33 deletions
+23
-33
Display.c
nx-X11/programs/Xserver/hw/nxagent/Display.c
+23
-33
No files found.
nx-X11/programs/Xserver/hw/nxagent/Display.c
View file @
141d6bea
...
...
@@ -561,11 +561,6 @@ static void nxagentSigchldHandler(int signal)
Display
*
nxagentInternalOpenDisplay
(
char
*
display
)
{
struct
sigaction
oldAction
;
struct
sigaction
newAction
;
int
result
;
/*
* Stop the smart schedule timer since it uses SIGALRM as we do.
*/
...
...
@@ -583,12 +578,17 @@ FIXME: Should print a warning if the user tries to let the agent
explanation for the error to the user.
*/
newAction
.
sa_handler
=
nxagentRejectConnection
;
struct
sigaction
newAction
=
{
.
sa_handler
=
nxagentRejectConnection
};
sigfillset
(
&
newAction
.
sa_mask
);
newAction
.
sa_flags
=
0
;
int
result
;
struct
sigaction
oldAction
;
while
(((
result
=
sigaction
(
SIGALRM
,
&
newAction
,
&
oldAction
))
==
-
1
)
&&
(
errno
==
EINTR
));
...
...
@@ -925,8 +925,6 @@ void nxagentInstallSignalHandlers(void)
struct
sigaction
newAction
;
int
result
;
/*
* By default nxcomp installs its signal handlers. We need to
* ensure that SIGUSR1 and SIGUSR2 are ignored if the NX transport
...
...
@@ -939,6 +937,8 @@ void nxagentInstallSignalHandlers(void)
newAction
.
sa_flags
=
0
;
int
result
;
while
(((
result
=
sigaction
(
SIGUSR1
,
&
newAction
,
NULL
))
==
-
1
)
&&
(
errno
==
EINTR
));
...
...
@@ -1054,12 +1054,6 @@ void nxagentPostInstallSignalHandlers(void)
void
nxagentResetSignalHandlers
(
void
)
{
struct
sigaction
newAction
;
int
result
;
memset
(
&
newAction
,
0
,
sizeof
(
newAction
));
/*
* Reset the signal handlers to a well known state.
*/
...
...
@@ -1074,10 +1068,13 @@ void nxagentResetSignalHandlers(void)
nxagentStopTimer
();
newAction
.
sa_handler
=
SIG_DFL
;
struct
sigaction
newAction
=
{
.
sa_handler
=
SIG_DFL
};
sigfillset
(
&
newAction
.
sa_mask
);
int
result
;
while
(((
result
=
sigaction
(
SIGALRM
,
&
newAction
,
NULL
))
==
-
1
)
&&
(
errno
==
EINTR
));
...
...
@@ -1100,12 +1097,9 @@ void nxagentOpenDisplay(int argc, char *argv[])
return
;
#ifdef NXAGENT_TIMESTAMP
startTime
=
GetTimeInMillis
();
fprintf
(
stderr
,
"Display: Opening the display on real X server with time [%d] ms.
\n
"
,
GetTimeInMillis
()
-
startTime
);
#endif
/*
...
...
@@ -1175,10 +1169,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
#endif
#ifdef NXAGENT_TIMESTAMP
fprintf
(
stderr
,
"Display: Display on real X server opened with time [%d] ms.
\n
"
,
GetTimeInMillis
()
-
startTime
);
#endif
nxagentUseNXTrans
=
...
...
@@ -1397,10 +1389,8 @@ N/A
#endif
#ifdef NXAGENT_TIMESTAMP
fprintf
(
stderr
,
"Display: Open of the display finished with time [%d] ms.
\n
"
,
GetTimeInMillis
()
-
startTime
);
#endif
if
(
nxagentOption
(
Persistent
))
...
...
@@ -1435,10 +1425,11 @@ void nxagentSetDefaultVisual(void)
}
else
{
XVisualInfo
vi
=
{
0
};
XVisualInfo
vi
=
{
.
visualid
=
XVisualIDFromVisual
(
DefaultVisual
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
)))
};
vi
.
visualid
=
XVisualIDFromVisual
(
DefaultVisual
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
)));
nxagentDefaultVisualIndex
=
0
;
for
(
int
i
=
0
;
i
<
nxagentNumVisuals
;
i
++
)
...
...
@@ -1453,14 +1444,13 @@ void nxagentSetDefaultVisual(void)
void
nxagentInitVisuals
(
void
)
{
long
mask
=
VisualScreenMask
;
XVisualInfo
vi
=
{
.
screen
=
DefaultScreen
(
nxagentDisplay
),
.
depth
=
DefaultDepth
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
))
,
.
depth
=
DefaultDepth
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
))
};
long
mask
=
VisualScreenMask
;
int
viNumList
;
XVisualInfo
*
viList
=
XGetVisualInfo
(
nxagentDisplay
,
mask
,
&
vi
,
&
viNumList
);
nxagentVisuals
=
(
XVisualInfo
*
)
malloc
(
viNumList
*
sizeof
(
XVisualInfo
));
nxagentNumVisuals
=
0
;
...
...
@@ -1566,7 +1556,6 @@ XXX: Some X server doesn't list 1 among available depths...
if
(
nxagentDepths
[
j
]
==
i
)
{
depth
=
i
;
break
;
}
}
...
...
@@ -1751,7 +1740,7 @@ Bool nxagentMakeIcon(Display *display, Pixmap *nxIcon, Pixmap *nxMask)
/*
* selecting x2go icon when running as X2Go agent
*/
if
(
nxagentX2go
)
if
(
nxagentX2go
)
{
agentIconData
=
x2goagentIconData
;
}
...
...
@@ -2249,6 +2238,9 @@ static int nxagentInitAndCheckVisuals(int flexibility)
{
/* FIXME: does this also need work? */
bool
matched
;
bool
compatible
=
true
;
long
viMask
=
VisualScreenMask
;
XVisualInfo
viTemplate
=
{
.
screen
=
DefaultScreen
(
nxagentDisplay
),
...
...
@@ -2259,8 +2251,6 @@ static int nxagentInitAndCheckVisuals(int flexibility)
XVisualInfo
*
newVisuals
=
malloc
(
sizeof
(
XVisualInfo
)
*
nxagentNumVisuals
);
bool
compatible
=
true
;
for
(
int
i
=
0
;
i
<
nxagentNumVisuals
;
i
++
)
{
bool
matched
=
false
;
...
...
@@ -2472,7 +2462,7 @@ Bool nxagentReconnectDisplay(void *p0)
nxagentNumDefaultColormaps
=
nxagentNumVisuals
;
nxagentDefaultColormaps
=
(
Colormap
*
)
realloc
(
nxagentDefaultColormaps
,
nxagentNumDefaultColormaps
*
sizeof
(
Colormap
));
nxagentNumDefaultColormaps
*
sizeof
(
Colormap
));
if
(
nxagentDefaultColormaps
==
NULL
)
{
...
...
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