river-status: use correct resource and fix crash

This commit is contained in:
Isaac Freund 2020-06-05 00:04:46 +02:00
parent a63fb461ba
commit 7a40ac370d
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11

View File

@ -120,7 +120,7 @@ fn getRiverSeatStatus(
) callconv(.C) void { ) callconv(.C) void {
const self = @ptrCast(*Self, @alignCast(@alignOf(*Self), c.wl_resource_get_user_data(wl_resource))); const self = @ptrCast(*Self, @alignCast(@alignOf(*Self), c.wl_resource_get_user_data(wl_resource)));
// This can be null if the seat is inert, in which case we ignore the request // This can be null if the seat is inert, in which case we ignore the request
const wlr_seat_client = c.wlr_seat_client_from_resource(wl_resource) orelse return; const wlr_seat_client = c.wlr_seat_client_from_resource(seat_wl_resource) orelse return;
const seat = @ptrCast(*Seat, @alignCast(@alignOf(*Seat), wlr_seat_client.*.seat.*.data)); const seat = @ptrCast(*Seat, @alignCast(@alignOf(*Seat), wlr_seat_client.*.seat.*.data));
const allocator = self.server.allocator; const allocator = self.server.allocator;