From 5da3935c18dde38bd24ba97b6cfb55e7b0298c97 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Wed, 15 Apr 2020 12:23:14 +0200 Subject: Don't advertise the noop output --- src/output.zig | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/output.zig b/src/output.zig index 23e9e88..a31d7fc 100644 --- a/src/output.zig +++ b/src/output.zig @@ -86,16 +86,18 @@ pub const Output = struct { self.listen_mode.notify = handleMode; c.wl_signal_add(&wlr_output.events.mode, &self.listen_mode); - // Add the new output to the layout. The add_auto function arranges outputs - // from left-to-right in the order they appear. A more sophisticated - // compositor would let the user configure the arrangement of outputs in the - // layout. - c.wlr_output_layout_add_auto(root.wlr_output_layout, wlr_output); - - // Creating the global adds a wl_output global to the display, which Wayland - // clients can see to find out information about the output (such as - // DPI, scale factor, manufacturer, etc). - c.wlr_output_create_global(wlr_output); + if (!c.river_wlr_output_is_noop(wlr_output)) { + // Add the new output to the layout. The add_auto function arranges outputs + // from left-to-right in the order they appear. A more sophisticated + // compositor would let the user configure the arrangement of outputs in the + // layout. + c.wlr_output_layout_add_auto(root.wlr_output_layout, wlr_output); + + // Creating the global adds a wl_output global to the display, which Wayland + // clients can see to find out information about the output (such as + // DPI, scale factor, manufacturer, etc). + c.wlr_output_create_global(wlr_output); + } } /// Add a new view to the output. arrangeViews() will be called by the view -- cgit v1.2.3