diff --git a/src/cocoa_window.m b/src/cocoa_window.m index ebf736d0..7e7b3d50 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -904,7 +904,7 @@ static GLFWbool createWindow(_GLFWwindow* window, unsigned int styleMask = 0; - if (wndconfig->monitor || !wndconfig->decorated) + if (window->monitor || !wndconfig->decorated) styleMask = NSBorderlessWindowMask; else { @@ -917,7 +917,7 @@ static GLFWbool createWindow(_GLFWwindow* window, NSRect contentRect; - if (wndconfig->monitor) + if (window->monitor) { GLFWvidmode mode; int xpos, ypos; @@ -945,10 +945,8 @@ static GLFWbool createWindow(_GLFWwindow* window, if (wndconfig->resizable) [window->ns.object setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; - if (wndconfig->monitor) - { + if (window->monitor) [window->ns.object setLevel:NSMainMenuWindowLevel + 1]; - } else { [window->ns.object center]; @@ -998,7 +996,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, return GLFW_FALSE; } - if (wndconfig->monitor) + if (window->monitor) { _glfwPlatformShowWindow(window); if (!enterFullscreenMode(window)) diff --git a/src/internal.h b/src/internal.h index e1466dc5..01046d0d 100644 --- a/src/internal.h +++ b/src/internal.h @@ -247,7 +247,6 @@ struct _GLFWwndconfig GLFWbool autoIconify; GLFWbool floating; GLFWbool maximized; - _GLFWmonitor* monitor; }; diff --git a/src/mir_window.c b/src/mir_window.c index 3b256081..5d2c145b 100644 --- a/src/mir_window.c +++ b/src/mir_window.c @@ -351,10 +351,10 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, return GLFW_FALSE; } - if (wndconfig->monitor) + if (window->monitor) { GLFWvidmode mode; - _glfwPlatformGetVideoMode(wndconfig->monitor, &mode); + _glfwPlatformGetVideoMode(window->monitor, &mode); mir_surface_set_state(window->mir.surface, mir_surface_state_fullscreen); diff --git a/src/win32_window.c b/src/win32_window.c index c0d01ddd..7fc8c5e9 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -760,15 +760,15 @@ static int createWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig) DWORD style = getWindowStyle(window); DWORD exStyle = getWindowExStyle(window); - if (wndconfig->monitor) + if (window->monitor) { GLFWvidmode mode; // NOTE: This window placement is temporary and approximate, as the // correct position and size cannot be known until the monitor // video mode has been set - _glfwPlatformGetMonitorPos(wndconfig->monitor, &xpos, &ypos); - _glfwPlatformGetVideoMode(wndconfig->monitor, &mode); + _glfwPlatformGetMonitorPos(window->monitor, &xpos, &ypos); + _glfwPlatformGetVideoMode(window->monitor, &mode); fullWidth = mode.width; fullHeight = mode.height; } @@ -822,7 +822,7 @@ static int createWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig) WM_COPYGLOBALDATA, MSGFLT_ALLOW, NULL); } - if (wndconfig->floating && !wndconfig->monitor) + if (wndconfig->floating && !window->monitor) { SetWindowPos(window->win32.handle, HWND_TOPMOST, diff --git a/src/window.c b/src/window.c index 69e9fbe7..01f46b23 100644 --- a/src/window.c +++ b/src/window.c @@ -143,7 +143,6 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, wndconfig.width = width; wndconfig.height = height; wndconfig.title = title; - wndconfig.monitor = (_GLFWmonitor*) monitor; ctxconfig.share = (_GLFWwindow*) share; if (ctxconfig.share) @@ -155,7 +154,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, } } - if (wndconfig.monitor) + if (monitor) { wndconfig.resizable = GLFW_TRUE; wndconfig.visible = GLFW_TRUE; @@ -176,7 +175,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, window->videoMode.blueBits = fbconfig.blueBits; window->videoMode.refreshRate = _glfw.hints.refreshRate; - window->monitor = wndconfig.monitor; + window->monitor = (_GLFWmonitor*) monitor; window->resizable = wndconfig.resizable; window->decorated = wndconfig.decorated; window->autoIconify = wndconfig.autoIconify; @@ -218,7 +217,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, _glfwPlatformMakeContextCurrent(previous); } - if (wndconfig.monitor) + if (window->monitor) { int width, height; _glfwPlatformGetWindowSize(window, &width, &height); diff --git a/src/wl_window.c b/src/wl_window.c index 3920e82e..2cc8abff 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -329,13 +329,13 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, return GLFW_FALSE; } - if (wndconfig->monitor) + if (window->monitor) { wl_shell_surface_set_fullscreen( window->wl.shell_surface, WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 0, - wndconfig->monitor->wl.output); + window->monitor->wl.output); } else { diff --git a/src/x11_window.c b/src/x11_window.c index eaf74547..0c2016b3 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -300,7 +300,7 @@ static GLFWbool createWindow(_GLFWwindow* window, (XPointer) window); } - if (wndconfig->monitor) + if (window->monitor) { if (!_glfw.x11.NET_WM_STATE || !_glfw.x11.NET_WM_STATE_FULLSCREEN) { @@ -441,10 +441,10 @@ static GLFWbool createWindow(_GLFWwindow* window, XSizeHints* hints = XAllocSizeHints(); hints->flags = 0; - if (wndconfig->monitor) + if (window->monitor) { hints->flags |= PPosition; - _glfwPlatformGetMonitorPos(wndconfig->monitor, &hints->x, &hints->y); + _glfwPlatformGetMonitorPos(window->monitor, &hints->x, &hints->y); } if (!wndconfig->resizable) @@ -1447,7 +1447,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, #endif } - if (wndconfig->monitor) + if (window->monitor) { _glfwPlatformShowWindow(window); enterFullscreenMode(window);