Commit Graph

84 Commits

Author SHA1 Message Date
Ivan Molodetskikh c1060cd26b Add set-window-height action 2023-11-08 11:27:25 +04:00
Ivan Molodetskikh dc9cee4589 layout: Implement auto height distribution
Takes into account min and, partially, max window heights, and adds 1 px
when necessary to account for uneven division.
2023-11-08 11:27:25 +04:00
Ivan Molodetskikh 8056dd0c7e layout: Add window heights to columns 2023-11-08 11:27:25 +04:00
Ivan Molodetskikh e1bfd981b3 Add default-column-width setting 2023-11-03 20:11:11 +04:00
Ivan Molodetskikh 889d062df7 Render top layer under fullscreen surfaces when stationary 2023-11-02 13:07:01 +04:00
Ivan Molodetskikh 7ff91fe394 Add a check for primary monitor workspace invariant 2023-11-02 09:39:37 +04:00
Ivan Molodetskikh ee8404b9a9 Preserve column width on window actions
Fixes https://github.com/YaLTeR/niri/issues/53
2023-11-01 17:41:02 +04:00
Ivan Molodetskikh 5a86b43744 Fix losing track of window on move to output if there are none 2023-11-01 17:26:30 +04:00
Ivan Molodetskikh e0a76b6215 layout: Change with_surfaces to set_preferred_scale_transform
The former is too specific to concrete Window and not as amenable to
testing.
2023-11-01 15:07:45 +04:00
Kirill Chibisov 0a2052945e Add support for wl_compositor@v6 2023-10-29 13:58:48 +04:00
Ivan Molodetskikh d254731885 Use correct workspace vertical position for rendering 2023-10-21 20:58:30 +04:00
Ivan Molodetskikh 8bde252ba4 Stop updating focus during transitions
This also includes touchpad swipes.
2023-10-21 20:58:30 +04:00
Ivan Molodetskikh 29ddd7006b Remove assert on activating window on inactive workspace 2023-10-21 20:58:30 +04:00
Ivan Molodetskikh a09a073d2d Rename variables to be less confusing 2023-10-21 20:58:30 +04:00
Ivan Molodetskikh ccce8d3141 Crop workspaces during transition tightly 2023-10-21 20:58:30 +04:00
Ivan Molodetskikh f7669a55ad Add binds to move workspaces up and down 2023-10-14 20:42:44 +04:00
Ivan Molodetskikh 736191e826 Add check for no empty workspaces invariant 2023-10-14 20:42:44 +04:00
Ivan Molodetskikh d1f431fd7e Fix moving empty workspaces to original output 2023-10-14 20:42:44 +04:00
Ivan Molodetskikh c29fdcaccb Fix by-idx workspace actions not cleaning up 2023-10-14 20:42:44 +04:00
Ivan Molodetskikh 8a08e01a2d Fix removing output not keeping empty focus on primary 2023-10-14 20:42:44 +04:00
Ivan Molodetskikh 1831d68915 Fix assertion message 2023-10-14 20:42:44 +04:00
Ivan Molodetskikh 3602876b5e Add a few more Tracy spans 2023-10-11 14:53:53 +04:00
Ivan Molodetskikh 1d66f1b81e Draw focus ring as border on SSD windows
With SSD we're reasonably sure that the window is a rectangle with no
rounded corners, so a rectangular border should work.
2023-10-11 14:32:29 +04:00
Ivan Molodetskikh b283f546aa layout: Store location in FocusRing 2023-10-11 11:56:38 +04:00
Ivan Molodetskikh c8105ae1a6 Add screenshot-window action 2023-10-10 12:42:24 +04:00
Ivan Molodetskikh e70e660df6 Add barebones three-finger-swipe workspace switch
Notable omission is velocity tracking.
2023-10-08 09:57:59 +04:00
Ivan Molodetskikh 497e52da59 Update bounds of toplevel windows 2023-10-07 17:50:45 +04:00
Ivan Molodetskikh 994bc64679 Add gaps setting
The past few refactors have led up to this point, and now it's finally
possible.
2023-10-07 17:45:55 +04:00
Ivan Molodetskikh 624b3296e9 layout: Refactor view offset, padding, work area handling
Fixes broken padding on fullscreen windows, especially with struts on
the sides present.

