diff --git a/quickshell/Common/ModalManager.qml b/quickshell/Common/ModalManager.qml index 224436e8..75b11f79 100644 --- a/quickshell/Common/ModalManager.qml +++ b/quickshell/Common/ModalManager.qml @@ -13,17 +13,16 @@ Singleton { property var currentModalsByScreen: ({}) function openModal(modal) { - if (!modal.allowStacking) { - closeAllModalsExcept(modal); - } - if (!modal.keepPopoutsOpen) { - PopoutManager.closeAllPopouts(); - } - TrayMenuManager.closeAllMenus(); - const screenName = modal.effectiveScreen?.name ?? "unknown"; currentModalsByScreen[screenName] = modal; modalChanged(); + Qt.callLater(() => { + if (!modal.allowStacking) + closeAllModalsExcept(modal); + if (!modal.keepPopoutsOpen) + PopoutManager.closeAllPopouts(); + TrayMenuManager.closeAllMenus(); + }); } function closeModal(modal) { diff --git a/quickshell/Modals/Common/DankModal.qml b/quickshell/Modals/Common/DankModal.qml index 20a5322f..9a334b99 100644 --- a/quickshell/Modals/Common/DankModal.qml +++ b/quickshell/Modals/Common/DankModal.qml @@ -302,7 +302,7 @@ Item { MouseArea { anchors.fill: parent - enabled: root.useSingleWindow + enabled: root.useSingleWindow && root.shouldBeVisible hoverEnabled: false acceptedButtons: Qt.AllButtons onPressed: mouse.accepted = true diff --git a/quickshell/Modals/Spotlight/SpotlightModal.qml b/quickshell/Modals/Spotlight/SpotlightModal.qml index 6c44deb0..28411fd2 100644 --- a/quickshell/Modals/Spotlight/SpotlightModal.qml +++ b/quickshell/Modals/Spotlight/SpotlightModal.qml @@ -38,11 +38,10 @@ DankModal { isClosing = false; resetContent(); spotlightOpen = true; - if (spotlightContent?.appLauncher) - spotlightContent.appLauncher.ensureInitialized(); open(); - Qt.callLater(() => { + if (spotlightContent?.appLauncher) + spotlightContent.appLauncher.ensureInitialized(); if (spotlightContent?.searchField) spotlightContent.searchField.forceActiveFocus(); }); @@ -53,15 +52,14 @@ DankModal { isClosing = false; resetContent(); spotlightOpen = true; - if (spotlightContent?.appLauncher) { - spotlightContent.appLauncher.ensureInitialized(); - spotlightContent.appLauncher.searchQuery = query; - } if (spotlightContent?.searchField) spotlightContent.searchField.text = query; open(); - Qt.callLater(() => { + if (spotlightContent?.appLauncher) { + spotlightContent.appLauncher.ensureInitialized(); + spotlightContent.appLauncher.searchQuery = query; + } if (spotlightContent?.searchField) spotlightContent.searchField.forceActiveFocus(); }); diff --git a/quickshell/Modules/ControlCenter/Details/NetworkDetail.qml b/quickshell/Modules/ControlCenter/Details/NetworkDetail.qml index 5282b194..66f1a380 100644 --- a/quickshell/Modules/ControlCenter/Details/NetworkDetail.qml +++ b/quickshell/Modules/ControlCenter/Details/NetworkDetail.qml @@ -37,6 +37,10 @@ Rectangle { NetworkService.removeRef(); } + property bool hasEthernetAvailable: (NetworkService.ethernetDevices?.length ?? 0) > 0 + property bool hasWifiAvailable: (NetworkService.wifiDevices?.length ?? 0) > 0 + property bool hasBothConnectionTypes: hasEthernetAvailable && hasWifiAvailable + property int currentPreferenceIndex: { if (DMSService.apiVersion < 5) { return 1; @@ -46,19 +50,24 @@ Rectangle { return 1; } - const pref = NetworkService.userPreference; - const status = NetworkService.networkStatus; - let index = 1; - - if (pref === "ethernet") { - index = 0; - } else if (pref === "wifi") { - index = 1; - } else { - index = status === "ethernet" ? 0 : 1; + if (!hasEthernetAvailable) { + return 1; } - return index; + if (!hasWifiAvailable) { + return 0; + } + + const pref = NetworkService.userPreference; + const status = NetworkService.networkStatus; + + if (pref === "ethernet") { + return 0; + } + if (pref === "wifi") { + return 1; + } + return status === "ethernet" ? 0 : 1; } Row { @@ -117,7 +126,7 @@ Rectangle { DankButtonGroup { id: preferenceControls anchors.verticalCenter: parent.verticalCenter - visible: NetworkService.backend === "networkmanager" && DMSService.apiVersion > 10 + visible: hasBothConnectionTypes && NetworkService.backend === "networkmanager" && DMSService.apiVersion > 10 buttonHeight: 28 textSize: Theme.fontSizeSmall