mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
macOS: Fix an abort when changing OS window chrome for a full screen window via remote control or the themes kitten
Fixes #7106
This commit is contained in:
@@ -2292,6 +2292,7 @@ int _glfwPlatformFramebufferTransparent(_GLFWwindow* window)
|
||||
void _glfwPlatformSetWindowResizable(_GLFWwindow* window, bool enabled UNUSED)
|
||||
{
|
||||
[window->ns.object setStyleMask:getStyleMask(window)];
|
||||
[window->ns.object makeFirstResponder:window->ns.view];
|
||||
}
|
||||
|
||||
void _glfwPlatformSetWindowDecorated(_GLFWwindow* window, bool enabled UNUSED)
|
||||
@@ -3133,8 +3134,11 @@ GLFWAPI void glfwCocoaSetWindowChrome(GLFWwindow *w, unsigned int color, bool us
|
||||
[[window->ns.object standardWindowButton: NSWindowCloseButton] setHidden:hide_titlebar_buttons];
|
||||
[[window->ns.object standardWindowButton: NSWindowMiniaturizeButton] setHidden:hide_titlebar_buttons];
|
||||
[[window->ns.object standardWindowButton: NSWindowZoomButton] setHidden:hide_titlebar_buttons];
|
||||
// Apple throws a hissy fit if one attempts to clear the value of NSWindowStyleMaskFullScreen outside of a full screen transition
|
||||
// event. See https://github.com/kovidgoyal/kitty/issues/7106
|
||||
NSWindowStyleMask fsmask = current_style_mask & NSWindowStyleMaskFullScreen;
|
||||
window->ns.pre_full_screen_style_mask = getStyleMask(window);
|
||||
[window->ns.object setStyleMask:window->ns.pre_full_screen_style_mask];
|
||||
[window->ns.object setStyleMask:window->ns.pre_full_screen_style_mask | fsmask];
|
||||
// HACK: Changing the style mask can cause the first responder to be cleared
|
||||
[window->ns.object makeFirstResponder:window->ns.view];
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user