alt tab and odd -c no focus

This commit is contained in:
Harrison DiAmbrosio 2025-11-25 17:30:13 -05:00
parent 1729e10e1d
commit d4ab71fb35
4 changed files with 22 additions and 18 deletions

View file

@ -16,6 +16,7 @@ pub fn spawn(L: *zlua.Lua) i32 {
}
L.checkType(1, .string);
std.log.debug("GOT HERE", .{});
const cmd = L.toString(1) catch {
L.raiseErrorStr("Lua error check your config", .{});

View file

@ -29,7 +29,7 @@ pub fn get_all_ids(L: *zlua.Lua) i32 {
pub fn get_focused_id(L: *zlua.Lua) i32 {
if(server.seat.focused_view) |view| {
_ = L.pushNumber(@floatFromInt(view.id));
L.pushInteger(@intCast(view.id));
return 1;
}
@ -92,7 +92,7 @@ pub fn set_size(L: *zlua.Lua) i32 {
return 0;
}
pub fn raise_to_top(L: *zlua.Lua) i32 {
pub fn set_focused(L: *zlua.Lua) i32 {
const nargs: i32 = L.getTop();
if(nargs != 1) {
@ -110,7 +110,7 @@ pub fn raise_to_top(L: *zlua.Lua) i32 {
return 0;
}
view.?.raiseToTop();
view.?.setFocused();
return 0;
}

View file

@ -95,8 +95,7 @@ pub fn setFocused(self: *View) void {
}
}
self.raiseToTop();
self.scene_tree.node.raiseToTop();
_ = self.xdg_toplevel.setActivated(true);
const wlr_keyboard = server.seat.wlr_seat.getKeyboard() orelse return;
@ -113,10 +112,6 @@ pub fn setFocused(self: *View) void {
self.focused = true;
}
pub fn raiseToTop(self: *View) void {
self.scene_tree.node.raiseToTop();
}
pub fn setPosition(self: *View, x: i32, y: i32) void {
self.scene_tree.node.setPosition(x, y);
}