From 51f6f37925853c2921684819bd1a91f89142841e Mon Sep 17 00:00:00 2001 From: purian23 Date: Tue, 24 Feb 2026 01:03:51 -0500 Subject: [PATCH] display: Fix output config on delete & popup height --- .../Settings/DisplayConfig/DisplayConfigState.qml | 5 ++++- quickshell/Widgets/DankDropdown.qml | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/quickshell/Modules/Settings/DisplayConfig/DisplayConfigState.qml b/quickshell/Modules/Settings/DisplayConfig/DisplayConfigState.qml index 1659c09a..34afbb6a 100644 --- a/quickshell/Modules/Settings/DisplayConfig/DisplayConfigState.qml +++ b/quickshell/Modules/Settings/DisplayConfig/DisplayConfigState.qml @@ -231,13 +231,16 @@ Singleton { const compositor = CompositorService.compositor; const profilesDir = getProfilesDir(); const profileFile = profilesDir + "/" + profileId + getProfileExtension(); + const isActive = SettingsData.getActiveDisplayProfile(compositor) === profileId; profilesLoading = true; Proc.runCommand("delete-profile", ["rm", "-f", profileFile], (output, exitCode) => { profilesLoading = false; SettingsData.removeDisplayProfile(compositor, profileId); - if (SettingsData.getActiveDisplayProfile(compositor) === profileId) + if (isActive) { SettingsData.setActiveDisplayProfile(compositor, ""); + backendWriteOutputsConfig(allOutputs); + } const updated = JSON.parse(JSON.stringify(validatedProfiles)); delete updated[profileId]; validatedProfiles = updated; diff --git a/quickshell/Widgets/DankDropdown.qml b/quickshell/Widgets/DankDropdown.qml index c100c0ac..c1355d45 100644 --- a/quickshell/Widgets/DankDropdown.qml +++ b/quickshell/Widgets/DankDropdown.qml @@ -236,7 +236,14 @@ Item { parent: Overlay.overlay width: root.popupWidth === -1 ? undefined : (root.popupWidth > 0 ? root.popupWidth : (dropdown.width + root.popupWidthOffset)) - height: Math.min(root.maxPopupHeight, (root.enableFuzzySearch ? 54 : 0) + Math.min(filteredOptions.length, 10) * 36 + 16) + height: { + let h = root.enableFuzzySearch ? 54 : 0; + if (root.options.length === 0 && root.emptyText !== "") + h += 32; + else + h += Math.min(filteredOptions.length, 10) * 36; + return Math.min(root.maxPopupHeight, h + 16); + } padding: 0 modal: true dim: false