Bug 308331 - Close window (or other) shortcut to be effective from window switcher view
Summary: Close window (or other) shortcut to be effective from window switcher view
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: tabbox (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: usability
: 390194 482776 (view as bug list)
Depends on: 370185
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-13 16:32 UTC by Lassi Väätämöinen
Modified: 2024-03-16 00:46 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lassi Väätämöinen 2012-10-13 16:32:37 UTC
It would be useful to have "OS X-style" application closing from the window switcher. That is, when alt-tabbing through the window list, the window close shortcut (default: alt-F4), or even minimize shortcut, would be effective. Very neat way to closing down or hiding applications that are not needed.

Reproducible: Always

Steps to Reproduce:
1. Open several apps/windwos
2. Alt-tab through the windows
3. Hold down Alt and press F4 (or other shortcuts)
Actual Results:  
Nothing happens

Expected Results:  
Shortcut would be effective
Comment 1 Martin Flöser 2012-10-13 20:17:00 UTC
It's tricky due to the way global shortcuts work in KDE and the way KWin is intercepting the shortcut system during window switching.

For the default shortcut (Alt+F4) this could be hacked together, but it would only work as long as the shortcut uses Alt and window switching uses Alt. Not sure whether it's worth to introduce such a hack which would be rather inconsistent.

What I had already thought about was adding a close button to each of the entries in the list. That's actually already possible given that Plasma Active uses it. What do you think about that?
Comment 2 Lassi Väätämöinen 2012-10-13 20:37:27 UTC
(In reply to comment #1)
> It's tricky due to the way global shortcuts work in KDE and the way KWin is
> intercepting the shortcut system during window switching.
> 
> For the default shortcut (Alt+F4) this could be hacked together, but it
> would only work as long as the shortcut uses Alt and window switching uses
> Alt. Not sure whether it's worth to introduce such a hack which would be
> rather inconsistent.

Would it be possible for the window switcher to have its own shortcuts, that could be configured to have these actions (not necessarily the same as KWin globals are? So that the window switcher could be configured for this action separately from the globals?

And I don't also encourage making hacks over consistency :)

> What I had already thought about was adding a close button to each of the
> entries in the list. That's actually already possible given that Plasma
> Active uses it. What do you think about that?

Making this as separate mouse-controllable button in the window does not cut it as the original feature, although it might be useful. The idea on the "close-shortcut while swithing" is that it would not interfere with the keyboard workflow, requiring mouse or other control use. Also, what worries me with the extra button that there might be too many bells and whistles visible (of course, the buttons could be shown only on hover, or disabled fully by the user). And also, having extra controls for tweaking all options adds to the complexity (uh-oh, KDE3 :)
Comment 3 Thomas Lübking 2012-10-13 20:53:49 UTC
It's possible to get the configured global actions from inside the tabbox code and use that shortcut, we'll however have to handle the input events ourselves.

The problem about the shortcut restriction however is the severe one and holds:
if it does not include the tabbox trigger (Alt) you cannot trigger it w/o letting Alt and with it the tabbox go down - this could READ *could* be compensated by making Alt an ignored modifier, ie. if Alt+F4 is your sc, it just works. If Ctrl+F4 is ... uh- ohhh -> Alt+Ctrl+F4 is taken by the server and will get you to VT4.
In other words, this has its pitfalls as well.

The more robust approach on this was likely on Present Windows, which can be invoked by a shortcut, but does not automatically close, so we actually could use every shortcut for closing the selected window (next to the already present close button)

Either way, if we allow destructive operations in the tabbox, there needs to be at least a hint. Especially if they differ from the global shortcuts.

I'm not sure about buttons - means you got to use the left hand on the kbd to trigger the switcher and the right one on the mouse to click the button (or vv.) - sounds combersome.
Comment 4 Alexander Mentyu 2018-09-19 13:39:42 UTC
*** Bug 390194 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2018-09-19 13:50:45 UTC
In Bug 390194, Martin said:

> For what is worth to mention: the backend supports closing a window and
> exports it the QtQuick side. Just do: model.close(currentIndex) from Qml
> side to close the currently selected window.

I think adding a visible button would be nice too.
Comment 6 Nate Graham 2018-10-08 17:14:24 UTC
Blocked by Bug 370185, which makes it so that the window doesn't get keyboard focus. Once that's fixed, it should be as simple as calling `model.close(currentIndex)` with the specified keyboard shortcut.
Comment 7 Nate Graham 2018-11-15 00:04:06 UTC
Working on this...
Comment 8 Nate Graham 2018-11-15 14:11:43 UTC
Here's a patch for everything but the default Breeze switcher: https://phabricator.kde.org/D16897

The default Breeze switcher now works for general keyboard navigation using the arrow keys, but I'm having trouble getting the close functionality working using the same approach. Still hacking on it.
Comment 9 Bug Janitor Service 2020-06-25 05:06:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/115
Comment 10 Vlad Zahorodnii 2023-07-06 09:18:04 UTC
The new default task switcher (thumbnails grid) in plasma 6 has a close button. Marking the bug report as resolved. If other task switchers lack close buttons, please file bug reports for kdeplasma-addons.
Comment 11 Nate Graham 2023-07-14 16:17:55 UTC
This feature request is about using the keyboard shortcut (AKA Ctrl+W) to close the active window from the Task Switcher, not a clickable button.
Comment 12 Nate Graham 2024-03-08 00:02:28 UTC
*** Bug 482776 has been marked as a duplicate of this bug. ***
Comment 13 3kc2awgy 2024-03-16 00:46:38 UTC
"DEL" button or the "middle mouse button" would work for me as well