all: implement hardware cursors
This commit is contained in:
parent
6cc97ee56e
commit
3b8935cf55
23 changed files with 614 additions and 91 deletions
|
|
@ -363,6 +363,13 @@ impl Client {
|
|||
self.send(&ClientMessage::SetCursorSize { seat, size })
|
||||
}
|
||||
|
||||
pub fn set_use_hardware_cursor(&self, seat: Seat, use_hardware_cursor: bool) {
|
||||
self.send(&ClientMessage::SetUseHardwareCursor {
|
||||
seat,
|
||||
use_hardware_cursor,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn set_size(&self, sized: Resizable, size: i32) {
|
||||
self.send(&ClientMessage::SetSize { sized, size })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -300,6 +300,10 @@ pub enum ClientMessage<'a> {
|
|||
device: InputDevice,
|
||||
enabled: bool,
|
||||
},
|
||||
SetUseHardwareCursor {
|
||||
seat: Seat,
|
||||
use_hardware_cursor: bool,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Encode, Decode, Debug)]
|
||||
|
|
|
|||
|
|
@ -128,6 +128,16 @@ impl Seat {
|
|||
Self(raw)
|
||||
}
|
||||
|
||||
/// Sets whether this seat's cursor uses the hardware cursor if available.
|
||||
///
|
||||
/// Only one seat at a time can use the hardware cursor. Setting this to `true` for a
|
||||
/// seat automatically unsets it for all other seats.
|
||||
///
|
||||
/// By default, the first created seat uses the hardware cursor.
|
||||
pub fn use_hardware_cursor(self, use_hardware_cursor: bool) {
|
||||
get!().set_use_hardware_cursor(self, use_hardware_cursor);
|
||||
}
|
||||
|
||||
/// Sets the size of the cursor theme.
|
||||
///
|
||||
/// Default: 16.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue