Commit Graph

518 Commits

Author SHA1 Message Date
Ivan Molodetskikh 2508d3e08e Move refresh calls into State 2023-10-10 07:55:31 +04:00
Ivan Molodetskikh 189d1bd97b Add power-off-monitors bind
Implements https://github.com/YaLTeR/niri/issues/24
2023-10-09 18:37:43 +04:00
Ivan Molodetskikh d91d5d674c Set redraw state to idle on early returns
Haven't hit any problems due to this yet, but I suspect that it's
possible.
2023-10-09 17:40:28 +04:00
Ivan Molodetskikh 05b5ba0555 Add Niri::new Tracy span 2023-10-09 17:36:58 +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 0411fd8d90 Set correct output position for Wayland 2023-10-07 21:02:37 +04:00
Ivan Molodetskikh 42b859a45c Upgrade dependencies 2023-10-07 18:01:17 +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 1bcc889e62 Add tablet map-to-output setting 2023-10-03 17:02:07 +04:00
Ivan Molodetskikh 7bb1c114a2 Update README 2023-10-03 12:31:05 +04:00
Ivan Molodetskikh 7558ac14e6 Add set-column-width action 2023-10-03 11:38:42 +04:00
Ivan Molodetskikh bb3fbe2e83 Make output modes configurable 2023-10-03 08:35:24 +04:00
Ivan Molodetskikh ef76b1df04 Remove unnecessary trace!() 2023-10-03 08:32:59 +04:00
Ivan Molodetskikh a5c4c4e62f Set miette report handler in tests too 2023-10-03 07:41:05 +04:00
Ivan Molodetskikh ba0a6d6b88 Remove accidentally committed debug element 2023-10-02 18:55:10 +04:00
Ivan Molodetskikh 382c049b5a Send output enter/leave to pointer and DnD surfaces
This allows them to apply the right scale factor.
2023-10-02 18:48:41 +04:00
Kirill Chibisov 9168f08038 protocols: add wlr_data_control
Also update smithay to the latest git hash.

Fixes #20.
2023-10-02 16:28:08 +03:00
Ivan Molodetskikh 2d3d0ce165 tty: Remove assert on needs_sync
cosmic-comp doesn't do anything with it.
2023-10-02 10:54:05 +04:00
Ivan Molodetskikh 5b6b3fcfbe Avoid sending frame callbacks to invisible surfaces 2023-10-01 19:41:42 +04:00
Kirill Chibisov d8a511bbac config/input: add cursor section
This should allow users to configure theme and size for the cursor,
as well as automatically set `XCURSOR_THEME` and `XCURSOR_SIZE` env
variables.
2023-10-01 17:50:42 +03:00
Ivan Molodetskikh 8d443c2e84 Make default cursor respect output scale
First part of https://github.com/YaLTeR/niri/issues/16
2023-10-01 08:03:12 +04:00
Kirill Chibisov d39da3f461 protocols: add IME protocols
This commit adds support for the `input_method_v2`, `text_input_v3`,
and `virtual_keyboard`. The implementation follows the one in the
anvil and catacomb, but those protocols are mostly enabled and
forget type of things.

Fixes #22.
2023-10-01 06:29:33 +03: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 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