From 56d7a43102b53f79a2311662783d5dd94cb2f1a5 Mon Sep 17 00:00:00 2001 From: ImperishableSecret <57067794+imperishableSecret@users.noreply.github.com> Date: Thu, 30 Apr 2026 02:43:15 +0530 Subject: config/lua: expand properties in the workspace object (#14194) --- src/config/lua/objects/LuaWindow.cpp | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) (limited to 'src/config/lua/objects/LuaWindow.cpp') diff --git a/src/config/lua/objects/LuaWindow.cpp b/src/config/lua/objects/LuaWindow.cpp index 1d933462..7fe87334 100644 --- a/src/config/lua/objects/LuaWindow.cpp +++ b/src/config/lua/objects/LuaWindow.cpp @@ -1,6 +1,7 @@ #include "LuaWindow.hpp" #include "LuaWorkspace.hpp" #include "LuaMonitor.hpp" +#include "LuaGroup.hpp" #include "LuaObjectHelpers.hpp" #include "../../../desktop/view/Window.hpp" @@ -126,38 +127,7 @@ static int windowIndex(lua_State* L) { return 1; } - lua_newtable(L); - - lua_pushboolean(L, w->m_group->locked()); - lua_setfield(L, -2, "locked"); - - lua_pushboolean(L, w->m_group->denied()); - lua_setfield(L, -2, "denied"); - - lua_pushinteger(L, sc(w->m_group->size())); - lua_setfield(L, -2, "size"); - - lua_pushinteger(L, sc(w->m_group->getCurrentIdx()) + 1); - lua_setfield(L, -2, "current_index"); - - const auto current = w->m_group->current(); - if (current) - Objects::CLuaWindow::push(L, current); - else - lua_pushnil(L); - lua_setfield(L, -2, "current"); - - lua_newtable(L); - int i = 1; - for (const auto& grouped : w->m_group->windows()) { - const auto groupedWindow = grouped.lock(); - if (!groupedWindow) - continue; - - Objects::CLuaWindow::push(L, groupedWindow); - lua_rawseti(L, -2, i++); - } - lua_setfield(L, -2, "members"); + Objects::CLuaGroup::push(L, w->m_group); } else if (key == "tags") { lua_newtable(L); -- cgit v1.2.3