aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/handlers/mod.rs6
-rw-r--r--src/niri.rs16
2 files changed, 20 insertions, 2 deletions
diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs
index f1123371..5b59ec45 100644
--- a/src/handlers/mod.rs
+++ b/src/handlers/mod.rs
@@ -62,8 +62,8 @@ use smithay::{
delegate_input_method_manager, delegate_output, delegate_pointer_constraints,
delegate_pointer_gestures, delegate_presentation, delegate_primary_selection,
delegate_relative_pointer, delegate_seat, delegate_security_context, delegate_session_lock,
- delegate_tablet_manager, delegate_text_input_manager, delegate_viewporter,
- delegate_virtual_keyboard_manager, delegate_xdg_activation,
+ delegate_single_pixel_buffer, delegate_tablet_manager, delegate_text_input_manager,
+ delegate_viewporter, delegate_virtual_keyboard_manager, delegate_xdg_activation,
};
pub use crate::handlers::xdg_shell::KdeDecorationsModeState;
@@ -701,3 +701,5 @@ delegate_output_management!(State);
impl MutterX11InteropHandler for State {}
delegate_mutter_x11_interop!(State);
+
+delegate_single_pixel_buffer!(State);
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 },