From 0e29e7f6ff800af0effdad19be4e63e7e9cd84a4 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sun, 3 Dec 2023 13:50:07 +0400 Subject: Keep monitor aspect ratio and clamp to monitor for tablets Before, the full tablet area was used, even if the aspect ratio didn't match the monitor. Also, the coordinates weren't clamped. --- src/niri.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/niri.rs') diff --git a/src/niri.rs b/src/niri.rs index c9f7487e..66863f15 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -41,6 +41,7 @@ use smithay::reexports::calloop::timer::{TimeoutAction, Timer}; use smithay::reexports::calloop::{ self, Idle, Interest, LoopHandle, LoopSignal, Mode, PostAction, RegistrationToken, }; +use smithay::reexports::input; use smithay::reexports::wayland_protocols::xdg::shell::server::xdg_toplevel::WmCapabilities; use smithay::reexports::wayland_protocols_misc::server_decoration as _server_decoration; use smithay::reexports::wayland_server::backend::{ @@ -86,6 +87,7 @@ use crate::dbus::gnome_shell_screenshot::{NiriToScreenshot, ScreenshotToNiri}; use crate::dbus::mutter_screen_cast::{self, ScreenCastToNiri}; use crate::frame_clock::FrameClock; use crate::handlers::configure_lock_surface; +use crate::input::TabletData; use crate::layout::{output_size, Layout, MonitorRenderElement}; use crate::pw_utils::{Cast, PipeWire}; use crate::screenshot_ui::{ScreenshotUi, ScreenshotUiRenderElement}; @@ -121,6 +123,8 @@ pub struct Niri { // When false, we're idling with monitors powered off. pub monitors_active: bool, + pub tablets: HashMap, + // Smithay state. pub compositor_state: CompositorState, pub xdg_shell_state: XdgShellState, @@ -694,6 +698,8 @@ impl Niri { unmapped_windows: HashMap::new(), monitors_active: true, + tablets: HashMap::new(), + compositor_state, xdg_shell_state, xdg_decoration_state, -- cgit