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
6d404964
Unverified
Commit
6d404964
authored
Feb 27, 2018
by
Mihai Moldovan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sunweaver-pr/autodetect-dpi' into 3.6.x
Attributes GH PR #522:
https://github.com/ArcticaProject/nx-libs/pull/522
parents
a88ca271
29c166db
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
92 additions
and
7 deletions
+92
-7
Args.c
nx-X11/programs/Xserver/hw/nxagent/Args.c
+27
-0
Extensions.c
nx-X11/programs/Xserver/hw/nxagent/Extensions.c
+14
-3
Screen.c
nx-X11/programs/Xserver/hw/nxagent/Screen.c
+39
-3
nxagent.1
nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1
+8
-0
Loop.cpp
nxcomp/src/Loop.cpp
+2
-1
Misc.cpp
nxcomp/src/Misc.cpp
+1
-0
nxproxy.1
nxproxy/man/nxproxy.1
+1
-0
No files found.
nx-X11/programs/Xserver/hw/nxagent/Args.c
View file @
6d404964
...
...
@@ -130,6 +130,8 @@ char nxagentDisplayName[NXAGENTDISPLAYNAMELENGTH];
Bool
nxagentSynchronize
=
False
;
Bool
nxagentRealWindowProp
=
False
;
Bool
nxagentAutoDPI
=
False
;
char
nxagentShadowDisplayName
[
NXAGENTSHADOWDISPLAYNAMELENGTH
]
=
{
0
};
char
nxagentWindowName
[
NXAGENTWINDOWNAMELENGTH
];
...
...
@@ -743,6 +745,11 @@ int ddxProcessArgument(int argc, char *argv[], int i)
return
1
;
}
if
(
!
strcmp
(
argv
[
i
],
"-autodpi"
))
{
nxagentAutoDPI
=
True
;
return
1
;
}
/*
* The original -noreset option, disabling
* dispatchExceptionAtReset, is the default.
...
...
@@ -1271,6 +1278,25 @@ static void nxagentParseOptions(char *name, char *value)
return
;
}
else
if
(
!
strcmp
(
name
,
"autodpi"
))
{
if
(
nxagentReconnectTrap
==
True
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"nxagentParseOptions: Ignoring option 'autodpi' at reconnection.
\n
"
);
#endif
}
else
if
(
!
strcmp
(
value
,
"0"
))
{
nxagentAutoDPI
=
False
;
}
else
{
nxagentAutoDPI
=
True
;
}
return
;
}
else
if
(
strcmp
(
name
,
"shadowuid"
)
==
0
)
{
nxagentShadowUid
=
atoi
(
value
);
...
...
@@ -2091,6 +2117,7 @@ void ddxUseMsg(void)
ErrorF
(
"-class string default visual class
\n
"
);
ErrorF
(
"-depth int default depth
\n
"
);
ErrorF
(
"-geometry WxH+X+Y window size and position
\n
"
);
ErrorF
(
"-autodpi detect real server's DPI and use that in the session
\n
"
);
ErrorF
(
"-bw int window border width
\n
"
);
ErrorF
(
"-name string window name
\n
"
);
ErrorF
(
"-scrns int number of screens to generate
\n
"
);
...
...
nx-X11/programs/Xserver/hw/nxagent/Extensions.c
View file @
6d404964
...
...
@@ -338,15 +338,26 @@ static int nxagentRandRInitSizes(ScreenPtr pScreen)
width
=
w
[
i
];
height
=
h
[
i
];
mmWidth
=
(
width
*
254
+
monitorResolution
*
5
)
/
(
monitorResolution
*
10
);
if
(
monitorResolution
<
0
)
{
mmWidth
=
width
*
DisplayWidthMM
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
))
/
DisplayWidth
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
));
mmHeight
=
height
*
DisplayHeightMM
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
))
/
DisplayHeight
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
));
}
else
{
mmWidth
=
(
width
*
254
+
monitorResolution
*
5
)
/
(
monitorResolution
*
10
);
mmHeight
=
(
height
*
254
+
monitorResolution
*
5
)
/
(
monitorResolution
*
10
);
}
if
(
mmWidth
<
1
)
{
mmWidth
=
1
;
}
mmHeight
=
(
height
*
254
+
monitorResolution
*
5
)
/
(
monitorResolution
*
10
);
if
(
mmHeight
<
1
)
{
mmHeight
=
1
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Screen.c
View file @
6d404964
...
...
@@ -210,6 +210,9 @@ void nxagentShadowAdaptDepth(unsigned int, unsigned int, unsigned int, char **);
RegionRec
nxagentShadowUpdateRegion
;
#define NXAGENT_DEFAULT_DPI 75
#define NXAGENT_AUTO_DPI -1
extern
Bool
nxagentAutoDPI
;
/*
* From randr/randr.c. This was originally static
...
...
@@ -1327,10 +1330,14 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
rootDepth
,
(
long
unsigned
int
)
defaultVisual
);
#endif
if
(
monitorResolution
<
1
)
if
(
(
monitorResolution
<
1
)
&&
(
nxagentAutoDPI
==
False
)
)
{
monitorResolution
=
NXAGENT_DEFAULT_DPI
;
}
else
if
((
monitorResolution
<
1
)
&&
(
nxagentAutoDPI
==
True
))
{
monitorResolution
=
NXAGENT_AUTO_DPI
;
}
if
(
!
fbScreenInit
(
pScreen
,
pFrameBufferBits
,
nxagentOption
(
RootWidth
),
nxagentOption
(
RootHeight
),
monitorResolution
,
monitorResolution
,
PixmapBytePad
(
nxagentOption
(
RootWidth
),
rootDepth
),
bitsPerPixel
))
...
...
@@ -1474,6 +1481,17 @@ N/A
* return FALSE;
*/
if
(
monitorResolution
<
0
)
{
pScreen
->
mmWidth
=
nxagentOption
(
RootWidth
)
*
DisplayWidthMM
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
))
/
DisplayWidth
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
));
pScreen
->
mmHeight
=
nxagentOption
(
RootHeight
)
*
DisplayHeightMM
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
))
/
DisplayHeight
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
));
}
pScreen
->
defColormap
=
(
Colormap
)
FakeClientID
(
0
);
pScreen
->
minInstalledCmaps
=
MINCMAPS
;
pScreen
->
maxInstalledCmaps
=
MAXCMAPS
;
...
...
@@ -2294,22 +2312,40 @@ Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height,
if
(
mmWidth
==
0
)
{
mmWidth
=
(
width
*
254
+
monitorResolution
*
5
)
/
(
monitorResolution
*
10
);
if
(
monitorResolution
<
0
)
{
mmWidth
=
width
*
DisplayWidthMM
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
))
/
DisplayWidth
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
));
}
else
{
mmWidth
=
(
width
*
254
+
monitorResolution
*
5
)
/
(
monitorResolution
*
10
);
}
if
(
mmWidth
<
1
)
{
mmWidth
=
1
;
}
}
if
(
mmHeight
==
0
)
{
mmHeight
=
(
height
*
254
+
monitorResolution
*
5
)
/
(
monitorResolution
*
10
);
if
(
monitorResolution
<
0
)
{
mmHeight
=
height
*
DisplayHeightMM
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
))
/
DisplayHeight
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
));
}
else
{
mmHeight
=
(
height
*
254
+
monitorResolution
*
5
)
/
(
monitorResolution
*
10
);
}
if
(
mmHeight
<
1
)
{
mmHeight
=
1
;
}
}
pScreen
->
mmWidth
=
mmWidth
;
...
...
nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1
View file @
6d404964
...
...
@@ -393,6 +393,9 @@ auto-disconnect timeout in seconds (minimum allowed: 60)
.B \-norootlessexit
don't exit if there are no clients in rootless mode
.TP 8
.B \-autodpi
detect real server's DPI and set it in the agent session; the \fI-dpi <dpi>\fR cmdline option overrides \fI-autodpi\fR
.TP 8
.B \-nomagicpixel
disable magic pixel support at session startup, can be re-enabled via nx/nx option on session
resumption
...
...
@@ -603,6 +606,11 @@ proxy <-> agent remote sessions)
.B magicpixel=<bool>
enable/disable magic pixel support in fullscreen mode (default: 1, enabled)
.TP 8
.B autodpi=<bool>
enable/disable deriving session DPI automatically from real server
(default: 0, disabled); only takes effect on session startups, gets
ignored when reconnecting to a suspended session
.TP 8
.B sleep=<int>
delay X server operations when suspended (provided in msec), set to
\fI0\fR to keep \fBnxagent\fR session fully functional when suspended
...
...
nxcomp/src/Loop.cpp
View file @
6d404964
...
...
@@ -8476,7 +8476,8 @@ int ParseEnvironmentOptions(const char *env, int force)
strcasecmp
(
name
,
"tile"
)
==
0
||
strcasecmp
(
name
,
"menu"
)
==
0
||
strcasecmp
(
name
,
"magicpixel"
)
==
0
||
strcasecmp
(
name
,
"state"
)
==
0
)
strcasecmp
(
name
,
"autodpi"
)
==
0
||
strcasecmp
(
name
,
"state"
)
==
0
)
{
nxdbg
<<
"Loop: Ignoring agent option '"
<<
name
<<
"' with value '"
<<
value
<<
"'.
\n
"
...
...
nxcomp/src/Misc.cpp
View file @
6d404964
...
...
@@ -344,6 +344,7 @@ defer=n\n\
tile=s
\n
\
menu=n
\n
\
magicpixel=n
\n
\
autodpi=n
\n
\
sleep=n
\n
\
tolerancechecks=s
\n
\
keyconv=s
\n
\
...
...
nxproxy/man/nxproxy.1
View file @
6d404964
...
...
@@ -328,6 +328,7 @@ encryption of the point to point communication.
tile=<string>
menu=<int>
magicpixel=<bool>
autodpi=<bool>
sleep=<int>
.SH NX ENVIRONMENT VARIABLES
...
...
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