removed all windows decorations properly, added window closing and compositor exiting as well as view focusing

This commit is contained in:
Harrison DiAmbrosio 2025-10-25 18:50:06 -04:00
parent f636efdfe9
commit 976900ffa6
11 changed files with 289 additions and 117 deletions

View file

@ -4,6 +4,7 @@ const zlua = @import("zlua");
const gpa = std.heap.c_allocator;
const env_map = &@import("../main.zig").env_map;
const server = &@import("../main.zig").server;
pub fn spawn(L: *zlua.Lua) i32 {
const nargs: i32 = L.getTop();
@ -28,3 +29,31 @@ pub fn spawn(L: *zlua.Lua) i32 {
return 0;
}
pub fn close(L: *zlua.Lua) i32 {
const nargs: i32 = L.getTop();
if (nargs != 0) {
L.raiseErrorStr("Expected no arguments", .{});
return 0;
}
if(server.seat.focused_view) |view| {
view.xdg_toplevel.sendClose();
}
return 0;
}
pub fn exit(L: *zlua.Lua) i32 {
const nargs: i32 = L.getTop();
if (nargs != 0) {
L.raiseErrorStr("Expected no arguments", .{});
return 0;
}
server.deinit();
return 0;
}