diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-15 12:23:14 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-15 12:23:14 +0200 |
| commit | 5da3935c18dde38bd24ba97b6cfb55e7b0298c97 (patch) | |
| tree | 40f976a85bf0bbe959642b6cb00e3babc7a8df64 | |
| parent | 9ee61b3bf9503900e86996ac84f5c2058458352e (diff) | |
| download | river-5da3935c18dde38bd24ba97b6cfb55e7b0298c97.tar.gz river-5da3935c18dde38bd24ba97b6cfb55e7b0298c97.tar.xz | |
Don't advertise the noop output
| -rw-r--r-- | include/render.c | 4 | ||||
| -rw-r--r-- | include/render.h | 1 | ||||
| -rw-r--r-- | src/output.zig | 22 |
3 files changed, 17 insertions, 10 deletions
diff --git a/include/render.c b/include/render.c index 87f1f50..0eaf76d 100644 --- a/include/render.c +++ b/include/render.c @@ -31,3 +31,7 @@ struct wlr_backend *river_wlr_noop_backend_create(struct wl_display *display) { struct wlr_output *river_wlr_noop_add_output(struct wlr_backend *backend) { return wlr_noop_add_output(backend); } + +bool river_wlr_output_is_noop(struct wlr_output *output) { + return wlr_output_is_noop(output); +} diff --git a/include/render.h b/include/render.h index 5d75d3d..2da8f6e 100644 --- a/include/render.h +++ b/include/render.h @@ -29,5 +29,6 @@ bool river_wlr_backend_is_multi(struct wlr_backend *backend); struct wlr_session *river_wlr_backend_get_session(struct wlr_backend *backend); struct wlr_backend *river_wlr_noop_backend_create(struct wl_display *display); struct wlr_output *river_wlr_noop_add_output(struct wlr_backend *backend); +bool river_wlr_output_is_noop(struct wlr_output *output); #endif 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 |
