Skip to content

Commit

Permalink
Fixed titlebar refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCherno committed Feb 22, 2022
1 parent aa91434 commit cb65f3d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,6 @@ struct _GLFWwindow
// Window settings and state
GLFWbool resizable;
GLFWbool decorated;
GLFWbool titlebar;
GLFWbool autoIconify;
GLFWbool floating;
GLFWbool focusOnShow;
Expand Down
6 changes: 3 additions & 3 deletions src/win32_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand All @@ -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) };
Expand Down
6 changes: 3 additions & 3 deletions src/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit cb65f3d

Please sign in to comment.