From 2f3cdad9d3de43de8124a79299bc00f584592ea9 Mon Sep 17 00:00:00 2001 From: Foxils Date: Sat, 18 Jul 2026 00:43:34 -0400 Subject: [PATCH 1/2] chore: Update `flake.lock` summary: - Ran `nix flake update` notes: - The project wouldn't build previously because the lockfile pointed to a nixpkgs revision before the wlroots was updated to 0.19.3. --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 82d8ab72..67048ad5 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1771848320, - "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", + "lastModified": 1784120854, + "narHash": "sha256-KesHgItiZPgGX740axSiQLcIQ8D24MDqNpkKYWIek8k=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2fc6539b481e1d2569f25f8799236694180c0993", + "rev": "753cc8a3a87467296ddd1fa93f0cc3e81120ee46", "type": "github" }, "original": { From bb3dff4c2b01eab587ff4b8fc59cd986005c2133 Mon Sep 17 00:00:00 2001 From: Foxils Date: Sat, 18 Jul 2026 16:00:43 -0400 Subject: [PATCH 2/2] fix(screen): Apply margin-based geometry adjustments summary: - `luaA_screen_get_bounding_geometry` Apply the margin-based geometry adjustments like was done before in the lua function `screen.object.get_bounding_geometry`. notes: - `luaA_screen_get_bounding_geometry` The function is still missing padding adjustments I want to talk before I make these changes as I believe it need an additional field in screen_t and getters/setters for that field. The documentation above the function probably needs adjustment. --- objects/screen.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/objects/screen.c b/objects/screen.c index cd20b169..8a66c627 100644 --- a/objects/screen.c +++ b/objects/screen.c @@ -869,6 +869,8 @@ luaA_screen_get_bounding_geometry(lua_State *L) screen_t *screen; struct wlr_box geo; int honor_workarea, honor_padding; + /* 0 = left, 1 = right, 2 = top, 3 = bottom */ + int margins[4] = { 0, 0, 0, 0 }; screen = luaA_checkscreen(L, 1); @@ -889,12 +891,44 @@ luaA_screen_get_bounding_geometry(lua_State *L) lua_getfield(L, 2, "honor_padding"); honor_padding = lua_toboolean(L, -1); lua_pop(L, 1); + + lua_getfield(L, 2, "margins"); + if (lua_istable(L, -1)) { + lua_getfield(L, -1, "left"); + margins[0] = lua_tointeger(L, -1); + lua_pop(L, 1); + + lua_getfield(L, -1, "right"); + margins[1] = lua_tointeger(L, -1); + lua_pop(L, 1); + + lua_getfield(L, -1, "top"); + margins[2] = lua_tointeger(L, -1); + lua_pop(L, 1); + + lua_getfield(L, -1, "bottom"); + margins[3] = lua_tointeger(L, -1); + lua_pop(L, 1); + } else if (lua_isnumber(L, -1)) { + margins[0] = lua_tointeger(L, -1); + margins[1] = lua_tointeger(L, -1); + margins[2] = lua_tointeger(L, -1); + margins[3] = lua_tointeger(L, -1); + lua_pop(L, 1); + } + lua_pop(L, 1); } /* Use workarea if requested, otherwise full geometry */ geo = honor_workarea ? screen->workarea : screen->geometry; - /* TODO: Apply honor_padding and margins if needed */ + /* Apply margins */ + geo.x += margins[0]; + geo.y += margins[3]; + geo.width -= (margins[0] + margins[1]); + geo.height -= (margins[2] + margins[3]); + + /* TODO: Apply honor_padding */ (void)honor_padding; lua_newtable(L);