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
a3686eeb
Commit
a3686eeb
authored
Feb 10, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Feb 21, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Don't assume that the primary adapter is always first.
parent
76326ed3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
sysparams.c
dlls/win32u/sysparams.c
+16
-3
No files found.
dlls/win32u/sysparams.c
View file @
a3686eeb
...
...
@@ -2745,6 +2745,19 @@ static struct display_device *find_adapter_device_by_id( UINT index )
}
/* display_lock mutex must be held */
static
struct
display_device
*
find_primary_adapter_device
(
void
)
{
struct
adapter
*
adapter
;
LIST_FOR_EACH_ENTRY
(
adapter
,
&
adapters
,
struct
adapter
,
entry
)
if
(
adapter
->
dev
.
state_flags
&
DISPLAY_DEVICE_PRIMARY_DEVICE
)
return
&
adapter
->
dev
;
WARN
(
"Failed to find primary adapter.
\n
"
);
return
NULL
;
}
/* display_lock mutex must be held */
static
struct
display_device
*
find_adapter_device_by_name
(
UNICODE_STRING
*
name
)
{
SIZE_T
len
=
name
->
Length
/
sizeof
(
WCHAR
);
...
...
@@ -2769,7 +2782,7 @@ static struct adapter *find_adapter( UNICODE_STRING *name )
if
(
!
lock_display_devices
())
return
NULL
;
if
(
name
&&
name
->
Length
)
device
=
find_adapter_device_by_name
(
name
);
else
device
=
find_
adapter_device_by_id
(
0
);
/* use primary adapter */
else
device
=
find_
primary_adapter_device
();
if
(
!
device
)
adapter
=
NULL
;
else
adapter
=
adapter_acquire
(
CONTAINING_RECORD
(
device
,
struct
adapter
,
dev
)
);
...
...
@@ -3226,7 +3239,7 @@ static LONG apply_display_settings( const WCHAR *devname, const DEVMODEW *devmod
place_all_displays
(
displays
);
if
(
!
(
primary
=
find_
adapter_device_by_id
(
0
)))
primary_name
[
0
]
=
0
;
if
(
!
(
primary
=
find_
primary_adapter_device
(
)))
primary_name
[
0
]
=
0
;
else
wcscpy
(
primary_name
,
primary
->
device_name
);
/* use the default implementation in virtual desktop mode */
...
...
@@ -3396,7 +3409,7 @@ INT get_display_depth( UNICODE_STRING *name )
if
(
name
&&
name
->
Length
)
device
=
find_adapter_device_by_name
(
name
);
else
device
=
find_
adapter_device_by_id
(
0
);
/* use primary adapter */
device
=
find_
primary_adapter_device
();
if
(
!
device
)
{
...
...
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