macOS: Fix changing window chrome/colors while in traditional fullscreen causing the titlebar to become visible

Fixes #7469
This commit is contained in:
Kovid Goyal 2024-05-23 22:30:57 +05:30
parent 15d86013d8
commit 9acca045bd
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 7 additions and 1 deletions

View File

@ -100,6 +100,8 @@ Detailed list of changes
- Add option :option:`kitten @ detach-window --stay-in-tab` to keep focus in the currently active tab when moving windows (:iss:`7468`)
- macOS: Fix changing window chrome/colors while in traditional fullscreen causing the titlebar to become visible (:iss:`7469`)
0.34.1 [2024-04-19]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -3161,7 +3161,11 @@ GLFWAPI void glfwCocoaSetWindowChrome(GLFWwindow *w, unsigned int color, bool us
// 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 | fsmask];
if (in_fullscreen && window->ns.in_traditional_fullscreen) {
[window->ns.object setStyleMask:NSWindowStyleMaskBorderless];
} else {
[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];
}}