mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
Windows: Fix window caption drawing on borderless windows
This commit is contained in:
parent
039a60c527
commit
4b69833bc5
1 changed files with 26 additions and 0 deletions
|
|
@ -68,6 +68,14 @@
|
||||||
#define VK_OEM_NEC_EQUAL 0x92
|
#define VK_OEM_NEC_EQUAL 0x92
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Undocumented window messages
|
||||||
|
#ifndef WM_NCUAHDRAWCAPTION
|
||||||
|
#define WM_NCUAHDRAWCAPTION 0xAE
|
||||||
|
#endif
|
||||||
|
#ifndef WM_NCUAHDRAWFRAME
|
||||||
|
#define WM_NCUAHDRAWFRAME 0xAF
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Make sure XBUTTON stuff is defined that isn't in older Platform SDKs... */
|
/* Make sure XBUTTON stuff is defined that isn't in older Platform SDKs... */
|
||||||
#ifndef WM_XBUTTONDOWN
|
#ifndef WM_XBUTTONDOWN
|
||||||
#define WM_XBUTTONDOWN 0x020B
|
#define WM_XBUTTONDOWN 0x020B
|
||||||
|
|
@ -805,6 +813,24 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
actually being the foreground window, but this appears to get called in all cases where
|
actually being the foreground window, but this appears to get called in all cases where
|
||||||
the global foreground window changes to and from this window. */
|
the global foreground window changes to and from this window. */
|
||||||
WIN_UpdateFocus(data->window, !!wParam);
|
WIN_UpdateFocus(data->window, !!wParam);
|
||||||
|
|
||||||
|
/* Handle borderless windows; this event is intended for drawing the titlebar, so we need
|
||||||
|
to stop that from happening. */
|
||||||
|
if (data->window->flags & SDL_WINDOW_BORDERLESS) {
|
||||||
|
lParam = -1; // According to MSDN, DefWindowProc will draw a title bar if lParam != -1
|
||||||
|
}
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case WM_NCUAHDRAWCAPTION:
|
||||||
|
case WM_NCUAHDRAWFRAME:
|
||||||
|
{
|
||||||
|
/* These messages are undocumented. They are responsible for redrawing the window frame and
|
||||||
|
caption. Notably, WM_NCUAHDRAWCAPTION is sent when calling SetWindowText on a window.
|
||||||
|
For borderless windows, we don't want to draw a frame or caption, so we should stop
|
||||||
|
that from happening. */
|
||||||
|
if (data->window->flags & SDL_WINDOW_BORDERLESS) {
|
||||||
|
returnCode = 0;
|
||||||
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case WM_ACTIVATE:
|
case WM_ACTIVATE:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue