From 1fbaaa55b3a5882baa52e3d39bf096512030db2b Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Fri, 21 Aug 2020 16:45:27 +0200 Subject: [PATCH] xdg-toplevel: clean up initialization --- river/XdgToplevel.zig | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/river/XdgToplevel.zig b/river/XdgToplevel.zig index 69f9ff7..fcd74f4 100644 --- a/river/XdgToplevel.zig +++ b/river/XdgToplevel.zig @@ -35,18 +35,17 @@ view: *View, wlr_xdg_surface: *c.wlr_xdg_surface, // Listeners that are always active over the view's lifetime -listen_destroy: c.wl_listener, -listen_map: c.wl_listener, -listen_unmap: c.wl_listener, +listen_destroy: c.wl_listener = undefined, +listen_map: c.wl_listener = undefined, +listen_unmap: c.wl_listener = undefined, // Listeners that are only active while the view is mapped -listen_commit: c.wl_listener, -listen_new_popup: c.wl_listener, -listen_request_fullscreen: c.wl_listener, +listen_commit: c.wl_listener = undefined, +listen_new_popup: c.wl_listener = undefined, +listen_request_fullscreen: c.wl_listener = undefined, pub fn init(self: *Self, view: *View, wlr_xdg_surface: *c.wlr_xdg_surface) void { - self.view = view; - self.wlr_xdg_surface = wlr_xdg_surface; + self.* = .{ .view = view, .wlr_xdg_surface = wlr_xdg_surface }; wlr_xdg_surface.data = self; // Add listeners that are active over the view's entire lifetime