a few changes here...

- foot no longer resizes by col,row because we've set every client to
  tiling
- stop using a seperate enum for tagging in SceneNodeData
- use enabling instead of positioning views out of the visible area
This commit is contained in:
Squibid 2025-12-18 22:05:31 -05:00
parent ff196693cd
commit 9173cab6b9
Signed by: squibid
GPG key ID: BECE5684D3C4005D
4 changed files with 53 additions and 14 deletions

View file

@ -1,6 +1,7 @@
const std = @import("std");
const zlua = @import("zlua");
const wlr = @import("wlroots");
const wl = @import("wayland").server.wl;
const Output = @import("../Output.zig");
const View = @import("../View.zig");
@ -26,6 +27,10 @@ pub fn get_all_ids(L: *zlua.Lua) i32 {
while(output_it.next()) |o| {
if(o.output.data == null) continue;
const output: *Output = @ptrCast(@alignCast(o.output.data.?));
if (!output.state.enabled) {
std.log.debug("ts not enabled", .{});
continue;
}
const layers = [_]*wlr.SceneTree{
output.layers.content,
@ -245,3 +250,37 @@ pub fn get_app_id(L: *zlua.Lua) i32 {
L.pushNil();
return 1;
}
// ---Get the app_id of the view
// ---@param view_id view_id 0 maps to focused view
// ---@param enable boolean
pub fn set_enabled(L: *zlua.Lua) i32 {
const view_id = LuaUtils.coerceInteger(u64, L.checkInteger(1)) catch view_id_err(L);
if (!L.isBoolean(2)) {
L.raiseErrorStr("argument 2 must be a boolean", .{});
}
const activate = L.toBoolean(2);
if (LuaUtils.viewById(view_id)) |v| {
_ = v.xdg_toplevel.setActivated(activate);
return 0;
}
L.pushNil();
return 1;
}
// ---Get the app_id of the view
// ---@param view_id view_id 0 maps to focused view
// ---@return boolean?
pub fn get_enabled(L: *zlua.Lua) i32 {
const view_id = LuaUtils.coerceInteger(u64, L.checkInteger(1)) catch view_id_err(L);
if(LuaUtils.viewById(view_id)) |v| {
_ = L.pushBoolean(v.xdg_toplevel.current.activated);
return 1;
}
L.pushNil();
return 1;
}