Fixed titlebar refactor

This commit is contained in:
TheCherno 2022-02-22 14:18:51 +11:00
parent aa91434c64
commit cb65f3d485
3 changed files with 6 additions and 7 deletions

View File

@ -527,7 +527,6 @@ struct _GLFWwindow
// Window settings and state
GLFWbool resizable;
GLFWbool decorated;
GLFWbool titlebar;
GLFWbool autoIconify;
GLFWbool floating;
GLFWbool focusOnShow;

View File

@ -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) };

View File

@ -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;