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
2b484b1a
Commit
2b484b1a
authored
Aug 17, 2020
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Aug 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: Initialize new display device registry display settings.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
aadae4d1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
+35
-0
settings.c
dlls/winex11.drv/settings.c
+32
-0
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-0
xrandr.c
dlls/winex11.drv/xrandr.c
+2
-0
No files found.
dlls/winex11.drv/settings.c
View file @
2b484b1a
...
...
@@ -177,6 +177,38 @@ void X11DRV_Settings_Init(void)
X11DRV_Settings_SetHandler
(
&
nores_handler
);
}
/* Initialize registry display settings when new display devices are added */
void
init_registry_display_settings
(
void
)
{
DEVMODEW
dm
=
{.
dmSize
=
sizeof
(
dm
)};
DISPLAY_DEVICEW
dd
=
{
sizeof
(
dd
)};
DWORD
i
=
0
;
LONG
ret
;
while
(
EnumDisplayDevicesW
(
NULL
,
i
++
,
&
dd
,
0
))
{
/* Skip if the device already has registry display settings */
if
(
EnumDisplaySettingsExW
(
dd
.
DeviceName
,
ENUM_REGISTRY_SETTINGS
,
&
dm
,
0
))
continue
;
if
(
!
EnumDisplaySettingsExW
(
dd
.
DeviceName
,
ENUM_CURRENT_SETTINGS
,
&
dm
,
0
))
{
ERR
(
"Failed to query current display settings for %s.
\n
"
,
wine_dbgstr_w
(
dd
.
DeviceName
));
continue
;
}
TRACE
(
"Device %s current display mode %ux%u %ubits %uHz at %d,%d.
\n
"
,
wine_dbgstr_w
(
dd
.
DeviceName
),
dm
.
dmPelsWidth
,
dm
.
dmPelsHeight
,
dm
.
dmBitsPerPel
,
dm
.
dmDisplayFrequency
,
dm
.
u1
.
s2
.
dmPosition
.
x
,
dm
.
u1
.
s2
.
dmPosition
.
y
);
ret
=
ChangeDisplaySettingsExW
(
dd
.
DeviceName
,
&
dm
,
NULL
,
CDS_GLOBAL
|
CDS_NORESET
|
CDS_UPDATEREGISTRY
,
NULL
);
if
(
ret
!=
DISP_CHANGE_SUCCESSFUL
)
ERR
(
"Failed to save registry display settings for %s, returned %d.
\n
"
,
wine_dbgstr_w
(
dd
.
DeviceName
),
ret
);
}
}
static
BOOL
get_display_device_reg_key
(
const
WCHAR
*
device_name
,
WCHAR
*
key
,
unsigned
len
)
{
static
const
WCHAR
display
[]
=
{
'\\'
,
'\\'
,
'.'
,
'\\'
,
'D'
,
'I'
,
'S'
,
'P'
,
'L'
,
'A'
,
'Y'
};
...
...
dlls/winex11.drv/x11drv.h
View file @
2b484b1a
...
...
@@ -701,6 +701,7 @@ extern void X11DRV_Settings_SetHandler(const struct x11drv_settings_handler *han
extern
void
X11DRV_init_desktop
(
Window
win
,
unsigned
int
width
,
unsigned
int
height
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_resize_desktop
(
BOOL
)
DECLSPEC_HIDDEN
;
extern
void
init_registry_display_settings
(
void
)
DECLSPEC_HIDDEN
;
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
;
...
...
dlls/winex11.drv/xrandr.c
View file @
2b484b1a
...
...
@@ -1072,6 +1072,8 @@ static BOOL xrandr14_device_change_handler( HWND hwnd, XEvent *event )
* ChangeDisplaySettings(). Otherwise, ChangeDisplaySettings() would send multiple
* WM_DISPLAYCHANGE messages instead of just one */
X11DRV_DisplayDevices_Update
(
FALSE
);
init_registry_display_settings
();
}
return
FALSE
;
}
...
...
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