r/windowsapps • u/Ill-Department9794 • 55m ago
Developer WinScreen: bringing interactive pip, video app background, floating anchors, and various window utilities to a foss option
I've been working on WinScreen for a while. It's a free, MIT-licensed window tool for Windows 10/11. It started because I liked what WindowTop does. However, some features felt quite incomplete and the software is also locked behind paywalls. So after a couple hundred hours working with claude, we have managed to develop a stable utility that combines most WindowTop paid features, some useful window utilities, and a few innovative effects that we discovered along the way.
Interactive PiP
Every PiP tool I tried on Windows is a DWM thumbnail. That's a picture the compositor draws for you, and you can't click into it. I wanted to scroll a page or reply in a chat inside the little view, and that's where it got messy.
The real window has to keep drawing. Minimize it and it stops rendering. Cover it and some apps stop painting too. (such as chrome) What worked was parking it just off the edge of a monitor with 2 px still on screen. Windows considers it visible, so it keeps rendering, and you never see it. I also drop its taskbar button so it doesn't feel like a ghost window.
Input goes through a low-level mouse hook. It catches what you do on the view, and a worker thread maps it into the app's coordinates and posts the messages. WinUI/Store apps ignore posted messages, so those get driven through UI Automation. I also attach the view's input thread to the app's, so you get the app's own cursor shapes (I-beam over text, hand over links).
Then Chrome wouldn't scroll. I spent ages on this. It turns out Chromium hit-tests before handling the wheel: if its window isn't the one under the pointer, it does nothing. The fix was almost silly. While you're using a view, the parked window goes to opacity 1 out of 255. That's enough to count as "under the pointer" and not enough for anyone to see.
Hover was next. The app thinks the mouse left the moment your pointer is over the view, so hover menus and tooltips close instantly. I ended up writing a tiny C DLL (built with Zig) that installs a WH_GETMESSAGE hook only in the target app and drops WM_MOUSELEAVE while you're using its view. VS Code and Discord behave normally with it.
Menus and popups the app opens get moved next to your pointer, and submenus keep their layout relative to their parent. Views can also be rotated or mirrored. Clicks are mapped with the same transform the shader uses to draw, so you can still use an app sideways if you really want to.
Video backgrounds, which came out of Glass (Ideas taken from lively wallpaper, but it can be applied to any apps, despite every window draws their menus differently)
This one wasn't planned. Glass mode started as a D3D11 overlay over the window, fed by a capture of it. Each frame it reads the page colour and fades every pixel by how far it is from that colour. Text stays solid and the page goes see-through. I went with per-pixel on purpose. An earlier version tried to detect which parts were images, and it was a disaster: blocks flipping as you scrolled.
Once the page was see-through, you'd mostly see the desktop through it. With Lively running, that meant a video wallpaper showing faintly behind my editor, which looked great until another window got in the way. So I thought: why not put the video behind the app itself? Basically Lively, but per window, sitting between the page and the text.
The overlay already had the window as a premultiplied layer, so I added a second pass that composites it over a picture. Then GIFs, which large ones decode as they play instead of sitting in RAM. Then video: a Media Foundation engine on the overlay's own GPU device. A new video frame only reruns that second pass, so it's cheap.
Everything else
- Anchors are floating buttons that bring a window back from any virtual desktop. You can drop files on them.
- The usual window tools: pin, see-through, click-through, borderless, crop, roll up, Alt+drag.
- Dark mode for any app that keeps colours' hues.
- And various utilities as shown in the demo video
GitHub: https://github.com/DarkLian/WinScreen
You can also view the video on youtube: https://www.youtube.com/watch?v=e7Cy8dLCOQk
If an app misbehaves inside a view, I'd really like to hear about it. That's where most of the remaining edge cases are.
