Email or username:

Password:

Forgot your password?
Top-level
Ivan Molodetskikh

This morning was my niri (-adjacent) talk! :ablobcatbongo: 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.

Myself standing in front of a slide projector showing a title slide.
12 comments
Ivan Molodetskikh replied to Ivan

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.

#niri

Ivan Molodetskikh replied to Ivan

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.

#niri

Ivan Molodetskikh replied to Ivan

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.

#niri

Ivan Molodetskikh replied to Ivan

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.

#niri

Long test for a complex resize sequence.
Ivan Molodetskikh replied to Ivan

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).

#niri

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).

Ivan Molodetskikh replied to Ivan

The diff is 85 lines of change and 243 lines of new tests, and I already found a few weirder edge cases that I've missed. No way I could do this well without that client-server testing setup that I posted about yesterday.

Btw I pushed the testing setup if you're curious, along with the entirety of 1215 snapshot files for a powerset of new window workspace/output target settings: github.com/YaLTeR/niri/commit/

The WIP floating branch caused them to update in several commits already.

#niri

The diff is 85 lines of change and 243 lines of new tests, and I already found a few weirder edge cases that I've missed. No way I could do this well without that client-server testing setup that I posted about yesterday.

Btw I pushed the testing setup if you're curious, along with the entirety of 1215 snapshot files for a powerset of new window workspace/output target settings: github.com/YaLTeR/niri/commit/

Ivan Molodetskikh replied to Ivan

The big 1215 snapshot test powerset (actually it already grew to 1695) continues to prove its worth. Just finished a big +495 -508 cleanup of the window opening code, and verified that not a single of those 1215 window opening configurations changed its outcome. I will be sleeping well tonight

#niri

Ivan Molodetskikh replied to Ivan

After three weeks of hard work, I am undrafting the floating window PR in niri. Please give it thorough testing and report any bugs or issues!

github.com/YaLTeR/niri/pull/871

#niri

Ivan Molodetskikh replied to Ivan

No video yet (soon tm) but my talk got rated first among all 9 Moscow RustCon talks :blobcat: And they uploaded photos from the conference.

Sidenote, for the Wayland diagram from the first pic, I took inspiration from @drakulix's one from her great "Why YOU should write a Wayland compositor" talk: youtu.be/FUif2GxwgBc Definitely check it out!

Giving a talk, standing near a projector screen showing a slide with a diagram connecting a Wayland compositor and apps.
Giving a talk, standing near a projector screen showing a slide with part of neovim with Rust code visible.
Answering questions to a small group of people after the talk. (Their faces are blurred out for privacy.)

поясняю за вейланд
Ivan Molodetskikh replied to Ivan

My Moscow RustCon talk's recording is finally up! Give it a watch at youtu.be/Kmz8ODolnDg?list=PLRd

Just for y'all, I spent several hours last Thursday preparing full English subtitles, and then @bugaevc and another friend spent some more hours proofreading them.

In the talk, I start with a brief description of what a Wayland is and does, then show how I do randomized property testing in niri, and then how I profile it with Tracy and measure the input latency.

Hope you enjoy!

#niri #wayland #rust

My Moscow RustCon talk's recording is finally up! Give it a watch at youtu.be/Kmz8ODolnDg?list=PLRd

Just for y'all, I spent several hours last Thursday preparing full English subtitles, and then @bugaevc and another friend spent some more hours proofreading them.

YouTube subtitle settings showing English selected.
Go Up