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
d9e4526b
Commit
d9e4526b
authored
Feb 19, 2020
by
Ulrich Sibiller
Committed by
Mike Gabriel
May 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display.c: filter remote Pixmap formats before doing the compatiblity check
Fixes: ArcticaProject/nx-libs#635
parent
13f97cbc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
5 deletions
+75
-5
Display.c
nx-X11/programs/Xserver/hw/nxagent/Display.c
+75
-5
No files found.
nx-X11/programs/Xserver/hw/nxagent/Display.c
View file @
d9e4526b
...
...
@@ -1553,6 +1553,7 @@ void nxagentInitPixmapFormats(void)
*/
nxagentNumPixmapFormats
=
0
;
nxagentRemoteNumPixmapFormats
=
0
;
/*
XXX: Some X server doesn't list 1 among available depths...
...
...
@@ -1602,28 +1603,97 @@ XXX: Some X server doesn't list 1 among available depths...
}
}
nxagentRemotePixmapFormats
=
XListPixmapFormats
(
nxagentDisplay
,
&
nxagentRemoteNumPixmapFormats
);
/*
* we need to filter the list of remote pixmap formats by our
* supported depths, just like above. If we do not perform this step
* nxagentCheckForPixmapFormatsCompatibility will fail when
* tolerance is "strict" (the default). This becomes evident when
* Xephyr or Xnest are used as the real X server. They normally show
* only two supported depths but 7 supported pixmap formats (which
* could be a bug there).
*/
if
(
nxagentRemotePixmapFormats
==
NULL
)
int
tmpnum
=
0
;
XPixmapFormatValues
*
tmp
=
XListPixmapFormats
(
nxagentDisplay
,
&
tmpnum
);
if
(
tmp
==
NULL
)
{
#ifdef WARNING
fprintf
(
stderr
,
"nxagentInitPixmapFormats: WARNING! Failed to get available remote pixmap formats.
\n
"
);
#endif
nxagentRemotePixmapFormats
=
NULL
;
}
#ifdef TEST
else
{
#ifdef TEST
fprintf
(
stderr
,
"nxagentInitPixmapFormats: Got [%d] available remote pixmap formats:
\n
"
,
nxagentRemoteNumPixmapFormats
);
tmpnum
);
for
(
int
i
=
0
;
i
<
tmpnum
;
i
++
)
{
fprintf
(
stderr
,
"nxagentInitPixmapFormats: Found remote pixmap format [%d]: depth [%d] "
"bits_per_pixel [%d] scanline_pad [%d].
\n
"
,
i
,
tmp
[
i
].
depth
,
tmp
[
i
].
bits_per_pixel
,
tmp
[
i
].
scanline_pad
);
}
#endif
SAFE_XFree
(
tmp
);
nxagentRemotePixmapFormats
=
malloc
((
nxagentNumDepths
+
1
)
*
sizeof
(
XPixmapFormatValues
));
for
(
int
i
=
1
;
i
<=
MAXDEPTH
;
i
++
)
{
int
depth
=
0
;
if
(
i
==
1
)
{
depth
=
1
;
}
else
{
for
(
int
j
=
0
;
j
<
nxagentNumDepths
;
j
++
)
{
if
(
nxagentDepths
[
j
]
==
i
)
{
depth
=
i
;
break
;
}
}
}
if
(
depth
!=
0
)
{
if
(
nxagentRemoteNumPixmapFormats
>=
MAXFORMATS
)
{
FatalError
(
"nxagentInitPixmapFormats: MAXFORMATS is too small for this remote server.
\n
"
);
}
nxagentRemotePixmapFormats
[
nxagentRemoteNumPixmapFormats
].
depth
=
depth
;
nxagentRemotePixmapFormats
[
nxagentRemoteNumPixmapFormats
].
bits_per_pixel
=
nxagentBitsPerPixel
(
depth
);
nxagentRemotePixmapFormats
[
nxagentRemoteNumPixmapFormats
].
scanline_pad
=
BITMAP_SCANLINE_PAD
;
#ifdef TEST
fprintf
(
stderr
,
"nxagentInitPixmapFormats: Suitable remote format [%d] to depth [%d] "
"bits per pixel [%d] scanline pad [%d].
\n
"
,
nxagentRemoteNumPixmapFormats
,
depth
,
nxagentRemotePixmapFormats
[
nxagentRemoteNumPixmapFormats
].
bits_per_pixel
,
BITMAP_SCANLINE_PAD
);
#endif
nxagentRemoteNumPixmapFormats
++
;
}
}
#ifdef TEST
for
(
int
i
=
0
;
i
<
nxagentRemoteNumPixmapFormats
;
i
++
)
{
fprintf
(
stderr
,
"nxagentInitPixmapFormats: Remote pixmap format [%d]: depth [%d] "
"bits_per_pixel [%d] scanline_pad [%d].
\n
"
,
i
,
nxagentRemotePixmapFormats
[
i
].
depth
,
nxagentRemotePixmapFormats
[
i
].
bits_per_pixel
,
nxagentRemotePixmapFormats
[
i
].
scanline_pad
);
}
}
#endif
}
}
void
nxagentSetDefaultDrawables
(
void
)
...
...
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