Commit Graph

115 Commits

Author SHA1 Message Date
Ivan Molodetskikh 9b52465e42 layout: Synchronize unfullscreen view movement anim to resize
Before this commit, maximize/fullscreen was synchronized, but
unmaximize/unfullscreen wasn't.
2025-12-20 09:08:17 +03:00
Ivan Molodetskikh c4462d0c7f 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-12-18 22:19:03 +03:00
Ivan Molodetskikh b35bcae35b Fix typos in comments 2025-11-29 10:05:44 +03:00
Ivan Molodetskikh 45b45ac29d 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-11-24 16:17:12 +03:00
Ivan Molodetskikh e257687921 layout: Find preset width for new columns
Fixes first Mod+R doing nothing on windows like non-tiled foot.
2025-10-31 08:35:58 +03:00
Ivan Molodetskikh 536204fd82 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-10-15 09:04:16 +03:00
Ivan Molodetskikh e1fad994da Implement maximize-to-edges (true Wayland maximize) 2025-10-15 09:04:16 +03:00
Ivan Molodetskikh 2eabc22b38 config: Add merging for Gestures 2025-10-02 09:38:17 +03:00
Ivan Molodetskikh 4c524b4719 layout: Store Layout directly in Options 2025-10-02 09:33:08 +03:00
Ivan Molodetskikh 1fa9dd32ed config: Split Layout from LayoutPart 2025-10-02 09:33:08 +03:00
Ivan Molodetskikh 2781d3a743 config: Replace resolve_against with MergeWith 2025-10-02 09:33:08 +03:00
Ivan Molodetskikh d45b06385d layout/scrolling: Remove more redundant animate args
These were redundant before too.
2025-09-17 22:04:23 +03:00
Ivan Molodetskikh 919dcbe774 layout/scrolling: Remove now-redundant animate arg 2025-09-17 22:04:23 +03:00
Ivan Molodetskikh a0d002c318 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-17 22:04:23 +03:00
Ivan Molodetskikh a3203d92ec layout/scrolling: Animate tiles_origin changing on un/fullscreen 2025-09-17 22:04:23 +03:00
Ivan Molodetskikh c832bdecdd 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.
2025-09-17 22:04:23 +03:00
Ivan Molodetskikh b8995a12d1 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-09-17 22:04:23 +03:00
Said Kadrioski 0c3223ac72 Add cycle back feature for presets of column/window width/height. 2025-08-29 09:13:52 +03:00
Ivan Molodetskikh 5b26f58285 Fix typos 2025-08-27 15:01:56 +03:00
yrkv af30cc8df6 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-16 11:42:08 +03:00
Ivan Molodetskikh 25c1c04349 layout: Offset ongoing column X move anims for non-animated resizes 2025-08-14 15:58:59 +03:00
Ivan Molodetskikh a9f0f4d44f layout/scrolling: Normalize column X move anim from 1 to 0
Will be needed for offsetting to fix the resize cancel issue.
2025-08-14 15:58:59 +03:00
Ivan Molodetskikh e3101ced70 layout: Offset Y animations for non-animated resizes 2025-08-14 15:58:59 +03:00
Ivan Molodetskikh c9873a0885 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-08-14 15:58:59 +03:00
Ivan Molodetskikh 83ec369536 layout/scrolling: Take unfullscreen view offset unconditionally
It might get set and unset all while the view is frozen with a gesture.
2025-06-13 08:54:59 +03:00
sashomasho 8d7b22d1a8 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-11 06:05:14 +00:00
Ivan Molodetskikh 3edb8fd906 layout/scrolling: Take parent area into account for popup unconstraining 2025-06-09 13:52:18 +03:00
Ivan Molodetskikh c9b1514d63 layout/scrolling: Store parent_area in ScrollingSpace 2025-06-09 13:43:28 +03:00
Ivan Molodetskikh 2066737024 layout/scrolling: Inline popup_target_rect up to ScrollingSpace 2025-06-09 13:39:55 +03:00
Ivan Molodetskikh defd4c5c4d Add center-visible-columns action 2025-05-12 14:13:51 +03:00
Ivan Molodetskikh 5816691460 Add urgent color support to tab indicators 2025-05-10 22:42:45 +03:00
Ivan Molodetskikh 6c9705dd4b layout/scrolling: Update view offset on config update
Fix always-centering not applied right away. No other changes intended.
2025-05-01 21:37:34 +03:00
Ivan Molodetskikh fae3a27641 Implement DnD hold to activate window or workspace 2025-04-25 02:00:18 -07:00
Ivan Molodetskikh ce3103949f layout/scrolling: Support view offset anim during gesture
Brings back moving the newly active window into focus upon interactive
move dragging out.
2025-04-25 02:00:18 -07:00
Ivan Molodetskikh b20dd226c0 layout: Move insert hint from ScrollingSpace to Monitor 2025-04-25 02:00:18 -07:00
Ivan Molodetskikh 59a42249a4 Remove cancellation from swipe gestures
It only worked for workspace switch, and even there it was more confusing than
helpful.
2025-04-25 02:00:18 -07:00
Ivan Molodetskikh fdbc485d78 layout: Remove width and is_full_width from InsertHint
They were unused.
2025-04-17 11:31:34 +03:00
Ivan Molodetskikh 7e253d2687 layout: Don't pass scale to render unnecessarily
These parts of the layout already know their scale.
2025-04-17 11:31:34 +03:00
Ivan Molodetskikh df94662435 layout: Take into account idle time between last gesture event and end
Fixes cases like: do a quick movement with mouse, then hold it in-place for a
while (no events generated), then release the gesture (it uses all that
built-up speed). This also happens with DnD scroll and makes it go further than
intended.
2025-04-10 10:49:35 +03:00
Ivan Molodetskikh b49f7dcb4d layout/scrolling: Use slice::fill()
Fix new Clippy warning.
2025-04-03 19:25:56 +03:00
Ivan Molodetskikh e10b968eb0 layout: Reset unfullscreen view offset when starting interactive resize 2025-03-31 14:33:02 +03:00
Ivan Molodetskikh ed20822ce9 layout: Reset unfullscreen view offset when removing window
Another old bug found by randomized tests after I expanded the testing mock
window.
2025-03-22 13:57:37 +03:00
Ivan Molodetskikh 6a80ec4704 layout/tile: Don't take fullscreen into account in min/max size
They are used strictly for non-fullscreen size computation.
2025-03-17 22:31:19 -07:00
Ivan Molodetskikh 926e63a5f3 Refactor request_fullscreen() to be an argument on request_size() 2025-03-17 22:31:19 -07:00
Duncan Overbruck f6aa8c1793 Add move-column-to-index action 2025-03-14 12:57:33 -07:00
Duncan Overbruck a5d58d670b Add focus-column (by index) action 2025-03-14 12:57:33 -07:00
Ivan Molodetskikh fd3b1f2b6c layout: Preserve previous view offset on consume-left 2025-03-14 08:50:29 +03:00
Ivan Molodetskikh dca187de37 Don't snap after DnD scroll if view position didn't change
Otherwise, any DnD breaks temporarily centered columns.
2025-02-18 19:06:40 +03:00
Ivan Molodetskikh 44c9797844 Take tab indicators into account in expand-column-to-available-width 2025-02-17 22:36:30 +03:00
Ivan Molodetskikh 652d2923bb Use toggle_full_width() for expand-column-to-available-width edge case 2025-02-17 21:57:35 +03:00