From e4d9484d0e1ebcf496d0606800560c09d2753df4 Mon Sep 17 00:00:00 2001 From: tcmal Date: Tue, 13 Aug 2024 17:56:39 +0100 Subject: Add moving and resizing with mouse --- src/conn_info/cursors.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/conn_info') diff --git a/src/conn_info/cursors.rs b/src/conn_info/cursors.rs index bb547e4..c564f56 100644 --- a/src/conn_info/cursors.rs +++ b/src/conn_info/cursors.rs @@ -6,6 +6,7 @@ use xcb::{ // https://tronche.com/gui/x/xlib/appendix/b/ const XC_LEFT_PTR: u16 = 68; +const XC_FLEUR: u16 = 52; /// Caches X11 cursor objects #[derive(Debug)] @@ -14,6 +15,7 @@ pub struct Cursors { font: Font, normal: Cursor, + moving: Cursor, } impl Cursors { @@ -28,6 +30,7 @@ impl Cursors { Ok(Self { normal: Self::load_cursor(conn, font, XC_LEFT_PTR)?, + moving: Self::load_cursor(conn, font, XC_FLEUR)?, font, }) } @@ -57,6 +60,10 @@ impl Cursors { self.normal } + pub const fn moving(&self) -> Cursor { + self.moving + } + /// Free the associated resources to avoid leaking them. /// This object must not be used again after this method is called, as all resources will be invalid. pub unsafe fn free(&self, conn: &RawConnection) { -- cgit v1.2.3