From ebea1dc3c0b29ac5b4aa9f2f51cc70ff43191377 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 8 Nov 2023 19:55:23 +0100 Subject: window_layout: Add debug log After changing machines, I was having a problem with window layout restoration. I had added this debug log, but then it magically started working again. Committing this change anyway, maybe it actually did something. --- window_layout.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/window_layout.lua b/window_layout.lua index e32f37e..c97eb08 100644 --- a/window_layout.lua +++ b/window_layout.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2019 Teddy Wing +-- Copyright (c) 2019, 2022 Teddy Wing -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -13,17 +13,20 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . +window_layout_logger = hs.logger.new('window_layout', 'debug') + all_window_filter = hs.window.filter.new():setOverrideFilter({ visible = true }) window_positions = {} setmetatable(window_positions, {__index = function() return {} end}) -local function window_positions_save(window, _app_name, event_type) +function window_positions_save(window, _app_name, event_type) local screen = hs.screen.primaryScreen():id() if event_type == hs.window.filter.windowsChanged then window_positions[screen] = {} + window_layout_logger:d(hs.inspect(all_window_filter:getWindows())) for _, window in ipairs(all_window_filter:getWindows()) do window_positions[screen][window:id()] = window:frame() end -- cgit v1.2.3