mirror of
https://github.com/zoriya/gaze.git
synced 2026-06-09 12:50:51 +00:00
Fix cursor init segfault
This commit is contained in:
@@ -21,7 +21,7 @@ pub const Cursor = struct {
|
||||
self.cursor.attachInputDevice(device);
|
||||
}
|
||||
|
||||
pub fn create(server: *Server) !*Cursor {
|
||||
pub fn create(server: *Server, output_layout: *wlr.OutputLayout) !*Cursor {
|
||||
const self = try gpa.create(Cursor);
|
||||
errdefer gpa.destroy(self);
|
||||
self.* = .{
|
||||
@@ -30,7 +30,7 @@ pub const Cursor = struct {
|
||||
.cursor_mgr = try wlr.XcursorManager.create(null, 24),
|
||||
};
|
||||
|
||||
self.cursor.attachOutputLayout(server.output_layout);
|
||||
self.cursor.attachOutputLayout(output_layout);
|
||||
try self.cursor_mgr.load(1);
|
||||
|
||||
self.cursor.events.motion.add(&self.motion);
|
||||
|
||||
@@ -50,7 +50,7 @@ pub const Server = struct {
|
||||
.seat = try wlr.Seat.create(wl_server, "default"),
|
||||
.events = undefined,
|
||||
.socket = try wl_server.addSocketAuto(&buf),
|
||||
.cursor = try Cursor.create(self),
|
||||
.cursor = try Cursor.create(self, output_layout),
|
||||
};
|
||||
errdefer self.destroy();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user