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
67d37355
Commit
67d37355
authored
Sep 27, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac.drv: Resize desktop window on WM_DISPLAYCHANGE message.
parent
63eeb236
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
26 deletions
+25
-26
display.c
dlls/winemac.drv/display.c
+1
-4
macdrv.h
dlls/winemac.drv/macdrv.h
+1
-1
window.c
dlls/winemac.drv/window.c
+23
-21
No files found.
dlls/winemac.drv/display.c
View file @
67d37355
...
...
@@ -831,10 +831,7 @@ LONG macdrv_ChangeDisplaySettings(LPDEVMODEW displays, HWND hwnd, DWORD flags, L
ret
=
DISP_CHANGE_BADMODE
;
}
else
if
(
macdrv_set_display_mode
(
&
macdrv_displays
[
0
],
best_display_mode
))
{
macdrv_init_display_devices
(
TRUE
);
send_message
(
NtUserGetDesktopWindow
(),
WM_MACDRV_UPDATE_DESKTOP_RECT
,
0
,
0
);
}
else
{
WARN
(
"Failed to set display mode
\n
"
);
...
...
@@ -1172,7 +1169,7 @@ void macdrv_displays_changed(const macdrv_event *event)
{
macdrv_init_display_devices
(
TRUE
);
init_registry_display_settings
();
send_message
(
hwnd
,
WM_MACDRV_UPDATE_DESKTOP_RECT
,
0
,
0
);
macdrv_resize_desktop
(
);
}
}
...
...
dlls/winemac.drv/macdrv.h
View file @
67d37355
...
...
@@ -92,7 +92,6 @@ extern BOOL CDECL macdrv_SetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp) DECLSPEC_H
enum
macdrv_window_messages
{
WM_MACDRV_SET_WIN_REGION
=
0x80001000
,
WM_MACDRV_UPDATE_DESKTOP_RECT
,
WM_MACDRV_RESET_DEVICE_METRICS
,
WM_MACDRV_DISPLAYCHANGE
,
WM_MACDRV_ACTIVATE_ON_FOLLOWING_FOCUS
,
...
...
@@ -268,6 +267,7 @@ extern void macdrv_status_item_mouse_move(const macdrv_event *event) DECLSPEC_HI
extern
void
check_retina_status
(
void
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_init_display_devices
(
BOOL
force
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_resize_desktop
(
void
)
DECLSPEC_HIDDEN
;
extern
void
init_user_driver
(
void
)
DECLSPEC_HIDDEN
;
/* unixlib interface */
...
...
dlls/winemac.drv/window.c
View file @
67d37355
...
...
@@ -1570,6 +1570,26 @@ BOOL macdrv_CreateDesktopWindow(HWND hwnd)
return
TRUE
;
}
void
macdrv_resize_desktop
(
void
)
{
HWND
hwnd
=
NtUserGetDesktopWindow
();
CGRect
new_desktop_rect
;
RECT
current_desktop_rect
;
macdrv_reset_device_metrics
();
new_desktop_rect
=
macdrv_get_desktop_rect
();
if
(
!
NtUserGetWindowRect
(
hwnd
,
&
current_desktop_rect
)
||
!
CGRectEqualToRect
(
cgrect_from_rect
(
current_desktop_rect
),
new_desktop_rect
))
{
send_message_timeout
(
HWND_BROADCAST
,
WM_MACDRV_RESET_DEVICE_METRICS
,
0
,
0
,
SMTO_ABORTIFHUNG
,
2000
,
NULL
);
NtUserSetWindowPos
(
hwnd
,
0
,
CGRectGetMinX
(
new_desktop_rect
),
CGRectGetMinY
(
new_desktop_rect
),
CGRectGetWidth
(
new_desktop_rect
),
CGRectGetHeight
(
new_desktop_rect
),
SWP_NOZORDER
|
SWP_NOACTIVATE
|
SWP_DEFERERASE
);
send_message_timeout
(
HWND_BROADCAST
,
WM_MACDRV_DISPLAYCHANGE
,
0
,
0
,
SMTO_ABORTIFHUNG
,
2000
,
NULL
);
}
}
#define WM_WINE_NOTIFY_ACTIVITY WM_USER
...
...
@@ -1591,6 +1611,9 @@ LRESULT macdrv_DesktopWindowProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
#pragma clang diagnostic pop
break
;
}
case
WM_DISPLAYCHANGE
:
macdrv_resize_desktop
();
break
;
}
return
NtUserMessageCall
(
hwnd
,
msg
,
wp
,
lp
,
0
,
NtUserDefWindowProc
,
FALSE
);
}
...
...
@@ -1987,27 +2010,6 @@ LRESULT macdrv_WindowMessage(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
release_win_data
(
data
);
}
return
0
;
case
WM_MACDRV_UPDATE_DESKTOP_RECT
:
if
(
hwnd
==
NtUserGetDesktopWindow
())
{
CGRect
new_desktop_rect
;
RECT
current_desktop_rect
;
macdrv_reset_device_metrics
();
new_desktop_rect
=
macdrv_get_desktop_rect
();
if
(
!
NtUserGetWindowRect
(
hwnd
,
&
current_desktop_rect
)
||
!
CGRectEqualToRect
(
cgrect_from_rect
(
current_desktop_rect
),
new_desktop_rect
))
{
send_message_timeout
(
HWND_BROADCAST
,
WM_MACDRV_RESET_DEVICE_METRICS
,
0
,
0
,
SMTO_ABORTIFHUNG
,
2000
,
NULL
);
NtUserSetWindowPos
(
hwnd
,
0
,
CGRectGetMinX
(
new_desktop_rect
),
CGRectGetMinY
(
new_desktop_rect
),
CGRectGetWidth
(
new_desktop_rect
),
CGRectGetHeight
(
new_desktop_rect
),
SWP_NOZORDER
|
SWP_NOACTIVATE
|
SWP_DEFERERASE
);
send_message_timeout
(
HWND_BROADCAST
,
WM_MACDRV_DISPLAYCHANGE
,
0
,
0
,
SMTO_ABORTIFHUNG
,
2000
,
NULL
);
}
}
return
0
;
case
WM_MACDRV_RESET_DEVICE_METRICS
:
macdrv_reset_device_metrics
();
return
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