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
c5f3c204
You need to sign in or sign up before continuing.
Unverified
Commit
c5f3c204
authored
Dec 13, 2017
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/pre-rrxinerama-fallback' into 3.6.x
Attributes GH PR #602:
https://github.com/ArcticaProject/nx-libs/pull/602
parents
73c113ce
bd1ca625
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
21 deletions
+100
-21
Extensions.c
nx-X11/programs/Xserver/hw/nxagent/Extensions.c
+1
-1
Screen.c
nx-X11/programs/Xserver/hw/nxagent/Screen.c
+99
-20
No files found.
nx-X11/programs/Xserver/hw/nxagent/Extensions.c
View file @
c5f3c204
...
...
@@ -136,7 +136,7 @@ void nxagentInitRandRExtension(ScreenPtr pScreen)
pRandRScrPriv
=
rrGetScrPriv
(
pScreen
);
pRandRScrPriv
->
rrGetInfo
=
nxagentRandRGetInfo
;
pRandRScrPriv
->
rrGetInfo
=
nxagentRandRGetInfo
;
#if RANDR_15_INTERFACE
/* nothing to be assigned here, so far */
...
...
nx-X11/programs/Xserver/hw/nxagent/Screen.c
View file @
c5f3c204
...
...
@@ -3666,11 +3666,88 @@ Bool intersect_bb(int ax1, int ay1, unsigned int aw, unsigned int ah,
}
#endif
RRModePtr
nxagentRRCustomMode
=
NULL
;
/*
This is basically the code that was used on screen resize before
xinerama was implemented. We need it as fallback if the user
disables xinerama
*/
void
nxagentAdjustCustomMode
(
ScreenPtr
pScreen
)
{
rrScrPrivPtr
pScrPriv
=
rrGetScrPriv
(
pScreen
);
RROutputPtr
output
;
if
(
pScrPriv
)
{
output
=
RRFirstOutput
(
pScreen
);
if
(
output
&&
output
->
crtc
)
{
RRCrtcPtr
crtc
;
char
name
[
100
];
xRRModeInfo
modeInfo
;
const
int
refresh
=
60
;
int
width
=
nxagentOption
(
Width
);
int
height
=
nxagentOption
(
Height
);
crtc
=
output
->
crtc
;
for
(
int
c
=
0
;
c
<
pScrPriv
->
numCrtcs
;
c
++
)
{
RRCrtcSet
(
pScrPriv
->
crtcs
[
c
],
NULL
,
0
,
0
,
RR_Rotate_0
,
0
,
NULL
);
}
memset
(
&
modeInfo
,
'\0'
,
sizeof
(
modeInfo
));
sprintf
(
name
,
"%dx%d"
,
width
,
height
);
modeInfo
.
width
=
width
;
modeInfo
.
height
=
height
;
modeInfo
.
hTotal
=
width
;
modeInfo
.
vTotal
=
height
;
modeInfo
.
dotClock
=
((
CARD32
)
width
*
(
CARD32
)
height
*
(
CARD32
)
refresh
);
modeInfo
.
nameLength
=
strlen
(
name
);
if
(
nxagentRRCustomMode
!=
NULL
)
{
RROutputDeleteUserMode
(
output
,
nxagentRRCustomMode
);
FreeResource
(
nxagentRRCustomMode
->
mode
.
id
,
0
);
if
(
crtc
!=
NULL
&&
crtc
->
mode
==
nxagentRRCustomMode
)
{
RRCrtcSet
(
crtc
,
NULL
,
0
,
0
,
RR_Rotate_0
,
0
,
NULL
);
}
#ifdef TEST
fprintf
(
stderr
,
"%s: Going to destroy mode %p with refcnt %d.
\n
"
,
__func__
,
nxagentRRCustomMode
,
nxagentRRCustomMode
->
refcnt
);
#endif
RRModeDestroy
(
nxagentRRCustomMode
);
}
nxagentRRCustomMode
=
RRModeGet
(
&
modeInfo
,
name
);
RROutputAddUserMode
(
output
,
nxagentRRCustomMode
);
RRCrtcSet
(
crtc
,
nxagentRRCustomMode
,
0
,
0
,
RR_Rotate_0
,
1
,
&
output
);
RROutputChanged
(
output
,
1
);
}
pScrPriv
->
lastSetTime
=
currentTime
;
pScrPriv
->
changed
=
1
;
pScrPriv
->
configChanged
=
1
;
}
/* if (pScrPriv) */
RRScreenSizeNotify
(
pScreen
);
}
int
nxagentChangeScreenConfig
(
int
screen
,
int
width
,
int
height
,
int
mmWidth
,
int
mmHeight
)
{
ScreenPtr
pScreen
;
/* FIXME: when is this needed? */
int
doNotify
=
TRUE
;
int
r
;
#ifdef DEBUG
...
...
@@ -3726,12 +3803,18 @@ int nxagentChangeScreenConfig(int screen, int width, int height, int mmWidth, in
if
(
r
!=
0
)
{
nxagentAdjustRandRXinerama
(
pScreen
);
}
if
(
nxagentOption
(
Xinerama
))
{
nxagentAdjustRandRXinerama
(
pScreen
);
}
else
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Xinerama is disabled
\n
"
,
__func__
);
#endif
if
(
doNotify
)
{
RRScreenSizeNotify
(
pScreen
);
nxagentAdjustCustomMode
(
pScreen
);
}
}
#ifdef DEBUG
...
...
@@ -3782,24 +3865,20 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen)
XineramaScreenInfo
*
screeninfo
=
NULL
;
if
(
nxagentOption
(
Xinerama
))
{
screeninfo
=
XineramaQueryScreens
(
nxagentDisplay
,
&
number
);
screeninfo
=
XineramaQueryScreens
(
nxagentDisplay
,
&
number
);
if
(
number
)
{
#ifdef DEBUG
if
(
number
)
{
fprintf
(
stderr
,
"nxagentAdjustRandRXinerama: XineramaQueryScreens() returned [%d] screens:
\n
"
,
number
);
for
(
int
i
=
0
;
i
<
number
;
i
++
)
{
fprintf
(
stderr
,
"nxagentAdjustRandRXinerama: screen_number [%d] x_org [%d] y_org [%d] width [%d] height [%d]
\n
"
,
screeninfo
[
i
].
screen_number
,
screeninfo
[
i
].
x_org
,
screeninfo
[
i
].
y_org
,
screeninfo
[
i
].
width
,
screeninfo
[
i
].
height
);
}
}
else
{
fprintf
(
stderr
,
"nxagentAdjustRandRXinerama: XineramaQueryScreens() failed - continuing without Xinerama
\n
"
);
fprintf
(
stderr
,
"nxagentAdjustRandRXinerama: XineramaQueryScreens() returned [%d] screens:
\n
"
,
number
);
for
(
int
i
=
0
;
i
<
number
;
i
++
)
{
fprintf
(
stderr
,
"nxagentAdjustRandRXinerama: screen_number [%d] x_org [%d] y_org [%d] width [%d] height [%d]
\n
"
,
screeninfo
[
i
].
screen_number
,
screeninfo
[
i
].
x_org
,
screeninfo
[
i
].
y_org
,
screeninfo
[
i
].
width
,
screeninfo
[
i
].
height
);
}
#endif
}
else
{
fprintf
(
stderr
,
"nxagentAdjustRandRXinerama: Xinerama is disabled
\n
"
);
#ifdef DEBUG
fprintf
(
stderr
,
"nxagentAdjustRandRXinerama: XineramaQueryScreens() failed - continuing without Xinerama
\n
"
);
#endif
}
...
...
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