diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-27 19:58:44 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-27 20:00:05 +0200 |
| commit | ce8d8a7825576a011001f1decada8a05a5ca2ad2 (patch) | |
| tree | 0f514d60a8ec190fd9b39bd66e2c88cc81c356d6 /src | |
| parent | 460fb6da19bec78fdda67851d9dc77d7ec6649e9 (diff) | |
| download | river-ce8d8a7825576a011001f1decada8a05a5ca2ad2.tar.gz river-ce8d8a7825576a011001f1decada8a05a5ca2ad2.tar.xz | |
Arrange layers on layer surface destroy
Fixes https://github.com/ifreund/river/issues/15
Diffstat (limited to 'src')
| -rw-r--r-- | src/layer_surface.zig | 9 | ||||
| -rw-r--r-- | src/output.zig | 8 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/layer_surface.zig b/src/layer_surface.zig index 105eaad..e4d4344 100644 --- a/src/layer_surface.zig +++ b/src/layer_surface.zig @@ -52,11 +52,6 @@ pub const LayerSurface = struct { c.wl_signal_add(&self.wlr_layer_surface.events.unmap, &self.listen_unmap); } - /// Send a configure event to the client with the dimensions of the current box - pub fn sendConfigure(self: Self) void { - c.wlr_layer_surface_v1_configure(self.wlr_layer_surface, self.box.width, self.box.height); - } - fn handleDestroy(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void { const self = @fieldParentPtr(Self, "listen_destroy", listener.?); const output = self.output; @@ -71,6 +66,8 @@ pub const LayerSurface = struct { const node = @fieldParentPtr(std.TailQueue(Self).Node, "data", self); output.layers[@intCast(usize, @enumToInt(self.layer))].remove(node); output.root.server.allocator.destroy(node); + + self.output.arrangeLayers(); } fn handleMap(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void { @@ -92,8 +89,6 @@ pub const LayerSurface = struct { wlr_layer_surface.surface, wlr_layer_surface.output, ); - - self.output.arrangeLayers(); } fn handleUnmap(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void { diff --git a/src/output.zig b/src/output.zig index 7ef053f..5530b77 100644 --- a/src/output.zig +++ b/src/output.zig @@ -464,7 +464,13 @@ pub const Output = struct { } } - layer_surface.sendConfigure(); + // Tell the client to assume the new size + Log.Debug.log("send configure, {} x {}", .{ layer_surface.box.width, layer_surface.box.height }); + c.wlr_layer_surface_v1_configure( + layer_surface.wlr_layer_surface, + layer_surface.box.width, + layer_surface.box.height, + ); } } |
