mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-19 15:04:50 +02:00
macOS: Fix a regression that caused the titlebar to be translucent even for non-translucent windows
Fixes #6450
This commit is contained in:
@@ -46,6 +46,8 @@ Detailed list of changes
|
|||||||
|
|
||||||
- macOS: Fix a regression in the previous release that caused :opt:`hide_window_decorations` = ``yes`` to prevent window from being resizable (:iss:`6436`)
|
- macOS: Fix a regression in the previous release that caused :opt:`hide_window_decorations` = ``yes`` to prevent window from being resizable (:iss:`6436`)
|
||||||
|
|
||||||
|
- macOS: Fix a regression that caused the titlebar to be translucent even for non-translucent windows (:iss:`6450`)
|
||||||
|
|
||||||
- Remote control launch: Fix ``--env`` not implemented when using ``--cwd=current`` with the SSH kitten (:iss:`6438`)
|
- Remote control launch: Fix ``--env`` not implemented when using ``--cwd=current`` with the SSH kitten (:iss:`6438`)
|
||||||
|
|
||||||
0.29.0 [2023-07-10]
|
0.29.0 [2023-07-10]
|
||||||
|
|||||||
@@ -2977,16 +2977,18 @@ GLFWAPI void glfwCocoaSetWindowChrome(GLFWwindow *w, unsigned int color, bool us
|
|||||||
bool titlebar_transparent = false;
|
bool titlebar_transparent = false;
|
||||||
NSWindowStyleMask current_style_mask = [window->ns.object styleMask];
|
NSWindowStyleMask current_style_mask = [window->ns.object styleMask];
|
||||||
bool in_fullscreen = ((current_style_mask & NSWindowStyleMaskFullScreen) != 0) || window->ns.in_traditional_fullscreen;
|
bool in_fullscreen = ((current_style_mask & NSWindowStyleMaskFullScreen) != 0) || window->ns.in_traditional_fullscreen;
|
||||||
|
NSAppearance *light_appearance = is_transparent ? [NSAppearance appearanceNamed:NSAppearanceNameVibrantLight] : [NSAppearance appearanceNamed:NSAppearanceNameAqua];
|
||||||
|
NSAppearance *dark_appearance = is_transparent ? [NSAppearance appearanceNamed:NSAppearanceNameVibrantDark] : [NSAppearance appearanceNamed:NSAppearanceNameDarkAqua];
|
||||||
if (use_system_color || background_opacity < 1.0) {
|
if (use_system_color || background_opacity < 1.0) {
|
||||||
if (is_transparent) {
|
if (is_transparent) {
|
||||||
// prevent blurring of shadows at window corners with desktop background by setting a low alpha background
|
// prevent blurring of shadows at window corners with desktop background by setting a low alpha background
|
||||||
background = background_blur > 0 ? [NSColor colorWithWhite: 0 alpha: 0.001f] : [NSColor clearColor];
|
background = background_blur > 0 ? [NSColor colorWithWhite: 0 alpha: 0.001f] : [NSColor clearColor];
|
||||||
} else background = [NSColor clearColor];
|
} else background = [NSColor windowBackgroundColor];
|
||||||
switch (system_color) {
|
switch (system_color) {
|
||||||
case 1:
|
case 1:
|
||||||
appearance = [NSAppearance appearanceNamed:NSAppearanceNameVibrantLight]; break;
|
appearance = light_appearance; break;
|
||||||
case 2:
|
case 2:
|
||||||
appearance = [NSAppearance appearanceNamed:NSAppearanceNameVibrantDark]; break;
|
appearance = dark_appearance; break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// set a background color and make the title bar transparent so the background color is visible
|
// set a background color and make the title bar transparent so the background color is visible
|
||||||
@@ -2995,7 +2997,7 @@ GLFWAPI void glfwCocoaSetWindowChrome(GLFWwindow *w, unsigned int color, bool us
|
|||||||
double blue = (color & 0xFF) / 255.0;
|
double blue = (color & 0xFF) / 255.0;
|
||||||
double luma = 0.2126 * red + 0.7152 * green + 0.0722 * blue;
|
double luma = 0.2126 * red + 0.7152 * green + 0.0722 * blue;
|
||||||
background = [NSColor colorWithSRGBRed:red green:green blue:blue alpha:1.f];
|
background = [NSColor colorWithSRGBRed:red green:green blue:blue alpha:1.f];
|
||||||
appearance = [NSAppearance appearanceNamed:(luma < 0.5 ? NSAppearanceNameVibrantDark : NSAppearanceNameVibrantLight)];
|
appearance = luma < 0.5 ? dark_appearance : light_appearance;
|
||||||
titlebar_transparent = true;
|
titlebar_transparent = true;
|
||||||
}
|
}
|
||||||
[window->ns.object setBackgroundColor:background];
|
[window->ns.object setBackgroundColor:background];
|
||||||
|
|||||||
Reference in New Issue
Block a user