Decided to try writing a Wayland compositor for fun.
-
In practice this means much less texture re-creations and much less redrawing.
The main reason to do this was to unlock using offscreens for more persistent visuals. E.g. it's fine to do some extra rendering for a 150 ms animation, but it's not fine to do it for something that can last seconds or minutes.
In particular, I can finally make windows semitransparent while dragging them in the tiling layout! Which needs an offscreen since it's a stack of border + window + subsurfaces.
Still testing this one: a window rule to set the xdg-toplevel Tiled state.
By default niri matches it to prefer-no-csd, because the Tiled state currently happens to be the best way to ask always-CSD windows to square their corners.
With this tiled-state window rule you can override it, for example to get title bars (for easy mouse-only gestures) together with square corners (if you're going for a square style with borders, like mine here). You can also e.g. limit it to tiled windows.
-
Still testing this one: a window rule to set the xdg-toplevel Tiled state.
By default niri matches it to prefer-no-csd, because the Tiled state currently happens to be the best way to ask always-CSD windows to square their corners.
With this tiled-state window rule you can override it, for example to get title bars (for easy mouse-only gestures) together with square corners (if you're going for a square style with borders, like mine here). You can also e.g. limit it to tiled windows.
And another thing for today: finally made it so niri waits a bit for the lock screen to paint before locking the session. This fixes the "red flash" issue.
Please test this since it's security sensitive. I already caught one mistake before pushing where killing a lock screen, then spawning a new one, would briefly flash the session contents.
(Note that some lockers fade in from transparency, so you'll still briefly see red, that's just the niri locked session background.)
-
And another thing for today: finally made it so niri waits a bit for the lock screen to paint before locking the session. This fixes the "red flash" issue.
Please test this since it's security sensitive. I already caught one mistake before pushing where killing a lock screen, then spawning a new one, would briefly flash the session contents.
(Note that some lockers fade in from transparency, so you'll still briefly see red, that's just the niri locked session background.)
Since adding tabbed columns, just about everyone is asking for a way to open a new window directly in the focused tabbed column. This is rather complicated, but yesterday I came up with a 1 line change that should cover some workflows (covers how I use tabs at least).
I have logic that restores the view position when you open and close a window right away. Now I enabled it for consume-left, which means that you can open a new window, consume left (into a tab), and the view will go back.
-
Since adding tabbed columns, just about everyone is asking for a way to open a new window directly in the focused tabbed column. This is rather complicated, but yesterday I came up with a 1 line change that should cover some workflows (covers how I use tabs at least).
I have logic that restores the view position when you open and close a window right away. Now I enabled it for consume-left, which means that you can open a new window, consume left (into a tab), and the view will go back.
Today I implemented a new niri screencasting feature: the dynamic cast target.
It shows up as a special "window" in the portal dialog. Once you select it, you can change what it casts with niri binds! Switch between windows, monitors, and in the future maybe workspaces and other stuff. Works with OBS, browsers, anything else.
I also wrote a wiki page with all our screencasting-related features: https://github.com/YaLTeR/niri/wiki/Screencasting
Thanks @elkowar for coming up with the dynamic cast idea!
-
Today I implemented a new niri screencasting feature: the dynamic cast target.
It shows up as a special "window" in the portal dialog. Once you select it, you can change what it casts with niri binds! Switch between windows, monitors, and in the future maybe workspaces and other stuff. Works with OBS, browsers, anything else.
I also wrote a wiki page with all our screencasting-related features: https://github.com/YaLTeR/niri/wiki/Screencasting
Thanks @elkowar for coming up with the dynamic cast idea!
Had to show slides a few times for uni lately, which motivated me to add this next feature.
Windowed fullscreen, also known in other WMs as fake or detached fullscreen, makes the window think that it went fullscreen, while in reality keeping it as a normal window. Useful in combination with apps like Google Slides to hide the browser UI without taking up the whole screen, especially on ultrawide monitors.
Wiki section: https://github.com/YaLTeR/niri/wiki/Screencasting#windowed-fakedetached-fullscreen
-
Had to show slides a few times for uni lately, which motivated me to add this next feature.
Windowed fullscreen, also known in other WMs as fake or detached fullscreen, makes the window think that it went fullscreen, while in reality keeping it as a normal window. Useful in combination with apps like Google Slides to hide the browser UI without taking up the whole screen, especially on ultrawide monitors.
Wiki section: https://github.com/YaLTeR/niri/wiki/Screencasting#windowed-fakedetached-fullscreen
This one seems simple, but actually turned out quite tricky to implement.
I wrote niri code under the assumption that the fullscreen state does not apply immediately: we send a configure to the window, then only at a later point it commits in response. Windowed fullscreen breaks this because in some cases it can apply instantly (going from real to windowed fullscreen needs no state change from the window).
-
This one seems simple, but actually turned out quite tricky to implement.
I wrote niri code under the assumption that the fullscreen state does not apply immediately: we send a configure to the window, then only at a later point it commits in response. Windowed fullscreen breaks this because in some cases it can apply instantly (going from real to windowed fullscreen needs no state change from the window).
After trying a few approaches, I ended up doing it "properly" by associating the (entirely compositor-side) windowed fullscreen state to window configures and commits. This lets niri correctly track if a given fullscreen window commit was real fullscreen (so e.g. we need to draw a black backdrop), or if it was windowed fullscreen.
This even works across a chain of toggling windowed fullscreen, then the window slowly acking and committing them, and I have a test to verify that.
-
After trying a few approaches, I ended up doing it "properly" by associating the (entirely compositor-side) windowed fullscreen state to window configures and commits. This lets niri correctly track if a given fullscreen window commit was real fullscreen (so e.g. we need to draw a black backdrop), or if it was windowed fullscreen.
This even works across a chain of toggling windowed fullscreen, then the window slowly acking and committing them, and I have a test to verify that.
New niri users frequently come from other tiling WMs with static workspace systems. For them, dynamic workspaces is an unusual system, and it can be unclear how to use dynamic workspaces effectively. (Especially until we get an Overview type thing.)
I figured I'd write a wiki page describing niri's workspaces in more detail: https://github.com/YaLTeR/niri/wiki/Workspaces I also included an example of how I personally use workspaces on niri.
Hopefully this makes it easier to understand what's going on!
-
New niri users frequently come from other tiling WMs with static workspace systems. For them, dynamic workspaces is an unusual system, and it can be unclear how to use dynamic workspaces effectively. (Especially until we get an Overview type thing.)
I figured I'd write a wiki page describing niri's workspaces in more detail: https://github.com/YaLTeR/niri/wiki/Workspaces I also included an example of how I personally use workspaces on niri.
Hopefully this makes it easier to understand what's going on!
-
slowly going through the piled up PRs (how's your weekend going?), today merged the pick-color IPC from nnyyxxxx. comes with Portal support of course
-
-
started working on an Overview for niri. very wip, lots to do, got some basic rendering and dragging working though
today's progress: wheel scrolling up and down, right click to scroll left and right, click on workspace to focus, some keyboard fixes
this is all mouse-only on the video. only currently using a 3rd-party tool for the hot corner (waycorner), i'll integrate that later
-
today's progress: wheel scrolling up and down, right click to scroll left and right, click on workspace to focus, some keyboard fixes
this is all mouse-only on the video. only currently using a 3rd-party tool for the hot corner (waycorner), i'll integrate that later
-
i have this old ASUS Eee PC collecting dust, decided to try if niri will run on it. well, it actually runs! a few shaders failed compiling (ran into ALU instruction limits), but otherwise seems to work
-
today's overview progress: some rendering and input fixes, plus implemented built-in hot corner, and workspace switch on drag-and-drop hold. which means that now you can perform an entire drag-and-drop to a different workspace mouse-only!
spent many hours today trying to make the combined exit overview + switch workspace animation monotonic. This is hard because zoom and vertical movement are separate axes, and you can e.g. "catch" one of them with a touchpad gesture, while the other must continue animating (so you can't easily convert this into rect interpolation).
Ended up working out a correction formula for the workspace Y positions when both axes have matching animations. Appears to behave so far from my testing
-
spent many hours today trying to make the combined exit overview + switch workspace animation monotonic. This is hard because zoom and vertical movement are separate axes, and you can e.g. "catch" one of them with a touchpad gesture, while the other must continue animating (so you can't easily convert this into rect interpolation).
Ended up working out a correction formula for the workspace Y positions when both axes have matching animations. Appears to behave so far from my testing
-
today I opened a draft PR for the Overview, and request everyone to test it and report issues: https://github.com/YaLTeR/niri/pull/1440
also, today's new overview feature: drag-and-drop into a new workspace between/above/below!
-
Today: added touch support to the Overview. Somehow, the entire thing just worked first try.
-
After some more fixes, and a long rebasing session, I merged the Overview! Please give it more testing using your nearest niri-git package.