Bug 456847 - Changing Autohide setting with shortcut causes issues with maximised window sizes
Summary: Changing Autohide setting with shortcut causes issues with maximised window s...
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 5.25.3
Platform: Manjaro Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-18 06:13 UTC by Oliver Hiorns
Modified: 2022-07-20 00:20 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Hiorns 2022-07-18 06:13:24 UTC
STEPS TO REPRODUCE
1. Set up keyboard shortcut to toggle autohide - or can use command:
```
qdbus org.kde.plasmashell /PlasmaShell evaluateScript "p = panelById(panelIds[0]); p.hiding = p.hiding == 'none' ? 'autohide' : 'none'"
```

2. Open some windows and maximise them
3. Activate shortcut to switch from "always shown" to "autohide"
4. Windows automatically expand to fill new space
5. Activate shortcut again to switch back to "always shown"

OBSERVED RESULT
Windows do not automatically shrink back down to the new size.
They do adjust to the new size, if you trigger some kind of recalculation. The ways I have found so far are:
- Perform an alt+tab
- Unmaximise + maximise window
- Right click to create a menu
- Click in the window after creating a right click menu

EXPECTED RESULT
They do automatically readjust. (This worked in Plasma 5.24.5)
This does seem to happen correctly if the mouse is at the bottom of the screen duing step 5 (in this case the window is sized not taking into account with the panel on top of it, then the shortcut causes no visual change because the panel is already unhidden, but the window instantly resizes)

SOFTWARE/OS VERSIONS
Linux: Manjaro Linux (5.19.0-1-MANJARO)
KDE Plasma Version: 5.25.3
KDE Frameworks Version: 5.96.0
Qt Version: 5.15.5

ADDITIONAL COMMENTS
(Sorry for such an incredibly niche bug)
Basically it seems like upon changing the hiding property of the panel, it is necessary to ensure all maximised windows have their sizes re-checked, even though normally this causes no visual difference due to being in the panel settings screen. It's only when you use a shortcut to avoid the panel settings screen that you observe the bug.
Comment 1 Oliver Hiorns 2022-07-18 06:20:21 UTC
Sorry, should have mentioned - my system is running on Wayland.
Comment 2 Nate Graham 2022-07-18 22:40:29 UTC
Can reproduce.
Comment 3 Oliver Hiorns 2022-07-20 00:20:40 UTC
I mentioned how the window size does readjust correctly if the mouse is already causing the panel to be shown when the setting is toggled - it also seems to happen if a widget (e.g. Application Launcher) is activated during or after the settings toggle.

To clarify:
1. If a widget is activated when the setting is toggled, then maximised windows resize correctly and immediately
2. If a widget is activated while the window is in the incorrect state (after toggling setting, before the window has readjusted to the new size) this seems to trigger recalculation and the window resizes itself into the correct state.

Since the correct behaviour is observed either when the panel is shown due to mouse proximity and also when it is shown due to an activated widget, this seems to suggest behaviour is correct whenever the panel is shown.

Perhaps it is possible that the regression is due to a change to the way dimensions are calculated for the panel? If the windows do recalculate upon the setting being changed, but the panel reports height=0 due to not yet having reappeared this could cause windows to occupy the whole screen including space which is under the panel when it appears, which is the issue. That would be consistent with the bug not occuring if the panel is already shown, since then when the recalculation occurs, the panel's height is already known and the correct value is used.