From ef51d39a47a78dacd50053fba75fb43234105e33 Mon Sep 17 00:00:00 2001 From: oniatsu <5919569+oniatsu@users.noreply.github.com> Date: Thu, 15 Jun 2023 19:25:36 +0900 Subject: [PATCH] Fix init timing --- hotswitch-hs.lua | 1 - lib/controller/MainController.lua | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hotswitch-hs.lua b/hotswitch-hs.lua index 8503c9c..68476b7 100644 --- a/hotswitch-hs.lua +++ b/hotswitch-hs.lua @@ -3,7 +3,6 @@ local MainController = require("hotswitch-hs/lib/controller/MainController") local PreferenceModel = require("hotswitch-hs/lib/model/PreferenceModel") local mainController = MainController.new() -mainController:setLogLevel("nothing") return { openOrClose = function() mainController:openOrClose() end, diff --git a/lib/controller/MainController.lua b/lib/controller/MainController.lua index 5cac8c5..f765f9a 100644 --- a/lib/controller/MainController.lua +++ b/lib/controller/MainController.lua @@ -25,10 +25,6 @@ MainController.new = function() obj.hotkeyController = HotkeyController.new(obj) - obj.hotkeyController:createHotkeys() - obj.keyStatusModel:resetAutoGeneratedKeys() - obj.windowModel:init() - obj.panelLayoutView:setClickCallback(function(position) obj.windowModel.focusWindow(obj.windowModel:getCachedOrderedWindowsOrFetch()[position]) obj:finish() @@ -110,6 +106,12 @@ MainController.new = function() Debugger.setLogLevel(logLevel) end + --- init + obj:setLogLevel("nothing") + obj.hotkeyController:createHotkeys() + obj.keyStatusModel:resetAutoGeneratedKeys() + obj.windowModel:init() + return obj end return MainController