Cocoa: Fix GLFW_MAXIMIZED for nonresizable windows

The reasoning here is that glfwRestoreWindow will change nothing for
a windowed non-resizable window on Cocoa, and silently refusing to
maximize seems slightly more like something other platforms would do.

This is possibly either the right thing to do or the wrong one.

(cherry picked from commit 6f8ec4075b)
This commit is contained in:
Camilla Löwy 2022-06-30 22:08:52 +02:00
parent 70a024232a
commit e50ee39eac
2 changed files with 7 additions and 1 deletions

View File

@ -136,6 +136,7 @@ information on what to include when reporting a bug.
- [Cocoa] Disabled macOS fullscreen when `GLFW_RESIZABLE` is false - [Cocoa] Disabled macOS fullscreen when `GLFW_RESIZABLE` is false
- [Cocoa] Bugfix: A connected Apple AirPlay would emit a useless error (#1791) - [Cocoa] Bugfix: A connected Apple AirPlay would emit a useless error (#1791)
- [Cocoa] Bugfix: The EGL and OSMesa libraries were not unloaded on termination - [Cocoa] Bugfix: The EGL and OSMesa libraries were not unloaded on termination
- [Cocoa] Bugfix: `GLFW_MAXIMIZED` was always true when `GLFW_RESIZABLE` was false
- [X11] Bugfix: The OSMesa libray was not unloaded on termination - [X11] Bugfix: The OSMesa libray was not unloaded on termination
- [X11] Bugfix: A malformed response during selection transfer could cause a segfault - [X11] Bugfix: A malformed response during selection transfer could cause a segfault
- [X11] Bugfix: Some calls would reset Xlib to the default error handler (#2108) - [X11] Bugfix: Some calls would reset Xlib to the default error handler (#2108)

View File

@ -1356,7 +1356,12 @@ int _glfwPlatformWindowVisible(_GLFWwindow* window)
int _glfwPlatformWindowMaximized(_GLFWwindow* window) int _glfwPlatformWindowMaximized(_GLFWwindow* window)
{ {
@autoreleasepool { @autoreleasepool {
return [window->ns.object isZoomed];
if (window->resizable)
return [window->ns.object isZoomed];
else
return GLFW_FALSE;
} // autoreleasepool } // autoreleasepool
} }