Commit Graph

1940 Commits

Author SHA1 Message Date
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 21737abbfd Make output position configurable
Implements https://github.com/YaLTeR/niri/issues/14
2023-09-30 11:33:02 +04:00
Ivan Molodetskikh a413f3e91d input: Simplify logic when cursor is outside outputs 2023-09-30 11:31:41 +04:00
Ivan Molodetskikh f381db8354 Make pipewire / xdp-gnome-screencast optional 2023-09-30 09:58:34 +04:00
Ivan Molodetskikh f7c390a320 Disable RUST_LIB_BACKTRACE if unset
When building on nightly, this is required to disable the costly
anyhow backtraces.
2023-09-30 09:57:09 +04:00
Ivan Molodetskikh 3f8788e4ed Use non-fancy miette hook
Cuts down our dependencies a bit. We only use miette due to knuffel so
it makes sense.
2023-09-30 09:08:00 +04:00
Ivan Molodetskikh 56cffa155b Update Smithay 2023-09-30 09:05:16 +04:00
Ivan Molodetskikh b54acf503f Avoid unnecessary configures for xdg-decoration
They actually break some clients like Tracy for some unknown to me
reason.
2023-09-29 13:54:47 +04:00
Ivan Molodetskikh c7057ca0d8 Extract initial_configure_sent 2023-09-29 13:54:15 +04:00
Ivan Molodetskikh 5cdd188d4b Change send_initial_configure_if_needed to accept ToplevelSurface 2023-09-29 13:48:14 +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
Kirill Chibisov 804e064826 shell: add support for kde server decorations
This should provide server side decorations for the gtk3 applications,
like firefox.
2023-09-27 18:38:38 +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 dbcc1182ef Update primary selection focus 2023-09-27 16:51:17 +04:00
Ivan Molodetskikh 1085ea99ff Send pointer.frame() after pointer.button() 2023-09-27 15:31:40 +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 6472901cbe Sort dependencies 2023-09-27 11:51:27 +04:00
Ivan Molodetskikh 5d8bb2589e Fix layer-shell render layering 2023-09-27 08:50:00 +04:00
Ivan Molodetskikh 93369e1958 Implement primary selecton
Firefox clipboard doesn't always work without it.
2023-09-26 22:22:11 +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
Ivan Molodetskikh 4a585a3293 Add initial config hot reloading 2023-09-26 19:24:50 +04:00
Ivan Molodetskikh 3b83b2fb16 README: Update screenshot 2023-09-26 14:34:26 +04:00
Ivan Molodetskikh 80928632ba Add prefer-no-csd option 2023-09-26 13:45:03 +04:00
Ivan Molodetskikh dc10e464ad tty: Take metadata by value 2023-09-26 13:45:03 +04:00
Ivan Molodetskikh a62e1cbef6 Make focus ring configurable 2023-09-26 13:45:03 +04:00
Ivan Molodetskikh 906ee36a93 Skip rendering when backend is inactive 2023-09-26 13:45:03 +04:00
Ivan Molodetskikh ac16717f4e Avoid unwraps in more places 2023-09-26 13:45:03 +04:00
Ivan Molodetskikh 52aee11aa5 tty: Add more trace spans 2023-09-26 13:45:03 +04:00
Ivan Molodetskikh e299328741 tty: Extract other event handlers into functions 2023-09-26 13:45:03 +04:00
Ivan Molodetskikh 0f43e90b2a tty: Avoid panicks in the vblank callback 2023-09-26 13:45:03 +04:00
Ivan Molodetskikh bbf707367a tty: Extract on_vblank() 2023-09-26 13:45:03 +04:00
Ivan Molodetskikh cfe80574df Use new tracy-client new_leak() methods
I added them to avoid the use of internal module and leaks when tracing
is disabled.
2023-09-26 13:45:03 +04:00
Ivan Molodetskikh fb43dcd61e Remove obsolete comment 2023-09-26 13:45:03 +04:00
Ivan Molodetskikh cd4f7c0378 Remove LoopData
The calloop Smithay update finally lets me do this.
2023-09-26 13:45:03 +04:00
Ivan Molodetskikh c422fdab0f Update Smithay 2023-09-26 13:45:03 +04:00
Ivan Molodetskikh f58e56d65a Add focus rings 2023-09-24 18:11:20 +04:00
Ivan Molodetskikh 51df1aba01 layout: Focus prev column when removing just created column
This works similar to tabs in Firefox: when you create a tab and then
close it without focusing any other tabs, the focus returns to the
previously-focused tab, rather than the usual next tab. The logic is
that in this case, the new tab was likely transient, and the user wants
to get right back to what they were doing.

In niri's case, this also serves as a workaround for wl-clipboard
spawning and destroying a window, messing up the focus.
2023-09-24 10:08:43 +04:00
Ivan Molodetskikh b3b1e082ac layout: Preserve active column when column to the left is removed 2023-09-24 09:42:49 +04:00
Ivan Molodetskikh 34db4bcd48 Commit Cargo.toml update 2023-09-21 20:05:10 +04:00
Ivan Molodetskikh a7e338b3c0 Add spawn-at-startup config option
Fixes https://github.com/YaLTeR/niri/issues/12
2023-09-21 19:58:03 +04:00