Skip to content

Commit 1a65d8a

Browse files
committed
fix(macOS): hide dock icon when closing settings with ⌘+W
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 <iva.horn@nextcloud.com>
1 parent 8884ce7 commit 1a65d8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gui/settingsdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent)
153153
// People perceive this as a Window, so also make Ctrl+W work
154154
auto *closeWindowAction = new QAction(this);
155155
closeWindowAction->setShortcut(QKeySequence("Ctrl+W"));
156-
connect(closeWindowAction, &QAction::triggered, this, &SettingsDialog::accept);
156+
connect(closeWindowAction, &QAction::triggered, this, &SettingsDialog::close);
157157
addAction(closeWindowAction);
158158

159159
setObjectName("Settings"); // required as group for saveGeometry call

0 commit comments

Comments
 (0)