From 1ffd13ef866c886609fbbb8bd0868f02a20a6883 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Fri, 10 Apr 2020 17:23:25 +0200 Subject: [PATCH] Implement xdg-output --- src/c.zig | 1 + src/server.zig | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/c.zig b/src/c.zig index bb06876..96a0b8c 100644 --- a/src/c.zig +++ b/src/c.zig @@ -19,6 +19,7 @@ pub usingnamespace @cImport({ @cInclude("wlr/types/wlr_seat.h"); @cInclude("wlr/types/wlr_xcursor_manager.h"); @cInclude("wlr/types/wlr_xdg_decoration_v1.h"); + @cInclude("wlr/types/wlr_xdg_output_v1.h"); @cInclude("wlr/types/wlr_xdg_shell.h"); @cInclude("wlr/util/log.h"); @cInclude("xkbcommon/xkbcommon.h"); diff --git a/src/server.zig b/src/server.zig index 0fbfc3f..8f1f1d3 100644 --- a/src/server.zig +++ b/src/server.zig @@ -64,12 +64,6 @@ pub const Server = struct { c.wlr_renderer_init_wl_display(self.wlr_renderer, self.wl_display); // orelse // return error.CantInitWlDisplay; - // These both free themselves when the wl_display is destroyed - _ = c.wlr_compositor_create(self.wl_display, self.wlr_renderer) orelse - return error.CantCreateWlrCompositor; - _ = c.wlr_data_device_manager_create(self.wl_display) orelse - return error.CantCreateWlrDataDeviceManager; - self.wlr_xdg_shell = c.wlr_xdg_shell_create(self.wl_display) orelse return error.CantCreateWlrXdgShell; @@ -84,6 +78,14 @@ pub const Server = struct { try self.config.init(self.allocator); + // These all free themselves when the wl_display is destroyed + _ = c.wlr_compositor_create(self.wl_display, self.wlr_renderer) orelse + return error.CantCreateWlrCompositor; + _ = c.wlr_data_device_manager_create(self.wl_display) orelse + return error.CantCreateWlrDataDeviceManager; + _ = c.wlr_xdg_output_manager_v1_create(self.wl_display, self.root.wlr_output_layout) orelse + return error.CantCreateWlrOutputManager; + // Register listeners for events on our globals self.listen_new_output.notify = handleNewOutput; c.wl_signal_add(&self.wlr_backend.events.new_output, &self.listen_new_output);