Resize OS panels on font size change

This commit is contained in:
Kovid Goyal
2025-04-23 07:11:39 +05:30
parent ae01cf3c1c
commit 3c4a8a1e7e
5 changed files with 36 additions and 24 deletions

View File

@@ -1929,9 +1929,10 @@ bool
_glfwPlatformSetLayerShellConfig(_GLFWwindow* window, const GLFWLayerShellConfig *value) {
#define config window->ns.layer_shell.config
window->resizable = false;
if (value) config = *value;
const bool is_transparent = ![window->ns.object isOpaque];
int background_blur = value->related.background_blur;
if (!is_transparent || value->related.background_opacity >= 1.f) { background_blur = 0; }
int background_blur = config.related.background_blur;
if (!is_transparent || config.related.background_opacity >= 1.f) { background_blur = 0; }
[window->ns.object setBackgroundColor:nil];
_glfwPlatformSetWindowBlur(window, background_blur);
window->ns.titlebar_hidden = true;
@@ -1940,7 +1941,7 @@ _glfwPlatformSetLayerShellConfig(_GLFWwindow* window, const GLFWLayerShellConfig
[window->ns.object setHasShadow:false];
[window->ns.object setTitleVisibility:NSWindowTitleHidden];
NSColorSpace *cs = nil;
switch (value->related.color_space) {
switch (config.related.color_space) {
case SRGB_COLORSPACE: cs = [NSColorSpace sRGBColorSpace]; break;
case DISPLAY_P3_COLORSPACE: cs = [NSColorSpace displayP3ColorSpace]; break;
case DEFAULT_COLORSPACE: cs = nil; break; // using deviceRGBColorSpace causes a hang when transitioning to fullscreen

5
glfw/wl_window.c vendored
View File

@@ -1741,9 +1741,10 @@ void _glfwPlatformHideWindow(_GLFWwindow* window)
debug("Window %llu unmapped\n", window->id);
}
bool _glfwPlatformSetLayerShellConfig(_GLFWwindow* window, const GLFWLayerShellConfig *value) {
bool
_glfwPlatformSetLayerShellConfig(_GLFWwindow* window, const GLFWLayerShellConfig *value) {
if (!is_layer_shell(window)) return false;
window->wl.layer_shell.config = *value;
if (value) window->wl.layer_shell.config = *value;
layer_set_properties(window);
commit_window_surface(window);
return true;