diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-11 20:34:51 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-11 20:34:51 +0200 |
| commit | 03691722b2d608f173ec7adb872ffafef174f76c (patch) | |
| tree | 67aae8440f142fcb3c3f5bc94e192e1ab665b4ae /src/layer_surface.zig | |
| parent | ff833a07d3ffc5916fdfb814f2896e82a97e91d9 (diff) | |
| download | river-03691722b2d608f173ec7adb872ffafef174f76c.tar.gz river-03691722b2d608f173ec7adb872ffafef174f76c.tar.xz | |
Handle exclusive zones of layer surfaces
Diffstat (limited to 'src/layer_surface.zig')
| -rw-r--r-- | src/layer_surface.zig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/layer_surface.zig b/src/layer_surface.zig index 89381d8..e628e71 100644 --- a/src/layer_surface.zig +++ b/src/layer_surface.zig @@ -29,6 +29,7 @@ pub const LayerSurface = struct { self.output = output; self.wlr_layer_surface = wlr_layer_surface; + self.box = undefined; self.layer = layer; self.listen_map.notify = handleMap; @@ -58,6 +59,7 @@ pub const LayerSurface = struct { layer_surface.wlr_layer_surface.surface, layer_surface.wlr_layer_surface.output, ); + layer_surface.output.arrangeLayers(); } fn handleUnmap(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void { @@ -75,8 +77,10 @@ pub const LayerSurface = struct { fn handleCommit(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void { const layer_surface = @fieldParentPtr(LayerSurface, "listen_commit", listener.?); + const wlr_layer_surface = layer_surface.wlr_layer_surface; if (layer_surface.wlr_layer_surface.output == null) { + Log.Error.log("Layer surface committed with null output", .{}); return; } @@ -92,6 +96,10 @@ pub const LayerSurface = struct { const new_layer_idx = @intCast(usize, @enumToInt(layer_surface.layer)); layer_surface.output.layers[new_layer_idx].append(node); } + + // TODO: only reconfigure if things haven't changed + // https://github.com/swaywm/wlroots/issues/1079 + layer_surface.output.arrangeLayers(); } fn handleNewPopup(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void { |
