Commits
2026-09-12
feat: implement ext-image-copy-capture for outputs and cursorsPatrick Gaskin · 849c576
feat: implement ext-image-copy-capture for outputs and cursors No toplevel capture support yet since that'll require more refactoring.
2026-04-29
pw_utils: support render and clean to shm bufferwrvsrx · f6f8290
pw_utils: support render and clean to shm buffer Publish the complete validated SHM size after rendering and clear any corruption flag left when the same PipeWire buffer was previously returned unused.
2026-09-08
render_to_shm: follow the buffer's stride and pool offsetPatrick Gaskin · de3b9b4
render_to_shm: follow the buffer's stride and pool offset Don't assume we have a single tightly packed buffer of stride=width*4 at the beginning of the pool.
2026-03-14
2026-03-10
Refactor screencopy/screencast to render via the damage tracker, fix cursorless screencopy with damageIvan Molodetskikh · 19866f8
Refactor screencopy/screencast to render via the damage tracker, fix cursorless screencopy with damage The damage tracker stores framebuffer effect cache, so we want anything that renders repeatedly to render through a reused damage tracker. This way, the cache persists and is reused across renders. This will be important for the non-xray background effects.
2026-02-02
2026-04-14
2026-03-10
2026-01-30
2026-01-08
2025-12-25
Refactor rendering to push-based instead of pull-based (#3113)Ivan Molodetskikh · Unverified7f132ec
Refactor rendering to push-based instead of pull-based (#3113) Our current rendering code constructs and returns complex `-> impl Iterator<Item = SomeRenderElement>` types that are collected into a vector at the top level Niri::render(). This causes some problems: - It's hard to write logic around returning iterators. Especially things like conditions, since the returned iterator must have a single type, you can't branch and return different iterators. This will be solved by gen fn but alas it's not here yet. - In many cases, the returned `-> impl Iterator` will borrow from &self leading to complex lifetimes. In certain cases, it is also desirable for it to borrow the &mut NiriRenderer, which causes a lot of issues because it's exclusive (&mut). - Sometimes those issues are too hard to deal with, leading to the escape hatch of allocating and returning a temporary Vec<SomeRenderElement>, like in Scrolling/FloatingSpace::render_elements(). These allocations are unfortunate because they are not really necessary. - It's impossible to use some downstream combinators with this `-> impl Iterator` approach, leading to functions like Smithay's render_elements_from_surface_tree() returning a Vec. This is extra unfortunate because it results in a temporary allocation per Wayland toplevel/popup. - It's hard to properly create profiling spans for the rendering functions since the spans are dropped when the (lazy) iterator is returned and not when all the code actually completes. - The code compiles down to complex state machines in generated iterator types with logic located in Iterator::next(), which makes it annoying to follow in debuggers and profiling tools. This refactor changes the code to push-based iteration: rendering functions receive a push() closure that they call to push their render elements. It solves all of the aforementioned problems: - The logic becomes simpler. Just use conditionals and loops as normal. - No borrowing and lifetimes since we're not returning anything. - All temporary Vecs are removed because the problems they worked around no longer exist. - The new push_elements_from_surface_tree() helper is the same as render_elements_from_surface_tree() but doesn't allocate a temporary Vec since it's not necessary; the push() closure can be passed down. - Profiling spans work normally since the function returns when it ran all of the logic. - The code compiles down to normal functions and calls as expected. Generally, the iterator approach gives these advantages: - You can wrap the returned items in the upstream logic. This is possible in exactly the same way with the push closure. - You can decide to cut the iterator short in the upstream logic. This is not possible with push-based iteration, but we don't actually use it anywhere. I chose the push closure type to be &mut dyn FnMut(SomeRenderElement). It's deliberately not a generic impl FnMut() to avoid duplicating the rendering logic when it's called from several different places. But it's still a normal closure that can capture the outside context. While my original idea for this refactor was to simplify the logic while getting rid of temporary Vecs, it also appears to have brought a consistent 2-3x speedup to the whole render list construction. On an old Eee PC laptop I even observed a 8x speedup. The refactor also results in smaller binary size, presumably due to removing many iterator combinators and state tracking.
2025-11-16
2025-08-11
2025-06-18
Fix typos (#1822)Baily · Unverifieded14e8d
Fix typos (#1822)
* Fix: Correct typo in xwayland module and update documentation
This commit includes several improvements:
1. **Code Fix (clippy):**
- I corrected a typo in `src/utils/xwayland/mod.rs` from `OFlags::WRONGLY` to `OFlags::WRONLY`. This was identified by `clippy` during the build process.
2. **Documentation Updates:**
- **README.md**:
- I clarified the sentence about finding help in the Matrix channel to be more inviting for new users.
- I corrected a future date typo in the Media section for an interview (June 2025 to June 2024).
- **wiki/Getting-Started.md**:
- I changed the Russian month "мая" to "May" in an example output for better international readability.
- I improved keybinding notation for monitor focus/move keys (e.g., Mod+Shift+H / J / K / L) to avoid ambiguity.
- I updated `apt-get` to `apt` in Ubuntu dependency installation commands for modern practice.
No new typos were found by `typos-cli` in this pass.
* Revert README&GS.md to previous version
* Apply rustfmt
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>2025-03-16
Keep buffer size when switching dynamic cast to NothingIvan Molodetskikh · 287480b
Keep buffer size when switching dynamic cast to Nothing Otherwise, we won't actually clear it because it'll become Pending.
2025-03-09
2025-02-27
2025-01-15
2025-01-04
2025-01-03
2024-08-20
2024-07-30
2024-06-17
Refactor layout to fractional-logicalIvan Molodetskikh · 1dae45c
Refactor layout to fractional-logical Lets borders, gaps, and everything else stay pixel-perfect even with fractional scale. Allows setting fractional border widths, gaps, struts. See the new wiki .md for more details.
2024-06-12
2024-06-09
2024-06-01
Implement our own TextureBuffer/RenderElementIvan Molodetskikh · 3c63be6
Implement our own TextureBuffer/RenderElement Supports fractional texture scale + has some getters.
2024-05-04
2024-05-02
2024-05-01
2024-04-21
2024-04-13
2024-04-12
2024-04-10
Reimplement window closing anim in an efficient wayIvan Molodetskikh · 1888696
Reimplement window closing anim in an efficient way - Keep a root surface cache to be accessible in surface destroyed() - Only snapshot during / right before closing, rather than every frame - Store textures rather than elements to handle scale and alpha properly
2024-04-09
2024-03-24
2024-03-08
Implement wlr-screencopy v1 (#243)sodiboo · Unverifiedca22e70
Implement wlr-screencopy v1 (#243) * Implement wlr-screencopy * Finish the implementation Lots of changes, mainly to fix transform handling. Turns out, grim expects transformed buffers and untransforms them by itself using info from wl_output. This means that render helpers needed to learn how to actually render transformed buffers. Also, it meant that y_invert is no longer needed. Next, moved the rendering to the Screencopy frame handler. Turns out, copy() is more or less expected to return immediately, whereas copy_with_damage() is expected to wait until the next VBlank. At least that's the intent I parse reading the protocol. Finally, brought the version from 3 down to 1, because copy_with_damage() will need bigger changes. Grim still works, others not really, mainly because they bind v3 unnecessarily, even if they don't use the damage request. --------- Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
2024-02-21
2024-02-07
Clear before rendering to textureIvan Molodetskikh · 3360517
Clear before rendering to texture Otherwise I see artifacts on some GTK dialogs.