Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b5c65f1e
Commit
b5c65f1e
authored
May 20, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Jun 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: Avoid requesting current mode in X11DRV_desktop_get_modes.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
parent
5cc3808a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
4 deletions
+38
-4
desktop.c
dlls/winex11.drv/desktop.c
+38
-4
No files found.
dlls/winex11.drv/desktop.c
View file @
b5c65f1e
...
@@ -83,6 +83,39 @@ static struct screen_size {
...
@@ -83,6 +83,39 @@ static struct screen_size {
#define _NET_WM_STATE_REMOVE 0
#define _NET_WM_STATE_REMOVE 0
#define _NET_WM_STATE_ADD 1
#define _NET_WM_STATE_ADD 1
/* parse the desktop size specification */
static
BOOL
parse_size
(
const
WCHAR
*
size
,
unsigned
int
*
width
,
unsigned
int
*
height
)
{
WCHAR
*
end
;
*
width
=
wcstoul
(
size
,
&
end
,
10
);
if
(
end
==
size
)
return
FALSE
;
if
(
*
end
!=
'x'
)
return
FALSE
;
size
=
end
+
1
;
*
height
=
wcstoul
(
size
,
&
end
,
10
);
return
!*
end
;
}
/* retrieve the default desktop size from the registry */
static
BOOL
get_default_desktop_size
(
unsigned
int
*
width
,
unsigned
int
*
height
)
{
static
const
WCHAR
defaultW
[]
=
{
'D'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
0
};
WCHAR
buffer
[
4096
];
KEY_VALUE_PARTIAL_INFORMATION
*
value
=
(
void
*
)
buffer
;
DWORD
size
;
HKEY
hkey
;
/* @@ Wine registry key: HKCU\Software\Wine\Explorer\Desktops */
if
(
!
(
hkey
=
open_hkcu_key
(
"Software
\\
Wine
\\
Explorer
\\
Desktops"
)))
return
FALSE
;
size
=
query_reg_value
(
hkey
,
defaultW
,
value
,
sizeof
(
buffer
)
);
NtClose
(
hkey
);
if
(
!
size
||
value
->
Type
!=
REG_SZ
)
return
FALSE
;
if
(
!
parse_size
(
(
const
WCHAR
*
)
value
->
Data
,
width
,
height
))
return
FALSE
;
return
TRUE
;
}
/* Return TRUE if Wine is currently in virtual desktop mode */
/* Return TRUE if Wine is currently in virtual desktop mode */
BOOL
is_virtual_desktop
(
void
)
BOOL
is_virtual_desktop
(
void
)
{
{
...
@@ -118,12 +151,13 @@ static BOOL X11DRV_desktop_get_modes( ULONG_PTR id, DWORD flags, DEVMODEW **new_
...
@@ -118,12 +151,13 @@ static BOOL X11DRV_desktop_get_modes( ULONG_PTR id, DWORD flags, DEVMODEW **new_
{
{
UINT
depth_idx
,
size_idx
,
mode_idx
=
0
;
UINT
depth_idx
,
size_idx
,
mode_idx
=
0
;
UINT
screen_width
,
screen_height
;
UINT
screen_width
,
screen_height
;
RECT
primary_rect
;
DEVMODEW
*
modes
;
DEVMODEW
*
modes
;
primary_rect
=
NtUserGetPrimaryMonitorRect
();
if
(
!
get_default_desktop_size
(
&
screen_width
,
&
screen_height
))
screen_width
=
primary_rect
.
right
-
primary_rect
.
left
;
{
screen_height
=
primary_rect
.
bottom
-
primary_rect
.
top
;
screen_width
=
max_width
;
screen_height
=
max_height
;
}
/* Allocate memory for modes in different color depths */
/* Allocate memory for modes in different color depths */
if
(
!
(
modes
=
calloc
(
(
ARRAY_SIZE
(
screen_sizes
)
+
2
)
*
DEPTH_COUNT
,
sizeof
(
*
modes
)))
)
if
(
!
(
modes
=
calloc
(
(
ARRAY_SIZE
(
screen_sizes
)
+
2
)
*
DEPTH_COUNT
,
sizeof
(
*
modes
)))
)
...
...
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