Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: full-screen zoom (accessibility via ctrl-scroll) #2781

Open
ybakos opened this issue Oct 6, 2018 · 26 comments
Open

RFC: full-screen zoom (accessibility via ctrl-scroll) #2781

ybakos opened this issue Oct 6, 2018 · 26 comments
Labels
enhancement New feature or incremental improvement

Comments

@ybakos
Copy link

ybakos commented Oct 6, 2018

Thank you for all things sway. I know there are way more important items, especially for 1.0, but I am submitting a feature request for accessibility.

On MacOS, a "killer" accessibility feature is enabling the user to zoom the entire screen via ctrl + two-finger scroll. While there are utilities for creating "magnifying glass" surfaces that zoom in on small parts of the screen, not many window managers support this like MacOS Quartz Compositor.

It would be amazing, and a big win for folks with accessibility needs, if this were a feature in Sway.

I myself don't have the chops to implement this and submit a PR. 😭

@ddevault
Copy link
Contributor

ddevault commented Oct 6, 2018

This is something I'd like to see in sway, too. However,

I myself don't have the chops to implement this and submit a PR. 

This is nonsense, anyone can learn and many people have cut their teeth on sway.

https://drewdevault.com/2017/01/06/Actually-you-CAN-do-it.html

@ybakos
Copy link
Author

ybakos commented Oct 7, 2018

@SirCmpwn I’m glad you’re a fan of the feature. I also did not mean to sound defeatist, and I do agree about the learning. Perhaps I should have said, “I have too much crap going on to commit to this.” Which isn’t an excuse either. 🤪

@ianyfan ianyfan added the enhancement New feature or incremental improvement label Oct 7, 2018
@Tormen
Copy link

Tormen commented Apr 25, 2019

👍 for a screen zoom feature. This is so handy. These days lots of software comes with their own zoom... but still I was using that 1 every day or 2nd-day under KDE and under compiz before that :)

@ddevault : As this feature seems to exist in wayfire, could you have a timeboxed look if there could be any chance to re-use / port this to swaywm or better to wlroots if that's possible ?

@ddevault
Copy link
Contributor

No, it wouldn't be possible to port from wayfire to wlroots.

@ibotty
Copy link

ibotty commented May 6, 2019

Can you give a (very broad) overview on how to tackle this issue for someone not familiar with wayland and wlroots APIs?

@tokyovigilante

This comment has been minimized.

@vidister
Copy link

@nkreer and I would like to implement this as well. But we're both not familiar with wayland/wlroots and need some hints on how to do start this.

@RazvanRotari
Copy link

I had a try to implement this by calling glViewport with a rect bigger that the screen, mostly worked ,but each app is zoomed independently, not the whole screen.

Another way of doing this might be to render the whole screen to a texture and then enlarge that one.

@myisaak
Copy link

myisaak commented Feb 3, 2021

Read the docs guys (@vidister hope this helps)!
wayland_client: https://wayland.freedesktop.org/docs/html/apb.html
wlroots: https://github.com/swaywm/wlroots/tree/master/protocol

@paolomainardi
Copy link

Any updates on this one ?

@frigaut
Copy link

frigaut commented Jun 4, 2022

Wayfire probably does that through OPENGL, which, unless I am mistaken, sway doesn't use. So I don't think implementation would be trivial. And it's a good thing that sway doesn't use OPENGL - saves your battery.

@emersion
Copy link
Member

emersion commented Jun 4, 2022

Sway does use OpenGL (it can also use Pixman on devices without a GPU).

@paolomainardi
Copy link

@emersion how much do you think is complex to build this feature on the current Sway codebase ? Assuming that all the needed pieces are still in place.

@paolomainardi
Copy link

@frigaut
Copy link

frigaut commented Jun 4, 2022

Sway does use OpenGL (it can also use Pixman on devices without a GPU).

my bad

@Beryesa
Copy link
Contributor

Beryesa commented Jun 5, 2022

What about vulkan renderer

@teknico
Copy link

teknico commented Nov 20, 2022

I had a try to implement this by calling glViewport with a rect bigger that the screen, mostly worked ,but each app is zoomed independently, not the whole screen.

Actually, zooming just one window is what I need. Is there a window manager that has this feature?

@tyalie
Copy link

tyalie commented Jul 22, 2023

I would also very much wish to see this feature come to sway. It would be awesome in order to explain to other people what you're doing right now.

@Simbi0z
Copy link

Simbi0z commented Aug 13, 2023

Is there a tool for wlroots based compositors that implements the magnifying glass feature?

@mooreye
Copy link

mooreye commented Apr 4, 2024

If anyone's interested, I hacked together a simple zoom in/out tool bound to a key. It zooms all outputs by a scale factor of ±0.1 either in or out. If scale is >=5, it will refuse to zoom in, and if it is <=0.25, it will refuse to zoom out, because overdoing it made my output glitchy and started killing windows. Change $mod+5 to your own key, and put this in ~/.config/sway/config:

# zoom in/out
bindsym --inhibited $mod+5       output * scale 1
bindsym --inhibited $mod+Shift+5 exec set -euo pipefail && scale=$(bc -l <<< $(swaymsg -t get_outputs | jq -r '.. | select(.focused?) | .scale')+.1) && [[ $(bc -l <<< "${scale} < 5"  ) == 1 ]] && swaymsg "output * scale ${scale}"
bindsym --inhibited $mod+Ctrl+5  exec set -euo pipefail && scale=$(bc -l <<< $(swaymsg -t get_outputs | jq -r '.. | select(.focused?) | .scale')-.1) && [[ $(bc -l <<< "${scale} > .25") == 1 ]] && swaymsg "output * scale ${scale}"

@vishalpaudel
Copy link

👀

any updates? the above command from @mooreye doesn't seem to work for me, pipefail doesn't seem like an option for me.

@mooreye
Copy link

mooreye commented Jul 21, 2024

👀

any updates? the above command from @mooreye doesn't seem to work for me, pipefail doesn't seem like an option for me.

I guess your sh command corresponds to a different shell than bash where there is no set -o pipefail option? In any case, try pasting these exec ... commands into a file with #!/bin/bash as the first line, make it executable, and put path to this file as a command.

@sertonix
Copy link

You can also remove o pipefail since it isn't used.

@bobblkabb
Copy link

bindte = CTRL SHIFT, mouse_down, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | grep float | awk '{print $2 + 0.05}')"
bindte = CTRL SHIFT, mouse_up, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | grep float | awk '{print $2 - 0.05}')"

@vishalpaudel
Copy link

vishalpaudel commented Jul 23, 2024

ya, the command works using bash, but doesn't really do what I needed, a workaround I have is to

  1. use grimshot save screen
  2. open the saved image in fullscreen in firefox
  3. zoom using the firefox image viewer

I could maybe do something like:

zoomfile=/tmp/zoomimage.png grimshot save screen $zoomfile | xargs firefox --new-tab

@telychko
Copy link

All of that approaches is a workaround. It should be implemented in compositor (of course if it's not against it's philosophy).

That's my workarounds:

SCALE="$(swaymsg -t get_outputs | jq ".[] | select(.focused == true) | .scale" | awk -vv="$1" '{print($1+v)}')"
swaymsg "output - scale $SCALE"

Where $1 above is the scale factor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or incremental improvement
Development

No branches or pull requests