From 30b7fbf1e9056acb8645d58258eb789c61105770 Mon Sep 17 00:00:00 2001 From: Iva Horn Date: Thu, 26 Mar 2026 09:55:51 +0100 Subject: [PATCH] =?UTF-8?q?fix(macOS):=20hide=20dock=20icon=20when=20closi?= =?UTF-8?q?ng=20settings=20with=20=E2=8C=98+W?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ⌘+W shortcut was connected to QDialog::accept(), which internally calls hide() and emits QEvent::Hide. The ForegroundBackground event filter only listens for QEvent::Close, so the dock icon remained visible. Clicking the window's close button works correctly because it sends QEvent::Close directly. Connecting the shortcut to close() instead of accept() ensures QEvent::Close is sent, making ⌘+W behave identically to the close button: the event filter fires, ToBackground() is called, and the dock icon disappears. Signed-off-by: Iva Horn --- src/gui/settingsdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index 0895c49c97fb6..eabd26f097cb6 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -153,7 +153,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) // People perceive this as a Window, so also make Ctrl+W work auto *closeWindowAction = new QAction(this); closeWindowAction->setShortcut(QKeySequence("Ctrl+W")); - connect(closeWindowAction, &QAction::triggered, this, &SettingsDialog::accept); + connect(closeWindowAction, &QAction::triggered, this, &SettingsDialog::close); addAction(closeWindowAction); setObjectName("Settings"); // required as group for saveGeometry call