From 390de9343200749ff9766ef8ad6f8d39029d8da3 Mon Sep 17 00:00:00 2001 From: bbedward Date: Fri, 30 Oct 2026 21:05:11 -0400 Subject: [PATCH] fix: doctor retired package check nd flashbang fixes #4042 fixes #4041 port 2.0 --- core/cmd/dms/commands_doctor.go | 24 +++++++++++++------ core/cmd/dms/commands_doctor_test.go | 19 +++++++++++++++ .../Modals/Changelog/ChangelogModal.qml | 2 ++ quickshell/Modals/Greeter/GreeterModal.qml | 2 ++ quickshell/Modals/PolkitAuthModal.qml | 2 ++ quickshell/Modals/WindowRuleModal.qml | 2 ++ quickshell/Modals/WorkspaceRenameModal.qml | 2 ++ 7 files changed, 46 insertions(+), 7 deletions(-) diff --git a/core/cmd/dms/commands_doctor.go b/core/cmd/dms/commands_doctor.go index a9899c1a3..805b4494e 100644 --- a/core/cmd/dms/commands_doctor.go +++ b/core/cmd/dms/commands_doctor.go @@ -1700,18 +1700,15 @@ func greeterFlagValue(fields []string, flags ...string) string { return "" } +var retiredGreeterPackages = []string{"greetd-dms-greeter", "greetd-dms-greeter-bin", "greetd-dms-greeter-git"} + func checkRetiredGreeterPackages() []checkResult { if !utils.CommandExists("pacman") { return nil } // pacman -Q exits non-zero when any name is missing but still lists the installed ones - out, _ := exec.Command("pacman", "-Q", "greetd-dms-greeter", "greetd-dms-greeter-bin", "greetd-dms-greeter-git").Output() - var installed []string - for line := range strings.SplitSeq(strings.TrimSpace(string(out)), "\n") { - if name, _, _ := strings.Cut(line, " "); name != "" { - installed = append(installed, name) - } - } + out, _ := exec.Command("pacman", append([]string{"-Q"}, retiredGreeterPackages...)...).Output() + installed := retiredGreeterPackagesInstalled(string(out)) if len(installed) == 0 { return nil } @@ -1723,6 +1720,19 @@ func checkRetiredGreeterPackages() []checkResult { }} } +// pacman -Q answers a missing name with any installed package that provides it, +// so the dux-greeter successors come back under the retired names they provide. +func retiredGreeterPackagesInstalled(pacmanQuery string) []string { + var installed []string + for line := range strings.SplitSeq(strings.TrimSpace(pacmanQuery), "\n") { + name, _, _ := strings.Cut(line, " ") + if slices.Contains(retiredGreeterPackages, name) { + installed = append(installed, name) + } + } + return installed +} + // Chromium, Electron and libadwaita follow light/dark through the settings // portal; without it they fall back to GTK theme colours that never update. func checkSettingsPortal() []checkResult { diff --git a/core/cmd/dms/commands_doctor_test.go b/core/cmd/dms/commands_doctor_test.go index 9cd2eb099..f213d3955 100644 --- a/core/cmd/dms/commands_doctor_test.go +++ b/core/cmd/dms/commands_doctor_test.go @@ -6,6 +6,7 @@ import ( "encoding/binary" "os" "path/filepath" + "slices" "strings" "testing" ) @@ -497,3 +498,21 @@ func TestCheckGreetdSession(t *testing.T) { } } } + +func TestRetiredGreeterPackagesInstalled(t *testing.T) { + tests := map[string]struct { + query string + want []string + }{ + "dux successor satisfying the retired names": {"dux-greeter-git 2.0.0.r165.g7cf13f1-1\ndux-greeter-git 2.0.0.r165.g7cf13f1-1\ndux-greeter-git 2.0.0.r165.g7cf13f1-1\n", nil}, + "retired package still installed": {"greetd-dms-greeter-git 1:1.6.2.r0.g0175be5-1\ngreetd-dms-greeter-git 1:1.6.2.r0.g0175be5-1\n", []string{"greetd-dms-greeter-git", "greetd-dms-greeter-git"}}, + "nothing installed": {"", nil}, + } + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + if got := retiredGreeterPackagesInstalled(tc.query); !slices.Equal(got, tc.want) { + t.Fatalf("got %v, want %v", got, tc.want) + } + }) + } +} diff --git a/quickshell/Modals/Changelog/ChangelogModal.qml b/quickshell/Modals/Changelog/ChangelogModal.qml index d642964f3..d52f43140 100644 --- a/quickshell/Modals/Changelog/ChangelogModal.qml +++ b/quickshell/Modals/Changelog/ChangelogModal.qml @@ -24,6 +24,8 @@ DFloatingWindow { objectName: "changelogModal" title: I18n.tr("What's New", "changelog window title") + implicitWidth: modalWidth + implicitHeight: modalHeight minimumSize: Qt.size(modalWidth, modalHeight) maximumSize: Qt.size(modalWidth, modalHeight) visible: false diff --git a/quickshell/Modals/Greeter/GreeterModal.qml b/quickshell/Modals/Greeter/GreeterModal.qml index 2fb922667..b39da61fc 100644 --- a/quickshell/Modals/Greeter/GreeterModal.qml +++ b/quickshell/Modals/Greeter/GreeterModal.qml @@ -87,6 +87,8 @@ DFloatingWindow { objectName: "greeterModal" title: I18n.tr("Welcome", "greeter modal window title") + implicitWidth: modalWidth + implicitHeight: modalHeight minimumSize: Qt.size(modalWidth, modalHeight) maximumSize: Qt.size(modalWidth, modalHeight) visible: false diff --git a/quickshell/Modals/PolkitAuthModal.qml b/quickshell/Modals/PolkitAuthModal.qml index 86979eb6b..c696daeec 100644 --- a/quickshell/Modals/PolkitAuthModal.qml +++ b/quickshell/Modals/PolkitAuthModal.qml @@ -38,6 +38,8 @@ DFloatingWindow { title: I18n.tr("Authentication", "noun, polkit dialog title and settings section title") minimumSize: Qt.size(Theme.dialogMaxWidth, Math.min((screen?.height ?? 1080) - Theme.spacingXL * 2, Math.max(220, contentLoader.item?.implicitHeight ?? 0))) maximumSize: minimumSize + implicitWidth: minimumSize.width + implicitHeight: minimumSize.height visible: false onClosed: cancelAuth() diff --git a/quickshell/Modals/WindowRuleModal.qml b/quickshell/Modals/WindowRuleModal.qml index f7f36f06e..2df0f48ca 100644 --- a/quickshell/Modals/WindowRuleModal.qml +++ b/quickshell/Modals/WindowRuleModal.qml @@ -15,6 +15,8 @@ DFloatingWindow { title: editor.title minimumSize: Qt.size(Math.min(SettingsMetrics.formDialogWidth + Theme.spacingL * 2, Screen.width), Math.min(Math.round(Theme.fontSizeMedium * 52), Screen.height)) maximumSize: minimumSize + implicitWidth: minimumSize.width + implicitHeight: minimumSize.height visible: false onClosed: hide() diff --git a/quickshell/Modals/WorkspaceRenameModal.qml b/quickshell/Modals/WorkspaceRenameModal.qml index de87b3832..dbd78b799 100644 --- a/quickshell/Modals/WorkspaceRenameModal.qml +++ b/quickshell/Modals/WorkspaceRenameModal.qml @@ -15,6 +15,8 @@ DFloatingWindow { title: I18n.tr("Rename Workspace") minimumSize: Qt.size(400, renameDialog.implicitHeight) maximumSize: Qt.size(400, renameDialog.implicitHeight) + implicitWidth: minimumSize.width + implicitHeight: minimumSize.height visible: false onClosed: hide()