2
0
mirror of https://github.com/koreader/koreader synced 2024-11-18 03:25:46 +00:00

[fix, SDL] Remove useless Device call from exit (#9443)

Fixes #9439.
This commit is contained in:
Frans de Jonge 2022-08-17 09:19:25 +02:00 committed by GitHub
parent 939a64438a
commit f8e888c832
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -547,14 +547,9 @@ function Input:handleKeyBoardEv(ev)
-- quit on Alt + F4
-- this is also emitted by the close event in SDL
if self:isEvKeyPress(ev) and self.modifiers["Alt"] and keycode == "F4" then
local Device = require("frontend/device")
local UIManager = require("ui/uimanager")
local save_quit = function()
Device:saveSettings()
UIManager:quit()
end
UIManager:broadcastEvent(Event:new("Exit", save_quit))
UIManager:broadcastEvent(Event:new("Close")) -- Tell all widgets to close.
UIManager:nextTick(function() UIManager:quit() end) -- Ensure the program closes in case of some lingering dialog.
end
-- handle modifier keys