aboutsummaryrefslogtreecommitdiff
path: root/src/niri.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-12-20 08:49:18 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2024-12-22 15:19:46 +0300
commitd38bfc4affb27c04530fad98e12cedadcdd6a0f9 (patch)
tree9e0ff74667f7a3d703a4b04b1ef936ef7469c80e /src/niri.rs
parentfbb0054232fb859636ea7e32bdc45c71e185f0c6 (diff)
downloadniri-d38bfc4affb27c04530fad98e12cedadcdd6a0f9.tar.gz
niri-d38bfc4affb27c04530fad98e12cedadcdd6a0f9.tar.bz2
niri-d38bfc4affb27c04530fad98e12cedadcdd6a0f9.zip
Add test-only single-pixel-buffer support
Diffstat (limited to 'src/niri.rs')
-rw-r--r--src/niri.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/niri.rs b/src/niri.rs
index f9a21efb..0f1d97ab 100644
--- a/src/niri.rs
+++ b/src/niri.rs
@@ -92,6 +92,8 @@ use smithay::wayland::shell::wlr_layer::{self, Layer, WlrLayerShellState};
use smithay::wayland::shell::xdg::decoration::XdgDecorationState;
use smithay::wayland::shell::xdg::XdgShellState;
use smithay::wayland::shm::ShmState;
+#[cfg(test)]
+use smithay::wayland::single_pixel_buffer::SinglePixelBufferState;
use smithay::wayland::socket::ListeningSocketSource;
use smithay::wayland::tablet_manager::TabletManagerState;
use smithay::wayland::text_input::TextInputManagerState;
@@ -263,6 +265,15 @@ pub struct Niri {
pub activation_state: XdgActivationState,
pub mutter_x11_interop_state: MutterX11InteropManagerState,
+ // This will not work as is outside of tests, so it is gated with #[cfg(test)] for now. In
+ // particular, shaders will need to learn about the single pixel buffer. Also, it must be
+ // verified that a black single-pixel-buffer background lets the foreground surface to be
+ // unredirected.
+ //
+ // https://github.com/YaLTeR/niri/issues/619
+ #[cfg(test)]
+ pub single_pixel_buffer_state: SinglePixelBufferState,
+
pub seat: Seat<State>,
/// Scancodes of the keys to suppress.
pub suppressed_keys: HashSet<Keycode>,
@@ -1818,6 +1829,9 @@ impl Niri {
let mutter_x11_interop_state =
MutterX11InteropManagerState::new::<State, _>(&display_handle, move |_| true);
+ #[cfg(test)]
+ let single_pixel_buffer_state = SinglePixelBufferState::new::<State>(&display_handle);
+
let mut seat: Seat<State> = seat_state.new_wl_seat(&display_handle, backend.seat_name());
seat.add_keyboard(
config_.input.keyboard.xkb.to_xkb_config(),
@@ -1990,6 +2004,8 @@ impl Niri {
gamma_control_manager_state,
activation_state,
mutter_x11_interop_state,
+ #[cfg(test)]
+ single_pixel_buffer_state,
seat,
keyboard_focus: KeyboardFocus::Layout { surface: None },