mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 12:02:00 +00:00
Remove monitor from _GLFWwndconfig
This commit is contained in:
parent
3a6fe042ea
commit
ea888114fa
@ -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))
|
||||
|
@ -247,7 +247,6 @@ struct _GLFWwndconfig
|
||||
GLFWbool autoIconify;
|
||||
GLFWbool floating;
|
||||
GLFWbool maximized;
|
||||
_GLFWmonitor* monitor;
|
||||
};
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user