CopyQ icon indicating copy to clipboard operation
CopyQ copied to clipboard

Support Ctrl+W shortcut to close window

Open JustBugReporting opened this issue 1 year ago • 5 comments

The common Ctrl+W shortcut, which is normally used to close windows, doesn't work in CopyQ. Please add it; it's very convenient.

It's much more convenient than Alt+F4.

JustBugReporting avatar Apr 07 '25 08:04 JustBugReporting

This can be done by adding the following command (here is how to add the command to CopyQ):

[Command]
Command="
    copyq hide"
Icon=
InMenu=true
Name=Close Main Window
Shortcut=ctrl+w

hluk avatar Apr 07 '25 15:04 hluk

Thank you, it works! Any chance this could be added by default? It's a very common keyboard shortcut for closing windows, so adding it would significantly improve the UX for those who are used to it in other programs.

JustBugReporting avatar Apr 12 '25 07:04 JustBugReporting

Any chance this could be added by default?

Unlikely. Ctrl+W is the default shortcut for closing/removing tabs.

hluk avatar Apr 13 '25 05:04 hluk

I don't see any contradiction here; I think these two things can coexist.

Look, in most applications that use tabs, Ctrl+W closes the current tab. Once there are no tabs left, it closes the window.

In CopyQ, when there are no tabs left, Ctrl+W simply does nothing. If this behavior were changed (i.e., to close the window when no tabs remain), it wouldn't break anything.

JustBugReporting avatar Apr 14 '25 16:04 JustBugReporting

bq. Look, in most applications that use tabs, Ctrl+W closes the current tab. Once there are no tabs left, it closes the window.

There is always at least one tab. I have not put any thought into this, but it looks like Ctrl+W does not have any effect if there is a single tab.

I think the behavior could be similar to web browsers: Close the tab (delete all items) and exit. Re-opening the app would create a default tab. Would that make sense?

hluk avatar Apr 15 '25 15:04 hluk