Skip to content
← Back to blog

November 13, 2026 · 4 min read

A fisheye screen magnifier for Linux (Wayland)

My fisheye magnifier, ross_fisheye, started as a magnifier for my desktop and ended up released with packages. A shader that looks like cloth pushed up by a glass ball, a mouse that arrived at 80 %, and how to capture a demo without a screen.

In this post
  1. The shader: from bubble to cloth
  2. The mouse that arrived at 80 %
  3. Releasing it
  4. A demo without a screen
  5. What I learned

Wayland, the graphics system of modern Linux desktops, has no screen magnifier that works the same on any compositor (the program that draws the windows). I use niri, and what was out there were tools that capture the screen once and let you zoom into that picture. The best one I found was woomer, a Rust magnifier built on raylib: a shortcut freezes the screen and you zoom with the wheel.

I wanted something else: a lens that follows the mouse and bulges the screen, like a fisheye. So I forked it and added that mode. At first it was just for me; two months later I released it as ross_fisheye.

The ross_fisheye lens bulging a page title

The shader: from bubble to cloth

The first version was a classic lens: a circle with an edge, a glowing ring, a drop shadow. Technically fine, and it looked like a glass bubble stuck on the screen. Not what I wanted.

What I had in mind was a different picture: stretched cloth pushed up from below by a glass ball. No edge: the middle grows and the magnification fades out toward the outside until it disappears. Describing it in those words helped more than any number. The shader ended up like this:

  • Smooth radial mapping. Each pixel of the lens reads the screen from a point closer to the center, and how much closer follows a smootherstep curve, which starts and ends without jumps. That’s why there’s no edge.
  • Light from the slope. Where the “cloth” rises, a light from the top left brightens it; where it falls, it darkens a little. That gives volume with no drop shadow or ring.

I tried several variants and kept all of them in the repository. The chosen one starts at 1.5× magnification with a 300-pixel radius; the wheel changes the magnification and Shift plus the wheel, the radius.

The mouse that arrived at 80 %

On the laptop screen, at 1.25 scale, the lens didn’t follow the mouse: it lagged behind, and the further from the corner, the worse.

Measuring it, the pointer arrived at exactly 80 % of its real position. 0.8 is 1 / 1.25. With the high-density (HiDPI) flag on Linux, raylib draws the logical image in a corner of the physical buffer and also scales the mouse by the ratio between the two. On Wayland the compositor already delivers the mouse in logical coordinates, so the correction was applied twice.

The fix: in fisheye mode HiDPI is on, raylib doesn’t request full screen (the compositor does it with a window rule) and the mouse is corrected by multiplying it by the scale before converting to buffer pixels. I verified it by capturing each screen separately, the laptop’s and the external monitor, because each has its own scale.

Releasing it

To release it I did three things:

  1. Its own name and window title. The command is ross-fisheye, and woomer’s classic mode is still there with --zoom, crediting the original project (MIT).
  2. A clean history. The old commits had my machine’s name as the author. The public repository started with a fresh history.
  3. Packages for three families. The raylib crate with Wayland support needs the system’s GLFW 3.4, and Ubuntu 22.04 ships an older one. CI builds GLFW 3.4 statically (with the zip’s hash pinned), so the same binary runs on Ubuntu 22.04, Debian, Fedora and Arch. The packages are on repo.rossmel.com.

A demo without a screen

For the page’s screenshots I didn’t want to use my own desktop. In GitHub Actions I run Sway without a screen (headless), open a page and launch the lens. Problem: in headless Sway the lens gets no pointer motion, not even simulated. The fix was an environment variable, for tests only, that pins the lens position. That’s how the page’s three screenshots come out, identical every time.

The lens over a page's menu

What I learned

  • A visual effect either feels right or it doesn’t. Describing it in words (“cloth pushed from below”) took me further than tweaking parameters blindly.
  • When something lands on an exact percentage (80 %), look for the scale that explains it: it’s almost always being applied twice.
  • With fractional scaling you have to measure on every screen: the laptop and the external monitor behave differently.
  • Respect the fork: keeping the original mode and the credit makes it easier to explain.

Rossmel Abasto — Frontend → Fullstack Developer. LinkedIn · GitHub

Leer este artículo en español →See the case studyross_fisheye →A screen magnifier for Linux with a fisheye effect: the screen bulges like cloth pushed up by a glass ball. Open source.

Keep reading

Write to me: I read everything and reply by email.

Questions or comments about this post?

send-mail.sh