MyGit

v0.1.7

YaLTeR/niri

版本发布时间: 2024-06-29 15:10:33

YaLTeR/niri最新发布版本:v0.1.8(2024-08-10 20:40:27)

Niri is a scrollable-tiling Wayland compositor. Windows are arranged in columns on an infinite strip going to the right. Opening a new window never causes existing windows to resize.

Here are the improvements from the last release.

Fractional Scaling

The big update this time is fractional scale support. You can set output scale to fractional values like 1.5 and automatic scale factor guessing will now return fractional scale factors.

On the surface this sounds simple, but under the hood, doing it properly required a complete refactor of the layout system to use fractional coordinates and sizes (and then chasing down all of the bugs caused by this).

The result is well worth it though. Borders, gaps and windows are always physical-pixel aligned, and not restricted to integer logical pixel positions. There's no blur or position-dependent +-1 px jank. Fractional-scale-aware clients remain crisp at any scale.

Here's a demo of going through every single currently representable fractional scale factor between 100% and 200% where everything remains crisp, including a 1 px checkerboard in mpv. Watch it in the native 1920×1080 resolution if you want to see the checkerboard correctly.

https://github.com/YaLTeR/niri/assets/1794388/458b3021-b1f0-4c30-8f22-6db63af79a41

As a bonus, you can set the scale to a value below 1, which will make things smaller and give you more space. This could be useful in specific cases like monitors with very big pixel size, but it will lose you some image crispness.

Fractional Layout

As previously mentioned, niri layout now completely operates in floating-point. While fractional scaling benefits the most from this, fractional layout is also useful for integer scales.

Concretely, you can now set border and focus ring width, gaps, struts to fractional values, which will round to physical pixels according to the monitor's scale factor. Which means you can have 1 px wide borders on a 200% monitor for example by setting the border width to 0.5.

The view position is also no longer restricted to integer logical pixels, so when you do a touchpad swipe gesture on a 200% monitor, windows will move in single physical pixel increments.

If you're interested in the technical details of how this works, check this wiki page.

Window Screencasts

You can now select an individual window to screencast through xdg-desktop-portal-gnome. You can resize windows, open pop-ups, use block-out rules, and it will all work correctly.

https://github.com/YaLTeR/niri/assets/1794388/c792b448-5b16-4f2d-825f-eebabdad519b

This involved some refactoring of the PipeWire screencasting code in niri, most notably adding support for changing the video stream size on the fly. As a bonus, monitor screencasts will now also keep running through monitor resolution changes.

I still need to work out some details like frame callback delivery to obscured windows, but the current implementation should already work for a lot of use cases.

xdg-activation

@pcc implemented the xdg-activation-v1 protocol which allows apps to pass focus to other apps. For example, clicking on a link in a GTK 4 app will now automatically focus your browser, switching the workspace if necessary.

https://github.com/YaLTeR/niri/assets/1794388/fd444abc-77cd-4089-b43d-97846deb4931

This protocol is also used by clients to indicate urgency; this part is not implemented yet (but planned).

Workspace Switch Mouse Gesture

Last release I added the horizontal Mod + middle mouse drag gesture to scroll the view. This release I also added the vertical drag gesture to switch workspaces, just like on a touchpad you can swipe both horizontally and vertically.

https://github.com/YaLTeR/niri/assets/1794388/3c9485be-189c-4c7c-9094-a3346cf3e36f

Other improvements in this release

相关地址:原始地址 下载(tar) 下载(zip)

1、 niri-0.1.7-vendored-dependencies.tar.xz 53.39MB

查看:2024-06-29发行的版本