From d96daf68a7d1b843b5231e2c416349214c5629d2 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 16 Aug 2023 08:03:20 +0400 Subject: Add binds to move between monitors --- src/utils.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/utils.rs') diff --git a/src/utils.rs b/src/utils.rs index 7d895530..b7dee6e2 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -7,7 +7,7 @@ use smithay::backend::allocator::Fourcc; use smithay::backend::renderer::element::texture::TextureBuffer; use smithay::backend::renderer::gles::{GlesRenderer, GlesTexture}; use smithay::reexports::nix::time::{clock_gettime, ClockId}; -use smithay::utils::{Physical, Point, Transform}; +use smithay::utils::{Logical, Physical, Point, Rectangle, Transform}; use xcursor::parser::parse_xcursor; use xcursor::CursorTheme; @@ -18,6 +18,10 @@ pub fn get_monotonic_time() -> Duration { Duration::from(clock_gettime(ClockId::CLOCK_MONOTONIC).unwrap()) } +pub fn center(rect: Rectangle) -> Point { + rect.loc + rect.size.downscale(2).to_point() +} + fn load_xcursor() -> anyhow::Result { let theme = CursorTheme::load("default"); let path = theme -- cgit