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
b112b4d4
Commit
b112b4d4
authored
Oct 21, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: Use the primary adapter info instead of calling back win32u.
parent
2fec6dd3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
50 deletions
+12
-50
desktop.c
dlls/winex11.drv/desktop.c
+2
-6
display.c
dlls/winex11.drv/display.c
+4
-27
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-2
xrandr.c
dlls/winex11.drv/xrandr.c
+3
-8
xvidmode.c
dlls/winex11.drv/xvidmode.c
+2
-7
No files found.
dlls/winex11.drv/desktop.c
View file @
b112b4d4
...
...
@@ -123,13 +123,9 @@ BOOL is_virtual_desktop(void)
}
/* Virtual desktop display settings handler */
static
BOOL
X11DRV_desktop_get_id
(
const
WCHAR
*
device_name
,
ULONG_PTR
*
id
)
static
BOOL
X11DRV_desktop_get_id
(
const
WCHAR
*
device_name
,
BOOL
is_primary
,
ULONG_PTR
*
id
)
{
WCHAR
primary_adapter
[
CCHDEVICENAME
];
if
(
!
get_primary_adapter
(
primary_adapter
)
||
wcsicmp
(
primary_adapter
,
device_name
))
return
FALSE
;
if
(
!
is_primary
)
return
FALSE
;
*
id
=
0
;
return
TRUE
;
}
...
...
dlls/winex11.drv/display.c
View file @
b112b4d4
...
...
@@ -66,14 +66,9 @@ void X11DRV_Settings_SetHandler(const struct x11drv_settings_handler *new_handle
* Default handlers if resolution switching is not enabled
*
*/
static
BOOL
nores_get_id
(
const
WCHAR
*
device_name
,
ULONG_PTR
*
id
)
static
BOOL
nores_get_id
(
const
WCHAR
*
device_name
,
BOOL
is_primary
,
ULONG_PTR
*
id
)
{
WCHAR
primary_adapter
[
CCHDEVICENAME
];
if
(
!
get_primary_adapter
(
primary_adapter
))
return
FALSE
;
*
id
=
!
wcsicmp
(
device_name
,
primary_adapter
)
?
1
:
0
;
*
id
=
is_primary
?
1
:
0
;
return
TRUE
;
}
...
...
@@ -196,24 +191,6 @@ void init_registry_display_settings(void)
}
}
BOOL
get_primary_adapter
(
WCHAR
*
name
)
{
DISPLAY_DEVICEW
dd
;
DWORD
i
;
dd
.
cb
=
sizeof
(
dd
);
for
(
i
=
0
;
!
NtUserEnumDisplayDevices
(
NULL
,
i
,
&
dd
,
0
);
++
i
)
{
if
(
dd
.
StateFlags
&
DISPLAY_DEVICE_PRIMARY_DEVICE
)
{
lstrcpyW
(
name
,
dd
.
DeviceName
);
return
TRUE
;
}
}
return
FALSE
;
}
static
void
set_display_depth
(
ULONG_PTR
display_id
,
DWORD
depth
)
{
struct
x11drv_display_depth
*
display_depth
;
...
...
@@ -271,7 +248,7 @@ BOOL X11DRV_GetCurrentDisplaySettings( LPCWSTR name, BOOL is_primary, LPDEVMODEW
DEVMODEW
mode
;
ULONG_PTR
id
;
if
(
!
settings_handler
.
get_id
(
name
,
&
id
)
||
!
settings_handler
.
get_current_mode
(
id
,
&
mode
))
if
(
!
settings_handler
.
get_id
(
name
,
is_primary
,
&
id
)
||
!
settings_handler
.
get_current_mode
(
id
,
&
mode
))
{
ERR
(
"Failed to get %s current display settings.
\n
"
,
wine_dbgstr_w
(
name
));
return
FALSE
;
...
...
@@ -409,7 +386,7 @@ LONG X11DRV_ChangeDisplaySettings( LPDEVMODEW displays, LPCWSTR primary_name, HW
if
(
!
(
ids
=
calloc
(
count
,
sizeof
(
*
ids
)
)))
return
DISP_CHANGE_FAILED
;
for
(
count
=
0
,
mode
=
displays
;
mode
->
dmSize
;
mode
=
NEXT_DEVMODEW
(
mode
),
count
++
)
{
if
(
!
settings_handler
.
get_id
(
mode
->
dmDeviceName
,
ids
+
count
))
goto
done
;
if
(
!
settings_handler
.
get_id
(
mode
->
dmDeviceName
,
!
wcsicmp
(
mode
->
dmDeviceName
,
primary_name
),
ids
+
count
))
goto
done
;
mode
->
dmPosition
.
x
-=
left_most
;
mode
->
dmPosition
.
y
-=
top_most
;
}
...
...
dlls/winex11.drv/x11drv.h
View file @
b112b4d4
...
...
@@ -710,7 +710,7 @@ struct x11drv_settings_handler
* Following functions use this id to identify the device.
*
* Return FALSE if the device cannot be found and TRUE on success */
BOOL
(
*
get_id
)(
const
WCHAR
*
device_name
,
ULONG_PTR
*
id
);
BOOL
(
*
get_id
)(
const
WCHAR
*
device_name
,
BOOL
is_primary
,
ULONG_PTR
*
id
);
/* get_modes() will be called to get a list of supported modes of the device of id in modes
* with respect to flags, which could be 0, EDS_RAWMODE or EDS_ROTATEDMODE. If the implementation
...
...
@@ -751,7 +751,6 @@ extern BOOL is_virtual_desktop(void) DECLSPEC_HIDDEN;
extern
BOOL
is_desktop_fullscreen
(
void
)
DECLSPEC_HIDDEN
;
extern
BOOL
is_detached_mode
(
const
DEVMODEW
*
)
DECLSPEC_HIDDEN
;
extern
BOOL
create_desktop_win_data
(
Window
win
)
DECLSPEC_HIDDEN
;
extern
BOOL
get_primary_adapter
(
WCHAR
*
)
DECLSPEC_HIDDEN
;
void
X11DRV_Settings_Init
(
void
)
DECLSPEC_HIDDEN
;
void
X11DRV_XF86VM_Init
(
void
)
DECLSPEC_HIDDEN
;
...
...
dlls/winex11.drv/xrandr.c
View file @
b112b4d4
...
...
@@ -144,17 +144,12 @@ static int XRandRErrorHandler(Display *dpy, XErrorEvent *event, void *arg)
}
/* XRandR 1.0 display settings handler */
static
BOOL
xrandr10_get_id
(
const
WCHAR
*
device_name
,
ULONG_PTR
*
id
)
static
BOOL
xrandr10_get_id
(
const
WCHAR
*
device_name
,
BOOL
is_primary
,
ULONG_PTR
*
id
)
{
WCHAR
primary_adapter
[
CCHDEVICENAME
];
if
(
!
get_primary_adapter
(
primary_adapter
))
return
FALSE
;
/* RandR 1.0 only supports changing the primary adapter settings.
* For non-primary adapters, an id is still provided but getting
* and changing non-primary adapters' settings will be ignored. */
*
id
=
!
wcsicmp
(
device_name
,
primary_adapter
)
?
1
:
0
;
*
id
=
is_primary
?
1
:
0
;
return
TRUE
;
}
...
...
@@ -1224,7 +1219,7 @@ static void xrandr14_register_event_handlers(void)
}
/* XRandR 1.4 display settings handler */
static
BOOL
xrandr14_get_id
(
const
WCHAR
*
device_name
,
ULONG_PTR
*
id
)
static
BOOL
xrandr14_get_id
(
const
WCHAR
*
device_name
,
BOOL
is_primary
,
ULONG_PTR
*
id
)
{
struct
current_mode
*
tmp_modes
,
*
new_current_modes
=
NULL
;
INT
gpu_count
,
adapter_count
,
new_current_mode_count
=
0
;
...
...
dlls/winex11.drv/xvidmode.c
View file @
b112b4d4
...
...
@@ -85,17 +85,12 @@ static int XVidModeErrorHandler(Display *dpy, XErrorEvent *event, void *arg)
}
/* XF86VidMode display settings handler */
static
BOOL
xf86vm_get_id
(
const
WCHAR
*
device_name
,
ULONG_PTR
*
id
)
static
BOOL
xf86vm_get_id
(
const
WCHAR
*
device_name
,
BOOL
is_primary
,
ULONG_PTR
*
id
)
{
WCHAR
primary_adapter
[
CCHDEVICENAME
];
if
(
!
get_primary_adapter
(
primary_adapter
))
return
FALSE
;
/* XVidMode only supports changing the primary adapter settings.
* For non-primary adapters, an id is still provided but getting
* and changing non-primary adapters' settings will be ignored. */
*
id
=
!
wcsicmp
(
device_name
,
primary_adapter
)
?
1
:
0
;
*
id
=
is_primary
?
1
:
0
;
return
TRUE
;
}
...
...
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