forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on b0eb8ad8c80094de34abd88c109aea421461622bFiltered to src/layout/scrolling.rsClear filter

2026-08-09

layout: Match view animation when moving between workspacesIvan Molodetskikh · 97c96a1
layout: Match view animation when moving between workspaces

Quite ugly having to pass the anim config everywhere...

2026-08-03

layout: Animate column/tile movement between workspacesIvan Molodetskikh · 782f459
layout: Animate column/tile movement between workspaces

It'd probably make visual sense to "propagate" the "animating between
workspaces" flag on actions such as consume and expel to the affected
tiles, however that sounds somewhat annoying, and isn't all that visible
normally.

2026-08-09

2026-08-04

2026-08-03

layout/scrolling: Add Column IDIvan Molodetskikh · 361a91a
layout/scrolling: Add Column ID

Not hooked up to anything yet, will need to do that in future commits.

2026-08-04

2026-08-03

2026-07-23

2026-08-06

2026-08-04

2026-07-23

2026-04-30

layout: Change active_tile_visual_rectangle() to windowIvan Molodetskikh · 0650e7b
layout: Change active_tile_visual_rectangle() to window

New functionality needs window specifically, and existing logic will be
fine with window too.

2026-04-14

2026-01-30

2026-01-04

layout/scrolling: Preserve gesture anim in dnd_scroll_gesture_end()Ivan Molodetskikh · df3f397
layout/scrolling: Preserve gesture anim in dnd_scroll_gesture_end()

Fixes interactive move unmaximize/unfullscreen into floating skipping
the view offset anim.

2025-12-25

Fix consume-or-expel-left anim to the left of active columnIvan Molodetskikh · 2a9d0e4
Fix consume-or-expel-left anim to the left of active column

Regressed in c4462d0c7fddfc11c9e98d43e3ef68a5b3c844ca.
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.
scrolling: Don't forget to call tab_indicator.update_shaders()Ivan Molodetskikh · 9d62b94
scrolling: Don't forget to call tab_indicator.update_shaders()

This didn't actually break anything since those shaders aren't
configurable.

2025-12-20

layout: Synchronize unfullscreen view movement anim to resizeIvan Molodetskikh · 9b52465
layout: Synchronize unfullscreen view movement anim to resize

Before this commit, maximize/fullscreen was synchronized, but
unmaximize/unfullscreen wasn't.

2025-12-18

layout/scrolling: Fix add_column() skipping activate_column() sometimesIvan Molodetskikh · c4462d0
layout/scrolling: Fix add_column() skipping activate_column() sometimes

When the column was added immediately to the left of the current column
and activated, the new idx would be equal to active_column_idx, which
would skip activate_column() with its variable resets.

2025-11-29

Fix typos in commentsIvan Molodetskikh · b35bcaeBrowse files

2025-11-24

layout/tests: Amend check for window-rule testsIvan Molodetskikh · 45b45ac
layout/tests: Amend check for window-rule tests

This check doesn't handle tabbed columns properly (it should find and
take the fixed height tile's height); for now just gate it on is_tabbed.

2025-10-31

layout: Find preset width for new columnsIvan Molodetskikh · e257687
layout: Find preset width for new columns

Fixes first Mod+R doing nothing on windows like non-tiled foot.

2025-10-04

layout: Make resizing actions unmaximizeIvan Molodetskikh · 536204f
layout: Make resizing actions unmaximize

I feel this is more intuitive compared to them doing nothing. True
maximize is kinda similar to full-width in spirit, so make the actions
behave the same.

2025-09-02

2025-09-30

2025-09-20

2025-09-12

layout/scrolling: Remove more redundant animate argsIvan Molodetskikh · d45b063
layout/scrolling: Remove more redundant animate args

These were redundant before too.

2025-09-04

layout/tile: Animate un/fullscreen resizeIvan Molodetskikh · a0d002c
layout/tile: Animate un/fullscreen resize

This turned out to require quite a few changes.

We keep track of the tile resize animation progress separately now, in order to
provide a resizing black fullscreen backdrop for non-resizable windows.

The window is always rendered in the middle of the tile, which once again aids
with the resizing black fullscreen backdrop.

The backdrop itself will fade in from transparency so that it's less jarring.

The resize animation now keeps track of the fullscreen progress to deal with
the case where an unfullscreen resize is interrupted by another non-fullscreen
resize. In this case, the fullscreen progress continues animating to avoid
sudden disappearance of the fullscreen backdrop.

Some things like border visibility switch to this fullscreen progress once again
to avoid jarring appearance/disappearance.

The border radius animates in accordance with the fullscreen progress to match
the visuals.

2025-09-03

2025-09-02

layout/scrolling: Track pending vs. current fullscreen for ColumnsIvan Molodetskikh · c832bde
layout/scrolling: Track pending vs. current fullscreen for Columns

We already did that for Tiles, but for Columns we only tracked what was
effectively pending fullscreen. We used it in several places where the current
fullscreen should've been used instead, like the tile origin or the view offset.

This commit splits the two and makes every place use the right one.

Fixes things like tiles briefly appearing at y=0 between issuing the fullscreen
command and the tile committing in response to the fullscreen configure.
layout/scrolling: Store view_offset_before_fullscreen when column actually goes fullscreenIvan Molodetskikh · b8995a1
layout/scrolling: Store view_offset_before_fullscreen when column actually goes fullscreen

Simplifies the handling and correctly saves/restores view offset for clients
that are slow to fullscreen, as can be seen from the fixed test.

2025-08-28

2025-08-27

Fix typosIvan Molodetskikh · 5b26f58Browse files

2025-08-16

niri-ipc: Add window positions and sizes (#1265)yrkv · Unverifiedaf30cc8
niri-ipc: Add window positions and sizes (#1265)

* Add window sizes and positions to the IPC

* basic fixes

* report window_loc instead of window pos

* clean ups

* make scrolling indices 1-based

* add printing to niri msg windows

* don't include render offset in floating tile pos

---------

Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>

2025-08-13

2025-08-14

layout/scrolling: Normalize column X move anim from 1 to 0Ivan Molodetskikh · a9f0f4d
layout/scrolling: Normalize column X move anim from 1 to 0

Will be needed for offsetting to fix the resize cancel issue.

2025-08-12

layout: Remove by-ref animation_snapshot() getterIvan Molodetskikh · c9873a0
layout: Remove by-ref animation_snapshot() getter

It was used in only one place, and that place was due for an update to use the
cached data.

2025-06-13

layout/scrolling: Take unfullscreen view offset unconditionallyIvan Molodetskikh · 83ec369
layout/scrolling: Take unfullscreen view offset unconditionally

It might get set and unset all while the view is frozen with a gesture.

2025-06-11

Add deactivate-unfocused-windows debug flag (#1706)sashomasho · Unverified8d7b22d
Add deactivate-unfocused-windows debug flag (#1706)

* force xdg deactivation on invisable workspaces

This debug option provides a workaround for many Chromium-based chat
applications that fail to show notifications when they're active in
a workspace that's not currently visible and don't have keyboard focus

Signed-off-by: Alex Yosifov <sashomasho@gmail.com>

* fixes

---------

Signed-off-by: Alex Yosifov <sashomasho@gmail.com>
Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>

2025-06-09

2025-05-12

2025-05-10

2025-05-01

layout/scrolling: Update view offset on config updateIvan Molodetskikh · 6c9705d
layout/scrolling: Update view offset on config update

Fix always-centering not applied right away. No other changes intended.