Merge pull request #2227 from chrox/fix_2225_2226

revert 9ab005a changes to UIManager:sendEvent
pull/2233/head v2016.08.23-nightly
Frans de Jonge 8 years ago committed by GitHub
commit a55a987de4

@ -90,7 +90,7 @@ function Device:intoScreenSaver()
os.execute("killall -cont awesome") os.execute("killall -cont awesome")
end end
end end
UIManager:sendEvent(Event:new("FlushSettings")) UIManager:broadcastEvent(Event:new("FlushSettings"))
end end
-- ONLY used for Kindle devices -- ONLY used for Kindle devices
@ -121,7 +121,7 @@ function Device:onPowerEvent(ev)
local UIManager = require("ui/uimanager") local UIManager = require("ui/uimanager")
-- flushing settings first in case the screensaver takes too long time -- flushing settings first in case the screensaver takes too long time
-- that flushing has no chance to run -- that flushing has no chance to run
UIManager:sendEvent(Event:new("FlushSettings")) UIManager:broadcastEvent(Event:new("FlushSettings"))
DEBUG("Suspending...") DEBUG("Suspending...")
-- always suspend in portrait mode -- always suspend in portrait mode
self.orig_rotation_mode = self.screen:getRotationMode() self.orig_rotation_mode = self.screen:getRotationMode()

@ -402,7 +402,7 @@ function UIManager:sendEvent(event)
end end
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 -- access it. NOTE: _window_stack can shrink on close event
local checked_widgets = {top_widget} local checked_widgets = {top_widget}
for i = #self._window_stack, 1, -1 do for i = #self._window_stack, 1, -1 do
@ -416,13 +416,15 @@ function UIManager:sendEvent(event)
if active_widget:handleEvent(event) then return end if active_widget:handleEvent(event) then return end
end end
end end
-- ordinary widgets will handle this event if widget.widget.is_always_active then
-- active widgets will handle this event
-- Note: is_always_active widgets currently are vitualkeyboard and -- Note: is_always_active widgets currently are vitualkeyboard and
-- readerconfig -- readerconfig
checked_widgets[widget] = true checked_widgets[widget] = true
if widget.widget:handleEvent(event) then return end if widget.widget:handleEvent(event) then return end
end end
end end
end
end end
-- transmit an event to all registered widgets -- transmit an event to all registered widgets

Loading…
Cancel
Save