aboutsummaryrefslogtreecommitdiff
path: root/src/niri.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-12-03 13:50:07 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-12-03 13:50:07 +0400
commit0e29e7f6ff800af0effdad19be4e63e7e9cd84a4 (patch)
tree2405b690a0693c40fbffd2b9daa5827b7cbb7eee /src/niri.rs
parent626c720b7ac267b91d1f2b5eb53046ed5e90bc00 (diff)
downloadniri-0e29e7f6ff800af0effdad19be4e63e7e9cd84a4.tar.gz
niri-0e29e7f6ff800af0effdad19be4e63e7e9cd84a4.tar.bz2
niri-0e29e7f6ff800af0effdad19be4e63e7e9cd84a4.zip
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.
Diffstat (limited to 'src/niri.rs')
-rw-r--r--src/niri.rs6
1 files changed, 6 insertions, 0 deletions
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<input::Device, TabletData>,
+
// 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,