It is now view offset's job to include padding and struts.
2023-10-07 10:47:51 +04:00
Ivan Molodetskikh 23b59b40aa layout: Add every_op test from starting state 2023-10-05 09:59:28 +04:00
Ivan Molodetskikh 8491ba593e layout: Handle padding in ColumnWidth::resolve() 2023-10-05 09:29:39 +04:00
Ivan Molodetskikh 6fcdb41922 Refactor layout for configurability, add preset-column-widths option
layout.rs finally gets a struct actually named Layout.
2023-10-05 09:25:07 +04:00
Ivan Molodetskikh 3ac1607406 layout: Store view size in Columns 2023-10-04 15:45:30 +04:00
Ivan Molodetskikh 7558ac14e6 Add set-column-width action 2023-10-03 11:38:42 +04:00
Ivan Molodetskikh 5b6b3fcfbe Avoid sending frame callbacks to invisible surfaces 2023-10-01 19:41:42 +04:00
Ivan Molodetskikh 751345759a Make find_window_and_output() accept non-mut self 2023-10-01 06:29:33 +03:00
Ivan Molodetskikh 6f8ad18d9a Compute view offset relative to anim target
This enables quickly tapping focus right-left to keep typing in the
current window while showing the next window.

Resolves https://github.com/YaLTeR/niri/issues/26
2023-09-30 17:29:57 +04:00
Ivan Molodetskikh a3aa5fca12 Refactor frame scheduling
Combine the redraw state variables into one enum, and refactor to get
rid of the requirement that a VBlank must queue a subsequent redraw.
Also fix the bug where ongoing animations that produced no damage could
stall the redrawing.
2023-09-30 17:13:56 +04:00
Ivan Molodetskikh 404661ed8d Throttle frame callbacks to once per monitor refresh
Under some circumstances, the compositor can get into a commit-frame
callback busy loop with a client. For example, if a client redraws on
frame callbacks, but the resulting frame has empty damage (e.g. the
damaged part of the client is outside the monitor). Or if the client
simply commits with empty damage (looking at you, Firefox).

This behavior is compliant with the Wayland specification and with the
intended idea of frame callbacks, but causes a lot of unnecessary CPU
usage in the client and the compositor.

To solve this problem, this commit introduces frame callback throttling.

Every surface may only receive a single frame callback in one
monitor refresh cycle. If a surface commits resulting in no KMS frame
submission, a timer is created, that will fire at the predicted would-
be-VBlank time, and send the accumulated frame callbacks.

This way, a surface that redraws on frame callbacks will not notice
any change in frame callback delivery, if its commits suddenly stop
producing KMS updates.
2023-09-29 13:12:50 +04:00
Ivan Molodetskikh 73fd286f34 layout: Add communicate op to tests 2023-09-28 08:59:45 +04:00
Ivan Molodetskikh 1572ef75bd layout: Refresh windows too
This will send output enter/leave to new popups.
2023-09-28 08:26:17 +04:00
Ivan Molodetskikh cf123ddcd0 layout: Use actual working area on workspace creation
Fixes https://github.com/YaLTeR/niri/issues/19
2023-09-27 17:39:42 +04:00
Ivan Molodetskikh 06d15e4adc layout: Add more ops for proptest to play with 2023-09-27 13:45:49 +04:00
Ivan Molodetskikh 31ea816d2b layout: Add randomized test 2023-09-27 13:35:02 +04:00
Ivan Molodetskikh f2e28f54d6 Fix test name 2023-09-27 13:09:39 +04:00
Ivan Molodetskikh d3735227ce Fix panic when the last window on previous workspace is closed 2023-09-26 20:42:16 +04:00
Ivan Molodetskikh 5ad5f29a92 Extract check_ops 2023-09-26 20:41:55 +04:00
Ivan Molodetskikh 756997ca83 Fix panic when adding previously-removed output sometimes 2023-09-26 20:36:48 +04:00
Ivan Molodetskikh b7be8fcb75 Fix verify_invariants() asserts 2023-09-26 20:35:08 +04:00
Ivan Molodetskikh 953d1064c2 Add layer shell exclusive zone support 2023-09-26 20:12:04 +04:00