aboutsummaryrefslogtreecommitdiff
path: root/src/LayerSurface.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/LayerSurface.zig')
-rw-r--r--src/LayerSurface.zig10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/LayerSurface.zig b/src/LayerSurface.zig
index a90917c..088dd97 100644
--- a/src/LayerSurface.zig
+++ b/src/LayerSurface.zig
@@ -24,6 +24,7 @@ const c = @import("c.zig");
const Box = @import("Box.zig");
const Log = @import("log.zig").Log;
const Output = @import("Output.zig");
+const XdgPopup = @import("XdgPopup.zig");
output: *Output,
wlr_layer_surface: *c.wlr_layer_surface_v1,
@@ -186,7 +187,10 @@ fn handleCommit(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void {
fn handleNewPopup(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void {
const self = @fieldParentPtr(Self, "listen_new_popup", listener.?);
- Log.Debug.log("new layer surface popup.", .{});
- // TODO: handle popups
- unreachable;
+ const wlr_xdg_popup = @ptrCast(*c.wlr_xdg_popup, @alignCast(@alignOf(*c.wlr_xdg_popup), data));
+ const allocator = self.output.root.server.allocator;
+
+ // This will free itself on destroy
+ var xdg_popup = allocator.create(XdgPopup) catch unreachable;
+ xdg_popup.init(self.output, &self.box, wlr_xdg_popup);
}