From d9d9388978c8cfcd09146bd48f58c177f49930d6 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sun, 29 Mar 2020 16:56:30 +0200 Subject: Handle timeout of transactions that take too long --- src/server.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/server.zig') diff --git a/src/server.zig b/src/server.zig index 266640f..c83c2d8 100644 --- a/src/server.zig +++ b/src/server.zig @@ -14,6 +14,7 @@ pub const Server = struct { allocator: *std.mem.Allocator, wl_display: *c.wl_display, + wl_event_loop: *c.wl_event_loop, wlr_backend: *c.wlr_backend, wlr_renderer: *c.wlr_renderer, @@ -30,11 +31,15 @@ pub const Server = struct { self.allocator = allocator; // The Wayland display is managed by libwayland. It handles accepting - // clients from the Unix socket, manging Wayland globals, and so on. + // clients from the Unix socket, managing Wayland globals, and so on. self.wl_display = c.wl_display_create() orelse return error.CantCreateWlDisplay; errdefer c.wl_display_destroy(self.wl_display); + // Should never return null if the display was created successfully + self.wl_event_loop = c.wl_display_get_event_loop(self.wl_display) orelse + return error.CantGetEventLoop; + // The wlr_backend abstracts the input/output hardware. Autocreate chooses // the best option based on the environment, for example DRM when run from // a tty or wayland if WAYLAND_DISPLAY is set. -- cgit v1.2.3