Suggestion/Prototype: Improvements to KWin's Zoom Effect

Hello,
This is my first time posting here, so apologies if this belongs in a different category.

I have created a local prototype patch for KWin’s Zoom effect to demonstrate some potential improvements. Please note that this is merely a proposal, not a criticism of the current implementation.

I posted a demonstration of this prototype on Reddit, and it received a good number of upvotes. I am sharing it here for the developers’ consideration.
https://www.reddit.com/r/kde/comments/1tq4lh9/i_customized_and_patched_kwins_zoom_the_current/

Overview of the Changes

1. Multi-monitor behavior

  • Current: All screens zoom in simultaneously.
  • Prototype: Only the monitor containing the mouse cursor zooms in. The other monitors remain at normal scale.

2. Cursor movement

  • Current: Panning requires moving the cursor to the physical edge of the screen.
  • Prototype: The viewport pans while keeping the cursor centered. The cursor only moves from the center when the viewport reaches the physical edge of the display.

3. Zooming speed

  • Current: The zoom speed uses an easing effect.
  • Prototype: Changed to a constant, linear speed.

Technical Notes & Limitations
As this is strictly a proof-of-concept prototype, there are several limitations:

  • Tracking Mode Dependency: This prototype only functions correctly when “Pointer tracking” is set to “Proportional”. If set to “Centered” or other modes, the zoom functionality breaks.
  • Regarding “2. Cursor movement”: The panning behavior implemented here is essentially the same as the native “Centered” tracking mode. Therefore, if “1. Multi-monitor behavior” could be made to work properly under the native “Centered” mode, modifying “2. Cursor movement” might not be necessary.
  • Why it was built on “Proportional”: Currently, if “Pointer tracking” is set to “Centered” in a multi-monitor setup, the cursor gets stuck at the boundary between monitors. This made testing difficult, which is why I implemented the prototype around the “Proportional” setting instead.

I do not have the technical skills to properly fix the codebase or submit a Merge Request myself. However, I hope this prototype and the Reddit feedback can serve as a reference for developers willing to look into it.

Thank you.

hi, welcome.

if you need a zoom effect that is built around following the mouse and is limited in scope, i suggest you give the alternative effect called magnify a spin

i think it should be the default.

Thanks for the welcome and the suggestion!
I know about the Magnifier, but the magnified box moves across the physical screen. When the cursor goes to the edge, I have to look away from the center of the monitor, which makes it very hard to see.
Even if I tried to modify it, I think the Magnifier is fundamentally hard to use for many visually impaired people. That’s why I’m proposing improvements for the Zoom effect instead.

can you explain more about why it matters if the enlarged image is in the center of the screen vs if it follows the cursor?

i’m not clear on why that matters for a visually impaired person

i also think both magnify and zoom should be combined into one accessibility feature, with better scope and mouse tracking options.

on zoom, with mouse tracking and focus/cursor tracking disabled the feature is all but useless.

on push mode, it is marginally better in that you can at least bring the part of the screen into a comfortable viewing area with enough fiddling.

on centered mode, the zoom seems more intuitive (much like the magnifier) and you can easily find the part of the screen you need the enlarged view but the “center” is the center of the entire desktop, not just one of the monitors which can render certain areas unreachable depending on your zoom level and monitor arrangement (thinking of lazy “L” shaped monitor arrangements).

on proportional mode, the zoom is even more intuitive and without the unreachable area problem.

focus/cursor tracking can be nerve rattling in higher zoom levels for any of these modes.

Thanks for asking, and I appreciate your detailed breakdown of the different zoom modes! You understood the multi-monitor issue with the “Centered” mode that I was talking about.

To answer your question about why a fixed center is so important: it essentially comes down to physical viewing distance.

Visually impaired users often have a very limited focal range where we can clearly see things. We typically use large monitors (like 23 inches) and sit with our faces very close to the screen.

If the magnified area follows the cursor to the edge of the screen (for example, the top-right corner), the physical distance between my eyes and the target changes by 10cm or more. Because my viewing distance is so strictly limited, simply looking away from the center means I can no longer see it clearly.

To compensate for that, I would have to physically move my body to chase the cursor, or constantly adjust the zoom level every time the cursor moves. Doing this all day is extremely exhausting.

When the screen pans while keeping the cursor in the physical center of the monitor, I can keep my posture and face fixed in one comfortable spot.

1 Like

I want to help as much as I can.
Please feel free to ask me anything—even if something I said sounds contradictory or confusing.

ah, that is very helpful, thanks for that insight (no pun intended ;).

so it’s not just the enlargement of the screen image, but it’s also keeping that enlarged image in front of your head when your viewing distance from the monitor is quite short.

this is similar to another user who wanted a fixed portal of enlargement on the monitor that didn’t track the mouse, but instead showed an enlarged view of a fixed game element (compass if i recall) that is always on screen.

there is even an open “wishlist” bug report if you care to weigh in.

it seems like magnifier with a fixed position in the center of the monitor screen would be ideal for this use case.

the entire desktop (or just the one monitor) could then be slid underneath the “lens” like a micro phish (if you have ever used one of those)… the control of the sliding movement could be any of the mouse following zoom modes, but proportional would likely feel the most natural.

it would be most akin to using zoom with proportional but the view would be fixed on the screen rather than follow the cursor.

the difference from your prototype would be that the cursor would never move from the center of the viewing area and if you cursor over to the edge of your desktop/monitor you would just see blackness at the edge (or perhaps some user selected background pattern to indicate you have run off the edge).