mirror of
https://github.com/MezzalunaWM/Mezzaluna.git
synced 2026-03-08 04:57:32 -04:00
set x cursor type in lua
This commit is contained in:
parent
42204bc4d2
commit
22e3553580
3 changed files with 23 additions and 3 deletions
|
|
@ -78,7 +78,7 @@ pub fn deinit(self: *Cursor) void {
|
|||
}
|
||||
|
||||
pub fn processCursorMotion(self: *Cursor, time_msec: u32) void {
|
||||
self.wlr_cursor.setXcursor(self.x_cursor_manager, "default");
|
||||
// TODO: allow acces via lua
|
||||
|
||||
var handled = false;
|
||||
|
||||
|
|
@ -129,6 +129,7 @@ pub fn processCursorMotion(self: *Cursor, time_msec: u32) void {
|
|||
} else {
|
||||
// This may not be necessary, remove if no bugs
|
||||
server.seat.wlr_seat.pointerClearFocus();
|
||||
self.wlr_cursor.setXcursor(self.x_cursor_manager, "default");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,3 +171,11 @@ pub fn set_repeat_info(L: *zlua.Lua) i32 {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/// ---Set the cursor type
|
||||
/// ---@param string cursor name
|
||||
pub fn set_cursor_type(L: *zlua.Lua) i32 {
|
||||
const name = L.checkString(1);
|
||||
server.cursor.wlr_cursor.setXcursor(server.cursor.x_cursor_manager, name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue