Bug 481335

Summary: Edge trigger (hot corner) for Overview effect cycles between Overview and "Grid View", with no way to change this
Product: [Plasma] kwin Reporter: Adam Fontenot <adam.m.fontenot+kde>
Component: effects-overviewAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: fanzhuyifan, kurnevsky, nate
Priority: NOR Keywords: qt6, usability
Version First Reported In: 5.93.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.1
Sentry Crash Report:

Description Adam Fontenot 2024-02-14 19:22:20 UTC
SUMMARY

I've had an edge trigger for the "present windows" effect for as long as I've been using KDE. At some point, during the transition to Plasma 6, this became the "overview" effect. "Present Windows" is still available as an edge trigger action, however.

This is actually nice, because it helped me discover the Overview effect, and I really like it. What I have no use for, however, is the "grid view" effect. This is an effect that displays the virtual desktops in a grid, and has the default global shortcut Meta+G; the KCM for the Overview effect calls it "grid view".

Unfortunately, if you hit the hot corner again when the Overview effect is displayed, it goes to grid view instead. I'd prefer it to simply toggle the overview (closing it and returning to the previous desktop view).

STEPS TO REPRODUCE
1. Enable "Overview" as one of your edge trigger actions.
2. Hit the edge trigger to launch overview. Hit the edge trigger again.

OBSERVED RESULT
The Overview effect changes and becomes the "Grid View" instead.

EXPECTED RESULT
The edge trigger should probably have multiple options, e.g. "Overview", "Overview - Grid View", and "Overview - Cycle". This would be similar to how "Present Windows" has multiple edge trigger options to change its behavior.

On the other hand, toggling between the two Overview views is very strange behavior, given that the main Overview effect already shows the virtual desktops. Unsurprisingly, there isn't a default global shortcut to toggle the views like this. So an alternative might be to have the edge trigger just toggle Overview, with no other options.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.93.0
KDE Frameworks Version: 5.249.0
Qt Version: 6.7.0
Kernel Version: 6.7.4-arch1-1 (64-bit)
Graphics Platform: Wayland
Comment 1 Bug Janitor Service 2024-02-15 13:15:10 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5213
Comment 2 Nate Graham 2024-02-15 17:02:32 UTC
Can confirm, yeah. This is a bit awkward.
Comment 3 Vlad Zahorodnii 2024-02-16 09:06:17 UTC
Git commit fc92544cb3530ecf60aa110339b5e198b25f9301 by Vlad Zahorodnii.
Committed on 16/02/2024 at 08:59.
Pushed by vladz into branch 'master'.

plugins/overview: Allow switching between modes using shortcuts while already active

Overview and Grid modes have shortcuts assigned to them. While they
provide a way to toggle the overview effect between on and off state, in
other words overview <-> off or grid <-> off, it's not possible to move
between the modes by pressing those shortcuts, e.g. off -> overview ->
grid -> overview -> grid -> ... -> off.

The culprit seems to be that EffectTogglableState has two "inactive"
states - Inactive and Stopped. It's counter-intuitive and needs a further
cleanup.

To make switching between overview modes work, this change makes
EffectTogglableState::toggle() toggle the state based on the Active state.
There's only one active state.

M  +1    -1    src/effect/effecttogglablestate.cpp

https://invent.kde.org/plasma/kwin/-/commit/fc92544cb3530ecf60aa110339b5e198b25f9301
Comment 4 Bug Janitor Service 2024-02-16 09:06:53 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5221
Comment 5 Vlad Zahorodnii 2024-02-16 09:14:26 UTC
Git commit 58f33b03a261c099c999951bb892a77db1b92826 by Vlad Zahorodnii.
Committed on 16/02/2024 at 09:06.
Pushed by vladz into branch 'Plasma/6.0'.

plugins/overview: Allow switching between modes using shortcuts while already active

Overview and Grid modes have shortcuts assigned to them. While they
provide a way to toggle the overview effect between on and off state, in
other words overview <-> off or grid <-> off, it's not possible to move
between the modes by pressing those shortcuts, e.g. off -> overview ->
grid -> overview -> grid -> ... -> off.

The culprit seems to be that EffectTogglableState has two "inactive"
states - Inactive and Stopped. It's counter-intuitive and needs a further
cleanup.

To make switching between overview modes work, this change makes
EffectTogglableState::toggle() toggle the state based on the Active state.
There's only one active state.


(cherry picked from commit fc92544cb3530ecf60aa110339b5e198b25f9301)

M  +1    -1    src/effect/effecttogglablestate.cpp

https://invent.kde.org/plasma/kwin/-/commit/58f33b03a261c099c999951bb892a77db1b92826
Comment 6 Bug Janitor Service 2024-02-16 09:17:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5222
Comment 7 Vlad Zahorodnii 2024-02-21 08:51:30 UTC
Git commit f77f5b234256af9b22b1852364dcedd05d1d9d6f by Vlad Zahorodnii.
Committed on 21/02/2024 at 08:44.
Pushed by vladz into branch 'master'.

plugins/overview: Make screen edge toggle overview rather than cycle between modes

The user may have no usecase for the grid view mode, i.e. they may want
to activate overview, do their thing, and then return back to normal
desktop. However, with the current behavior, there's one extra step
(switch to grid mode) in order to go back to desktop.

In hindsight, we should have added different screen edge actions for
overview and grid modes. This can be done in 6.1.

M  +1    -1    src/plugins/overview/overvieweffect.cpp

https://invent.kde.org/plasma/kwin/-/commit/f77f5b234256af9b22b1852364dcedd05d1d9d6f
Comment 8 Vlad Zahorodnii 2024-02-21 10:28:42 UTC
Git commit d26d95ed3bd95f7dd426f5a4785b18e3e4b249a3 by Vlad Zahorodnii.
Committed on 21/02/2024 at 10:06.
Pushed by vladz into branch 'Plasma/6.0'.

plugins/overview: Make screen edge toggle overview rather than cycle between modes

The user may have no usecase for the grid view mode, i.e. they may want
to activate overview, do their thing, and then return back to normal
desktop. However, with the current behavior, there's one extra step
(switch to grid mode) in order to go back to desktop.

In hindsight, we should have added different screen edge actions for
overview and grid modes. This can be done in 6.1.


(cherry picked from commit f77f5b234256af9b22b1852364dcedd05d1d9d6f)

M  +1    -1    src/plugins/overview/overvieweffect.cpp

https://invent.kde.org/plasma/kwin/-/commit/d26d95ed3bd95f7dd426f5a4785b18e3e4b249a3
Comment 9 Evgeny 2024-02-29 11:51:23 UTC
> In hindsight, we should have added different screen edge actions for
> overview and grid modes. This can be done in 6.1.

Is there an issue for that? I'd really like to have grid mode available from hot corner - I always used it but now it's not available.
Comment 10 Vlad Zahorodnii 2024-02-29 11:56:17 UTC
We already added it. It will be available in 6.1
Comment 11 Evgeny 2024-02-29 11:57:54 UTC
Do you mind specifying the commit/MR? I'd probably like to backport it to 6.0 for myself :)
Comment 12 Evgeny 2024-02-29 11:58:55 UTC
I think I found it: https://invent.kde.org/plasma/kwin/-/merge_requests/5298