pragma Singleton import QtQuick import Quickshell import Quickshell.Hyprland import "../../../../core" as Core // glassMxrph stand-in: context menus open where the plugin asks and close on // an outside click (Hyprland focus grab); launcher calls use glassMxrph's. Singleton { id: root property var openedPanel: null property var lockScreen: null property bool isKeybindRecording: false property var menu: null function showContextMenu(contextMenu, anchorItem, screen, targetItem) { if (!contextMenu || !anchorItem) return; closeContextMenu(screen); menu = contextMenu; contextMenu.openAtItem(anchorItem, screen, targetItem); Qt.callLater(() => grab.active = !!root.menu); } function closeContextMenu(screen) { grab.active = false; if (menu && typeof menu.close === "function") menu.close(); menu = null; } function getPopupMenuWindow(screen) { return null; } function getPanel(name, screen) { return null; } function isLauncherOpen() { return Core.ShellState.launcherOpen; } function closeLauncher() { Core.ShellState.launcherOpen = false; } function openLauncherWithSearch(text) { Core.ShellState.openLauncher(); } function setLauncherSearchText(text) { } function getLauncherSearchText() { return ""; } HyprlandFocusGrab { id: grab windows: root.menu ? [root.menu] : [] onCleared: root.closeContextMenu(null) } }