git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit1c702e3461255aadff50597c8543b6dfe7da80e9
parent366f42af6f
authorIsaac Freund <[email protected]>
date2020-11-10 11:46
code: use zig 0.7.0 and wlroots 0.12.0

 README.md              |  4 ++--
 river/LayerSurface.zig | 16 +++-------------
 river/Output.zig       | 29 -----------------------------
 3 files changed, 5 insertions(+), 44 deletions(-)

diff --git a/README.md b/README.md
index 963f51c..32a096f 100644
--- a/README.md
+++ b/README.md
@@ -29,10 +29,10 @@ git submodule update --init
 To compile river first ensure that you have the following dependencies
 installed:
 
-- [zig](https://ziglang.org/download/) master (will stick with 0.7.0 when it is released)
+- [zig](https://ziglang.org/download/) 0.7.0
 - wayland
 - wayland-protocols
-- [wlroots](https://github.com/swaywm/wlroots) 0.11.0
+- [wlroots](https://github.com/swaywm/wlroots) 0.12.0
 - xkbcommon
 - libevdev
 - pixman
diff --git a/river/LayerSurface.zig b/river/LayerSurface.zig
index 6f33a7f..51486ad 100644
--- a/river/LayerSurface.zig
+++ b/river/LayerSurface.zig
@@ -111,19 +111,9 @@ fn handleUnmap(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void {
 
     log.debug(.layer_shell, "layer surface '{}' unmapped", .{self.wlr_layer_surface.namespace});
 
-    // This is a bit ugly: we need to use the wlr bool here since surfaces
-    // may be closed during the inital configure which we preform
-    // while unmapped. wlroots currently calls unmap unconditionally on close
-    // even if the surface is not mapped. I sent a patch which was merged, but
-    // we need to wait for a release to use it.
-    //
-    // TODO(wlroots): Remove this check on updating
-    // https://github.com/swaywm/wlroots/commit/11e94c406bb75c9a8990ce99489798411deb110c
-    if (self.wlr_layer_surface.mapped) {
-        // remove listeners only active while the layer surface is mapped
-        c.wl_list_remove(&self.listen_commit.link);
-        c.wl_list_remove(&self.listen_new_popup.link);
-    }
+    // remove listeners only active while the layer surface is mapped
+    c.wl_list_remove(&self.listen_commit.link);
+    c.wl_list_remove(&self.listen_new_popup.link);
 
     // Remove from the output's list of layer surfaces
     const self_node = @fieldParentPtr(std.TailQueue(Self).Node, "data", self);
diff --git a/river/Output.zig b/river/Output.zig
index 6d01ce4..91c0f25 100644
--- a/river/Output.zig
+++ b/river/Output.zig
@@ -402,18 +402,6 @@ fn arrangeLayer(
                 new_box.x = bounds.x + @intCast(i32, current_state.margin.left);
                 new_box.width = bounds.width -
                     (current_state.margin.left + current_state.margin.right);
-            } else {
-                log.err(
-                    .layer_shell,
-                    "layer surface '{s}' requested width 0 without setting left and right anchors",
-                    .{layer_surface.wlr_layer_surface.namespace},
-                );
-                c.wl_resource_post_error(
-                    layer_surface.wlr_layer_surface.resource,
-                    c.ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_SIZE,
-                    "width 0 requested without setting left and right anchors",
-                );
-                continue;
             }
         } else if (current_state.anchor & anchor_left != 0) {
             new_box.x = bounds.x + @intCast(i32, current_state.margin.left);
@@ -436,18 +424,6 @@ fn arrangeLayer(
                 new_box.y = bounds.y + @intCast(i32, current_state.margin.top);
                 new_box.height = bounds.height -
                     (current_state.margin.top + current_state.margin.bottom);
-            } else {
-                log.err(
-                    .layer_shell,
-                    "layer surface '{s}' requested height 0 without setting top and bottom anchors",
-                    .{layer_surface.wlr_layer_surface.namespace},
-                );
-                c.wl_resource_post_error(
-                    layer_surface.wlr_layer_surface.resource,
-                    c.ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_SIZE,
-                    "height 0 requested without setting top and bottom anchors",
-                );
-                continue;
             }
         } else if (current_state.anchor & anchor_top != 0) {
             new_box.y = bounds.y + @intCast(i32, current_state.margin.top);
@@ -595,11 +571,6 @@ fn handleFrame(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void {
     // This function is called every time an output is ready to display a frame,
     // generally at the output's refresh rate (e.g. 60Hz).
     const self = @fieldParentPtr(Self, "listen_frame", listener.?);
-
-    // TODO(wlroots) Remove this check when we update wlroots 0.11 to 0.12
-    // wlroots fix: https://github.com/swaywm/wlroots/commit/85757665e6e1393773b36282aa244feb10b7a5fe
-    if (!self.wlr_output.enabled) return;
-
     render.renderOutput(self);
 }