mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Merge pull request #2227 from chrox/fix_2225_2226
revert 9ab005a changes to UIManager:sendEvent
This commit is contained in:
@@ -90,7 +90,7 @@ function Device:intoScreenSaver()
|
||||
os.execute("killall -cont awesome")
|
||||
end
|
||||
end
|
||||
UIManager:sendEvent(Event:new("FlushSettings"))
|
||||
UIManager:broadcastEvent(Event:new("FlushSettings"))
|
||||
end
|
||||
|
||||
-- ONLY used for Kindle devices
|
||||
@@ -121,7 +121,7 @@ function Device:onPowerEvent(ev)
|
||||
local UIManager = require("ui/uimanager")
|
||||
-- flushing settings first in case the screensaver takes too long time
|
||||
-- that flushing has no chance to run
|
||||
UIManager:sendEvent(Event:new("FlushSettings"))
|
||||
UIManager:broadcastEvent(Event:new("FlushSettings"))
|
||||
DEBUG("Suspending...")
|
||||
-- always suspend in portrait mode
|
||||
self.orig_rotation_mode = self.screen:getRotationMode()
|
||||
|
||||
@@ -402,7 +402,7 @@ function UIManager:sendEvent(event)
|
||||
end
|
||||
end
|
||||
|
||||
-- if the event is not consumed, widgets (from top to bottom) can
|
||||
-- if the event is not consumed, active widgets (from top to bottom) can
|
||||
-- access it. NOTE: _window_stack can shrink on close event
|
||||
local checked_widgets = {top_widget}
|
||||
for i = #self._window_stack, 1, -1 do
|
||||
@@ -416,11 +416,13 @@ function UIManager:sendEvent(event)
|
||||
if active_widget:handleEvent(event) then return end
|
||||
end
|
||||
end
|
||||
-- ordinary widgets will handle this event
|
||||
-- Note: is_always_active widgets currently are vitualkeyboard and
|
||||
-- readerconfig
|
||||
checked_widgets[widget] = true
|
||||
if widget.widget:handleEvent(event) then return end
|
||||
if widget.widget.is_always_active then
|
||||
-- active widgets will handle this event
|
||||
-- Note: is_always_active widgets currently are vitualkeyboard and
|
||||
-- readerconfig
|
||||
checked_widgets[widget] = true
|
||||
if widget.widget:handleEvent(event) then return end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user