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
2ada71fb
Commit
2ada71fb
authored
May 25, 2020
by
Ulrich Sibiller
Committed by
Mike Gabriel
Oct 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Screen.c: simplify nxagentResizeScreen
parent
1af470a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
Screen.c
nx-X11/programs/Xserver/hw/nxagent/Screen.c
+13
-12
No files found.
nx-X11/programs/Xserver/hw/nxagent/Screen.c
View file @
2ada71fb
...
...
@@ -2310,26 +2310,25 @@ Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height,
pScreen
->
height
=
height
;
/*
* Compute screen dimensions if they aren't
given
.
* Compute screen dimensions if they aren't
provided
.
*/
if
(
mmWidth
==
0
)
{
if
(
monitorResolution
<
0
)
{
mmWidth
=
width
*
DisplayWidthMM
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
))
/
DisplayWidth
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
));
mmWidth
=
width
*
DisplayWidthMM
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
))
/
DisplayWidth
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
));
}
else
{
mmWidth
=
(
width
*
254
+
monitorResolution
*
5
)
/
(
monitorResolution
*
10
);
mmWidth
=
(
width
*
254
+
monitorResolution
*
5
)
/
(
monitorResolution
*
10
);
}
if
(
mmWidth
<
1
)
{
mmWidth
=
1
;
}
}
if
(
mmHeight
==
0
)
...
...
@@ -2348,7 +2347,6 @@ Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height,
{
mmHeight
=
1
;
}
}
pScreen
->
mmWidth
=
mmWidth
;
...
...
@@ -2362,14 +2360,9 @@ Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height,
PixmapPtr
pPixmap
=
fbGetScreenPixmap
(
pScreen
);
char
*
fbBits
=
realloc
(
pPixmap
->
devPrivate
.
ptr
,
PixmapBytePad
(
width
,
pScreen
->
rootDepth
)
*
height
*
BitsPerPixel
(
pScreen
->
rootDepth
)
/
8
);
height
*
BitsPerPixel
(
pScreen
->
rootDepth
)
/
8
);
if
(
fbBits
==
NULL
)
{
pScreen
->
width
=
oldWidth
;
pScreen
->
height
=
oldHeight
;
pScreen
->
mmWidth
=
oldMmWidth
;
pScreen
->
mmHeight
=
oldMmHeight
;
goto
nxagentResizeScreenError
;
}
...
...
@@ -2481,6 +2474,14 @@ FIXME: We should try to restore the previously
return
1
;
nxagentResizeScreenError:
#ifdef DEBUG
fprintf
(
stderr
,
"%s: nxagentResizeScreenError
\n
"
,
__func__
);
#endif
pScreen
->
width
=
oldWidth
;
pScreen
->
height
=
oldHeight
;
pScreen
->
mmWidth
=
oldMmWidth
;
pScreen
->
mmHeight
=
oldMmHeight
;
return
0
;
}
...
...
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