Merge branch 'master' into jgrpp

# Conflicts:
#	src/airport_gui.cpp
#	src/blitter/32bpp_anim_sse4.cpp
#	src/console_cmds.cpp
#	src/linkgraph/linkgraph_gui.cpp
#	src/newgrf_object.h
#	src/road_gui.cpp
#	src/widgets/road_widget.h
#	src/window.cpp
This commit is contained in:
Jonathan G Rennison
2022-10-16 20:14:13 +01:00
82 changed files with 778 additions and 341 deletions

View File

@@ -1271,8 +1271,12 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
/** Screen the window is on changed. */
- (void)windowDidChangeBackingProperties:(NSNotification *)notification
{
bool did_adjust = AdjustGUIZoom();
/* Reallocate screen buffer if necessary. */
driver->AllocateBackingStore();
if (did_adjust) ReInitAllWindows(true);
}
/** Presentation options to use for full screen mode. */

View File

@@ -39,6 +39,10 @@
#define PM_QS_INPUT 0x20000
#endif
#ifndef WM_DPICHANGED
#define WM_DPICHANGED 0x02E0
#endif
bool _window_maximize;
static Dimension _bck_resolution;
DWORD _imm_props;
@@ -672,6 +676,24 @@ LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return TRUE;
}
case WM_DPICHANGED: {
auto did_adjust = AdjustGUIZoom();
/* Resize the window to match the new DPI setting. */
RECT *prcNewWindow = (RECT *)lParam;
SetWindowPos(hwnd,
NULL,
prcNewWindow->left,
prcNewWindow->top,
prcNewWindow->right - prcNewWindow->left,
prcNewWindow->bottom - prcNewWindow->top,
SWP_NOZORDER | SWP_NOACTIVATE);
if (did_adjust) ReInitAllWindows(true);
return 0;
}
/* needed for wheel */
#if !defined(WM_MOUSEWHEEL)
# define WM_MOUSEWHEEL 0x020A