Bug 457800

Summary: [Feature Request] Magnifier (Zoom Effect) Toggle ON/OFF Shortcut
Product: [Plasma] kwin Reporter: Piotr Mierzwinski <piotr.mierzwinski>
Component: effects-variousAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: frederic.parrenin, kdebugs, nate, omar.helali, postix
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=464407
Latest Commit: Version Fixed/Implemented In: 5.27
Sentry Crash Report:
Attachments: Magnifier settings

Description Piotr Mierzwinski 2022-08-12 12:59:11 UTC
Created attachment 151284 [details]
Magnifier settings

SUMMARY
I would like to use Magnifier effect. Video in settings looks good, but I cannot find any toggle / shortcut to turn on it to have the same like in video in settings. The same situation is placed in other zoom effects.

Please consider I used many times shortcuts: Meta+= and Meta+-, but without any result - nothing happened.

I redit forum I found information that such command is missing in settings that effect, check this url:
https://www.reddit.com/r/kde/comments/mk4375/zoommagnifier_toggle/
I Manjaro forum I found that needs to install xbindkeys (add perform couple commands), which is missing by default in Neon and is not able to install it by Discover (cannot found it). Check below url:
https://forum.manjaro.org/t/how-to-zoom-in-out-with-key-mouse-in-kde/75525/8

STEPS TO REPRODUCE
1. Start System Settings
2. Enter Magnifier in search field
3. click into "Magnifier"
4. click into "Configure..." for Magnifier

OBSERVED RESULT
Only are available shortcut to zoom in and zoom out

EXPECTED RESULT
shortcut which will be able to turn on this effect

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.25.80
KDE Frameworks Version: 5.97
Qt Version: 5.15.5

ADDITIONAL INFORMATION
Comment 1 Omar Helali 2022-10-27 12:05:11 UTC
As workaround, I created a script that toggles the zoom and affected a shortcut to run it, then I map it with input-remapper (from AUR) until the new addition in kwin get fixed https://bugs.kde.org/show_bug.cgi?id=457800  Just update the zoom factor in your settings according to your needs. Here is the toggle script that uses an empty temp file (my tmp is mounted to RAM so it is the fastest process):

#!/bin/sh
TOGGLE=/tmp/.toggle
if [ ! -e $TOGGLE ]; then
   	touch $TOGGLE
   	qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "view_zoom_in"
else
    	rm $TOGGLE
    	qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "view_actual_size"
fi
Comment 2 Omar Helali 2022-10-27 12:14:18 UTC
Xdotool and Xbindkeys has nothing to do here, we need a toggle to the zoom effect so we can map it to any shortcut on extra mouse button. I ended replacing Xdotool with Input Remapper as it works perfectly on Wayland and X11 https://aur.archlinux.org/packages/input-remapper-git and it is really simple ... the new Map extra mouse buttons on Plasma System Settings should be fixed with kde-frameworks 100.
Comment 3 JJones 2022-11-08 03:12:58 UTC
(In reply to Omar Helali from comment #2)
Note that the "Actual Size" button will toggle between the last zoom and no zoom.
That's if you can get the key shortcuts to work... I have to change to and set the key bindings on one of the other zoom effects then apply that effect, then switch to the magnifier I want and apply.  I got here looking to see if there was a bug report on setting the key shortcuts.
Comment 4 Bug Janitor Service 2023-01-06 10:05:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3399
Comment 5 Vlad Zahorodnii 2023-01-06 15:23:45 UTC
Git commit b0e452563ba0ec996a54aa301939ce97ecdd702c by Vlad Zahorodnii.
Committed on 06/01/2023 at 13:41.
Pushed by vladz into branch 'master'.

kcms/effects: Fix effect loading/unloading order

There are effects that are mutually exclusive, e.g. magnifier and zoom.
They both use the same global shortcuts.

When switching from zoom to magnifier, the zoom effect must be unloaded
first, then the magnifier effect can be loaded. Doing so in the opposite
order will break global shortcuts in the magnifier effect because
zooming shortcuts are still bound by the zoom effect.

M  +12   -6    src/kcms/common/effectsmodel.cpp

https://invent.kde.org/plasma/kwin/commit/b0e452563ba0ec996a54aa301939ce97ecdd702c
Comment 6 Vlad Zahorodnii 2023-01-18 08:26:55 UTC
*** Bug 456854 has been marked as a duplicate of this bug. ***