Bug 485192

Summary: Zoom effect should have upper bound
Product: [Plasma] kwin Reporter: gardenapple <mailbox>
Component: effects-variousAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: fanzhuyifan, xaver.hugl
Priority: NOR    
Version First Reported In: 6.0.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description gardenapple 2024-04-07 18:28:38 UTC
My cat sat on my keyboard for a while and I came back to see my laptop screen being pure white. It remained that way even after a reboot.

I later realized that my cat must've held the Super+Plus key combo for a while, and increased the zoom factor to absurd values, so I was just seeing a single pixel. And, apparently, the zoom factor persists across sessions. My `.config/kwinrc` contained these lines:
[Effect-zoom]
InitialZoom=19659025508.39898

Easy to fix by removing these lines and restarting, or by simply pressing Super+0. But, this shouldn't have happened in the first place.

My proposal is to set a maximum value for the zoom factor, perhaps 10 is reasonable.

Also I question the utility of persistently storing the zoom value.
Comment 1 fanzhuyifan 2024-04-07 21:53:30 UTC
I believe 10 is too small for some visually impaired people. Anyways if your cat sat on your keyboard it could have done many things, including deleting everything. So it is not something that we can guard against...
Comment 2 Zamundaaa 2024-04-10 11:21:03 UTC
I think having *some* limit would definitely be reasonable
Comment 3 Bug Janitor Service 2024-04-10 11:28:13 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5591
Comment 4 Zamundaaa 2024-04-10 11:35:10 UTC
Git commit 485769ddd90013bffd9ff578559231a17f77ad7f by Xaver Hugl.
Committed on 10/04/2024 at 11:26.
Pushed by zamundaaa into branch 'master'.

plugins/zoom: limit the maximum zoom value to 100

Accidental changes in zoom can become very time consuming to undo otherwise.
With a value of 100, you can still zoom in far enough to only see a few pixels
on the screen, so it shouldn't break any actual use cases

M  +1    -0    src/plugins/zoom/zoom.cpp

https://invent.kde.org/plasma/kwin/-/commit/485769ddd90013bffd9ff578559231a17f77ad7f
Comment 5 gardenapple 2024-04-10 17:37:41 UTC
Thank you! It's a minor thing, and I agree that a limit of 10x would've been too low, I've since learned that some users do indeed rely on higher zoom levels. But, zooming to the scale of a fraction of a pixel just makes the desktop not usable to anyone, so I appreciate that it's guarded against.