From 50b044f8a27933c1418793af3fec1b18a0d9e89f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 25 Apr 2025 20:41:44 +0530 Subject: [PATCH] Allow popup menus from global menubar to function --- glfw/cocoa_window.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index 71d1b0080..02c1af0ec 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -1972,7 +1972,7 @@ _glfwPlatformSetLayerShellConfig(_GLFWwindow* window, const GLFWLayerShellConfig } // Screen co-ordinate system is with origin in lower left and y increasing upwards and x increasing rightwards // NSLog(@"frame: %@ visibleFrame: %@\n", NSStringFromRect(screen.frame), NSStringFromRect(screen.visibleFrame)); - NSWindowLevel level = NSScreenSaverWindowLevel - 1; + NSWindowLevel level = NSPopUpMenuWindowLevel - 1; // so that popup menus from globalmenubar function NSWindowAnimationBehavior animation_behavior = NSWindowAnimationBehaviorUtilityWindow; switch (config.type) { case GLFW_LAYER_SHELL_BACKGROUND: @@ -1982,7 +1982,7 @@ _glfwPlatformSetLayerShellConfig(_GLFWwindow* window, const GLFWLayerShellConfig break; case GLFW_LAYER_SHELL_OVERLAY: case GLFW_LAYER_SHELL_NONE: break; case GLFW_LAYER_SHELL_PANEL: level = NSNormalWindowLevel - 1; break; - case GLFW_LAYER_SHELL_TOP: level = NSPopUpMenuWindowLevel + 1; break; + case GLFW_LAYER_SHELL_TOP: level--; break; } if (config.type != GLFW_LAYER_SHELL_BACKGROUND && config.edge != GLFW_EDGE_CENTER) { double panel_height = spacing_y + ysz / yscale, panel_width = spacing_x + xsz / xscale;