Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
3ac14606
Commit
3ac14606
authored
Sep 28, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 28, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Use the first active CRTC as primary if no primary is explicitly set.
parent
73d68c5a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
9 deletions
+34
-9
xrandr.c
dlls/winex11.drv/xrandr.c
+34
-9
No files found.
dlls/winex11.drv/xrandr.c
View file @
3ac14606
...
@@ -57,6 +57,7 @@ MAKE_FUNCPTR(XRRGetScreenResources)
...
@@ -57,6 +57,7 @@ MAKE_FUNCPTR(XRRGetScreenResources)
MAKE_FUNCPTR
(
XRRSetCrtcConfig
)
MAKE_FUNCPTR
(
XRRSetCrtcConfig
)
static
typeof
(
XRRGetScreenResources
)
*
pXRRGetScreenResourcesCurrent
;
static
typeof
(
XRRGetScreenResources
)
*
pXRRGetScreenResourcesCurrent
;
static
RRMode
*
xrandr12_modes
;
static
RRMode
*
xrandr12_modes
;
static
int
primary_crtc
;
#endif
#endif
#undef MAKE_FUNCPTR
#undef MAKE_FUNCPTR
...
@@ -273,14 +274,15 @@ static int xrandr12_get_current_mode(void)
...
@@ -273,14 +274,15 @@ static int xrandr12_get_current_mode(void)
return
0
;
return
0
;
}
}
if
(
!
resources
->
ncrtc
||
!
(
crtc_info
=
pXRRGetCrtcInfo
(
gdi_display
,
resources
,
resources
->
crtcs
[
0
]
)))
if
(
resources
->
ncrtc
<=
primary_crtc
||
!
(
crtc_info
=
pXRRGetCrtcInfo
(
gdi_display
,
resources
,
resources
->
crtcs
[
primary_crtc
]
)))
{
{
pXRRFreeScreenResources
(
resources
);
pXRRFreeScreenResources
(
resources
);
ERR
(
"Failed to get CRTC info.
\n
"
);
ERR
(
"Failed to get CRTC info.
\n
"
);
return
0
;
return
0
;
}
}
TRACE
(
"CRTC
0: mode %#lx, %ux%u+%d+%d.
\n
"
,
crtc_info
->
mode
,
TRACE
(
"CRTC
%d: mode %#lx, %ux%u+%d+%d.
\n
"
,
primary_crtc
,
crtc_info
->
mode
,
crtc_info
->
width
,
crtc_info
->
height
,
crtc_info
->
x
,
crtc_info
->
y
);
crtc_info
->
width
,
crtc_info
->
height
,
crtc_info
->
x
,
crtc_info
->
y
);
for
(
i
=
0
;
i
<
xrandr_mode_count
;
++
i
)
for
(
i
=
0
;
i
<
xrandr_mode_count
;
++
i
)
...
@@ -318,18 +320,20 @@ static LONG xrandr12_set_current_mode( int mode )
...
@@ -318,18 +320,20 @@ static LONG xrandr12_set_current_mode( int mode )
return
DISP_CHANGE_FAILED
;
return
DISP_CHANGE_FAILED
;
}
}
if
(
!
resources
->
ncrtc
||
!
(
crtc_info
=
pXRRGetCrtcInfo
(
gdi_display
,
resources
,
resources
->
crtcs
[
0
]
)))
if
(
resources
->
ncrtc
<=
primary_crtc
||
!
(
crtc_info
=
pXRRGetCrtcInfo
(
gdi_display
,
resources
,
resources
->
crtcs
[
primary_crtc
]
)))
{
{
pXRRFreeScreenResources
(
resources
);
pXRRFreeScreenResources
(
resources
);
ERR
(
"Failed to get CRTC info.
\n
"
);
ERR
(
"Failed to get CRTC info.
\n
"
);
return
DISP_CHANGE_FAILED
;
return
DISP_CHANGE_FAILED
;
}
}
TRACE
(
"CRTC
0: mode %#lx, %ux%u+%d+%d.
\n
"
,
crtc_info
->
mode
,
TRACE
(
"CRTC
%d: mode %#lx, %ux%u+%d+%d.
\n
"
,
primary_crtc
,
crtc_info
->
mode
,
crtc_info
->
width
,
crtc_info
->
height
,
crtc_info
->
x
,
crtc_info
->
y
);
crtc_info
->
width
,
crtc_info
->
height
,
crtc_info
->
x
,
crtc_info
->
y
);
status
=
pXRRSetCrtcConfig
(
gdi_display
,
resources
,
resources
->
crtcs
[
0
],
CurrentTime
,
crtc_info
->
x
,
status
=
pXRRSetCrtcConfig
(
gdi_display
,
resources
,
resources
->
crtcs
[
primary_crtc
],
crtc_info
->
y
,
xrandr12_modes
[
mode
],
crtc_info
->
rotation
,
crtc_info
->
outputs
,
crtc_info
->
noutput
);
CurrentTime
,
crtc_info
->
x
,
crtc_info
->
y
,
xrandr12_modes
[
mode
],
crtc_info
->
rotation
,
crtc_info
->
outputs
,
crtc_info
->
noutput
);
pXRRFreeCrtcInfo
(
crtc_info
);
pXRRFreeCrtcInfo
(
crtc_info
);
pXRRFreeScreenResources
(
resources
);
pXRRFreeScreenResources
(
resources
);
...
@@ -344,6 +348,27 @@ static LONG xrandr12_set_current_mode( int mode )
...
@@ -344,6 +348,27 @@ static LONG xrandr12_set_current_mode( int mode )
return
DISP_CHANGE_SUCCESSFUL
;
return
DISP_CHANGE_SUCCESSFUL
;
}
}
static
XRRCrtcInfo
*
xrandr12_get_primary_crtc_info
(
XRRScreenResources
*
resources
,
int
*
crtc_idx
)
{
XRRCrtcInfo
*
crtc_info
;
int
i
;
for
(
i
=
0
;
i
<
resources
->
ncrtc
;
++
i
)
{
crtc_info
=
pXRRGetCrtcInfo
(
gdi_display
,
resources
,
resources
->
crtcs
[
i
]
);
if
(
!
crtc_info
||
crtc_info
->
mode
==
None
)
{
pXRRFreeCrtcInfo
(
crtc_info
);
continue
;
}
*
crtc_idx
=
i
;
return
crtc_info
;
}
return
NULL
;
}
static
int
xrandr12_init_modes
(
void
)
static
int
xrandr12_init_modes
(
void
)
{
{
XRRScreenResources
*
resources
;
XRRScreenResources
*
resources
;
...
@@ -368,14 +393,14 @@ static int xrandr12_init_modes(void)
...
@@ -368,14 +393,14 @@ static int xrandr12_init_modes(void)
}
}
}
}
if
(
!
resources
->
ncrtc
||
!
(
crtc_info
=
pXRRGetCrtcInfo
(
gdi_display
,
resources
,
resources
->
crtcs
[
0
]
)))
if
(
!
(
crtc_info
=
xrandr12_get_primary_crtc_info
(
resources
,
&
primary_crtc
)))
{
{
pXRRFreeScreenResources
(
resources
);
pXRRFreeScreenResources
(
resources
);
ERR
(
"Failed to get CRTC info.
\n
"
);
ERR
(
"Failed to get
primary
CRTC info.
\n
"
);
return
ret
;
return
ret
;
}
}
TRACE
(
"CRTC
0: mode %#lx, %ux%u+%d+%d.
\n
"
,
crtc_info
->
mode
,
TRACE
(
"CRTC
%d: mode %#lx, %ux%u+%d+%d.
\n
"
,
primary_crtc
,
crtc_info
->
mode
,
crtc_info
->
width
,
crtc_info
->
height
,
crtc_info
->
x
,
crtc_info
->
y
);
crtc_info
->
width
,
crtc_info
->
height
,
crtc_info
->
x
,
crtc_info
->
y
);
if
(
!
crtc_info
->
noutput
||
!
(
output_info
=
pXRRGetOutputInfo
(
gdi_display
,
resources
,
crtc_info
->
outputs
[
0
]
)))
if
(
!
crtc_info
->
noutput
||
!
(
output_info
=
pXRRGetOutputInfo
(
gdi_display
,
resources
,
crtc_info
->
outputs
[
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