From: Zhiyi Zhang zzhang@codeweavers.com
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com Signed-off-by: Ken Thomases ken@codeweavers.com --- dlls/winemac.drv/display.c | 8 ++++++-- dlls/winemac.drv/macdrv.h | 2 +- dlls/winemac.drv/macdrv_main.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/winemac.drv/display.c b/dlls/winemac.drv/display.c index a953e0c5746..236f63d5633 100644 --- a/dlls/winemac.drv/display.c +++ b/dlls/winemac.drv/display.c @@ -946,6 +946,8 @@ better: SendMessageW(GetDesktopWindow(), WM_MACDRV_UPDATE_DESKTOP_RECT, mode_bpp, MAKELPARAM(width, height)); ret = DISP_CHANGE_SUCCESSFUL; + + macdrv_init_display_devices(TRUE); } else { @@ -1452,6 +1454,8 @@ void macdrv_displays_changed(const macdrv_event *event) free_display_mode_descriptor(desc); CGDisplayModeRelease(mode);
+ macdrv_init_display_devices(TRUE); + if (is_original && retina_enabled) { width *= 2; @@ -1728,7 +1732,7 @@ static void cleanup_devices(void) * * Initialize display device registry data. */ -void macdrv_init_display_devices(void) +void macdrv_init_display_devices(BOOL force) { static const WCHAR init_mutexW[] = {'d','i','s','p','l','a','y','_','d','e','v','i','c','e','_','i','n','i','t',0}; HANDLE mutex; @@ -1755,7 +1759,7 @@ void macdrv_init_display_devices(void) }
/* Avoid unnecessary reinit */ - if (disposition != REG_CREATED_NEW_KEY) + if (!force && disposition != REG_CREATED_NEW_KEY) goto done;
TRACE("\n"); diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index b9f58b90da7..a7c0b4cac87 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -223,7 +223,7 @@ extern CGImageRef create_cgimage_from_icon_bitmaps(HDC hdc, HANDLE icon, HBITMAP extern void macdrv_status_item_mouse_move(const macdrv_event *event) DECLSPEC_HIDDEN;
extern void check_retina_status(void) DECLSPEC_HIDDEN; -extern void macdrv_init_display_devices(void) DECLSPEC_HIDDEN; +extern void macdrv_init_display_devices(BOOL force) DECLSPEC_HIDDEN;
/************************************************************************** * Mac IME driver diff --git a/dlls/winemac.drv/macdrv_main.c b/dlls/winemac.drv/macdrv_main.c index 038578491f2..694a46b11e6 100644 --- a/dlls/winemac.drv/macdrv_main.c +++ b/dlls/winemac.drv/macdrv_main.c @@ -299,7 +299,7 @@ static BOOL process_attach(void) return FALSE; }
- macdrv_init_display_devices(); + macdrv_init_display_devices(FALSE);
return TRUE; }