mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Add test-only single-pixel-buffer support
This commit is contained in:
+4
-2
@@ -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);
|
||||
|
||||
+16
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user