Skip to content

Commit

Permalink
Fix init timing
Browse files Browse the repository at this point in the history
  • Loading branch information
oniatsu committed Jun 15, 2023
1 parent 096f8ac commit ef51d39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion hotswitch-hs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 6 additions & 4 deletions lib/controller/MainController.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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

0 comments on commit ef51d39

Please sign in to comment.