Decided to try writing a Wayland compositor for fun.
-
replied to Ivan Molodetskikh on last edited by
Suddenly, @drakulix showcasing the Cosmic session running on, among other compositors, niri! On the big screen at the Ubuntu Summit
-
replied to Ivan Molodetskikh on last edited by
somehow this touch moving under stationary pointer works better than i expected
(yes trying to do a precise left click with an elbow was difficult)
-
replied to Ivan Molodetskikh on last edited by
By the way! I'll be giving a talk at RustCon in Moscow on December, 6!
Wherein I will briefly describe what a Wayland compositor is, and then show several testing and profiling workflows that I've been using to keep niri stable, robust and performant.
(The invitation to submit a talk was completely unexpected, guess niri found its way into the right eyes.
)
There will be a recording, though in Russian.
-
replied to Ivan Molodetskikh on last edited by
Interactive window moving, laptop lid and tablet mode switch binds, mouse and touchpad scroll speed setting in today's niri v0.1.10 release!
https://github.com/YaLTeR/niri/releases/tag/v0.1.10
Also, niri-ipc is now on crates.io, but keep in mind that it will not be Rust-semver-stable: https://crates.io/crates/niri-ipc
-
replied to Ivan Molodetskikh on last edited by
Added scaffolding for layer rules, along with a block-out-from rule. Now you can finally block notifications from screencasts!
Though, layer-shell surfaces don't have a "geometry" so if they have shadows or transparent padding, all of that becomes solid black, since niri has no way to know where the "actual content" of the layer surface is (that's what geometry is for windows).
-
replied to Ivan Molodetskikh on last edited by
We hit 4000 stars today on the niri repo!!
-
replied to Ivan Molodetskikh on last edited by
-
replied to Ivan Molodetskikh on last edited by
Somehow, a small change for tests escalated into trying to completely refactor how animation timing works in niri. And right now I find myself at the exact opposite of this picture. Unfortunately, time has not stopped and is causing problems
-
replied to Ivan Molodetskikh on last edited by
Like three complete refactors later, I think it's... working? For real this time? No weird issue is gonna sneak up that undermines the whole design?
-
replied to Ivan Molodetskikh on last edited by
Nothing seems to have caught on fire after one more day of personal testing and one more day in main. So here's a technical page I wrote about the the new niri animation timing design and its motivations: https://github.com/YaLTeR/niri/wiki/Animation-Timing
-
replied to Ivan Molodetskikh on last edited by
Today I merged a PR by FluxTape which adds "always empty workspace before first" to niri. At the surface this is just a simple config flag with obvious behavior, but it's actually full of edge cases! Things like which workspace to focus at startup. The code refers to workspaces by index in many places, and those all shift when you suddenly insert an empty workspace at index 0.
Took several days to catch them all even with our randomized tests, but I think it should be good now.
-
replied to Ivan Molodetskikh on last edited by
>did a +4,657 −4,237 refactor in the layout code
>while testing, already found two uncaught regressions introduced in previous niri releases, and no issues with the refactor -
replied to Ivan Molodetskikh on last edited by
This morning was my niri (-adjacent) talk!
Went really well, got many interesting questions!
They promised us video recordings in a few days, so I'll post a link when I get it. Though of course the talk is in Russian.
-
replied to Ivan Molodetskikh on last edited by
hmm
-
replied to Ivan Molodetskikh on last edited by
unusual sights
-
replied to Ivan Molodetskikh on last edited by
Turns out, there's a lot of details to get right when implementing a floating window space. For example, dialog windows should always show above their parent window. Otherwise, it's easy to lose them under the (usually much bigger) parent.
The WIP floating branch in niri now handles this properly, even for xdg-desktop-portal dialogs (like file chooser) as long as the app correctly parents them via xdg-foreign.
-
replied to Ivan Molodetskikh on last edited by
Another piece of the floating puzzle: keeping windows on screen. When you change your monitor scale or resolution, you don't want your floating windows to suddenly go unreachable behind the monitor's new borders.
Here I'm resizing a nested niri with three windows, simulating resolution changes. No matter what I do, they always remain partially visible and reachable. Even for more unusual cases like trying to resize a window into out of bounds.
-
replied to Ivan Molodetskikh on last edited by
In the tiling layout, niri is constantly asking windows to assume their expected size. In contrast, floating windows should be able to freely change size as they see fit.
The logic turns out to be quite tricky. On the one hand we want a window to keep its latest size, but on the other we still want to be able to resize the window, which means asking it for a different size. The window can take a second to respond, or respond with a yet another size, and nothing must break.
-
replied to Ivan Molodetskikh on last edited by
While trying to make this work, I realized that this is the time when I *really really* want to be able to test this stuff. So I got on a sidetrack adventure to write testing infra for running real Wayland clients inside unit tests.
I've got it working! In these tests, I'm creating a new niri instance along with test clients, all on the same test-local event loop. No global state, no threads needed.
What's really cool is that this lets me test the weirdest client-server event timings.
-
replied to Ivan Molodetskikh on last edited by
This morning I worked on remembering the size for floating windows when they go to the tiling layout and back.
The whole sizing code must be at the top by logic complexity in niri. I have to juggle, all at once:
- new size I haven't sent to the window yet,
- size changes I sent, but window hasn't acked yet (0, 1, or more in-flight),
- size change window acked but hasn't committed for yet,
- size change window acked and responded to with a commit (maybe with a different size entirely).