From cb65f3d485b2c801181d53bd044859ae5489a68f Mon Sep 17 00:00:00 2001 From: TheCherno Date: Tue, 22 Feb 2022 14:18:51 +1100 Subject: [PATCH] Fixed titlebar refactor --- src/internal.h | 1 - src/win32_window.c | 6 +++--- src/window.c | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/internal.h b/src/internal.h index ec5c65ae..142dc0ee 100644 --- a/src/internal.h +++ b/src/internal.h @@ -527,7 +527,6 @@ struct _GLFWwindow // Window settings and state GLFWbool resizable; GLFWbool decorated; - GLFWbool titlebar; GLFWbool autoIconify; GLFWbool floating; GLFWbool focusOnShow; diff --git a/src/win32_window.c b/src/win32_window.c index bbe81a31..f0b7bcfd 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -1015,7 +1015,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, case WM_NCCALCSIZE: { - if (window->titlebar) + if (_glfw.hints.window.titlebar) break; if (lParam) @@ -1268,7 +1268,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, case WM_ACTIVATE: { - if (window->titlebar) + if (_glfw.hints.window.titlebar) break; // Extend the frame into the client area. @@ -1284,7 +1284,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, } case WM_NCHITTEST: { - if (window->titlebar) + if (_glfw.hints.window.titlebar) break; POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; diff --git a/src/window.c b/src/window.c index c41caa10..72a6b25e 100644 --- a/src/window.c +++ b/src/window.c @@ -852,7 +852,7 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* handle, int attrib) case GLFW_DECORATED: return window->decorated; case GLFW_TITLEBAR: - return window->titlebar; + return _glfw.hints.window.titlebar; case GLFW_FLOATING: return window->floating; case GLFW_AUTO_ICONIFY: @@ -913,10 +913,10 @@ GLFWAPI void glfwSetWindowAttrib(GLFWwindow* handle, int attrib, int value) if (!window->monitor) _glfw.platform.setWindowDecorated(window, value); case GLFW_TITLEBAR: - if (window->titlebar == value) + if (_glfw.hints.window.titlebar == value) return; - window->titlebar = value; + _glfw.hints.window.titlebar = value; if (!window->monitor) _glfw.platform.setWindowTitleBar(window, value); return;