mirror of
https://github.com/glfw/glfw.git
synced 2026-11-17 20:28:55 +00:00
Cocoa: Fix window title being lost when untitled
The window title was lost and could not be updated while the window did not have NSWindowStyleMaskTitled set. Fixes #1082.
This commit is contained in:
+8
-1
@@ -1182,7 +1182,11 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
||||
|
||||
void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char *title)
|
||||
{
|
||||
[window->ns.object setTitle:[NSString stringWithUTF8String:title]];
|
||||
NSString* string = [NSString stringWithUTF8String:title];
|
||||
[window->ns.object setTitle:string];
|
||||
// HACK: Set the miniwindow title explicitly as setTitle: doesn't update it
|
||||
// if the window lacks NSWindowStyleMaskTitled
|
||||
[window->ns.object setMiniwindowTitle:string];
|
||||
}
|
||||
|
||||
void _glfwPlatformSetWindowIcon(_GLFWwindow* window,
|
||||
@@ -1427,6 +1431,9 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window,
|
||||
[window->ns.object setLevel:NSNormalWindowLevel];
|
||||
|
||||
[window->ns.object setHasShadow:YES];
|
||||
// HACK: Clearing NSWindowStyleMaskTitled resets and disables the window
|
||||
// title property but the miniwindow title property is unaffected
|
||||
[window->ns.object setTitle:[window->ns.object miniwindowTitle]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user