|
|
|
@ -1045,6 +1045,16 @@ function UIManager:_repaint()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- Show IDs of covered widgets when debugging
|
|
|
|
|
--[[
|
|
|
|
|
if start_idx > 1 then
|
|
|
|
|
for i = 1, start_idx-1 do
|
|
|
|
|
local widget = self._window_stack[i]
|
|
|
|
|
logger.dbg("NOT painting widget:", widget.widget.name or widget.widget.id or tostring(widget))
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
--]]
|
|
|
|
|
|
|
|
|
|
for i = start_idx, #self._window_stack do
|
|
|
|
|
local widget = self._window_stack[i]
|
|
|
|
|
-- paint if current widget or any widget underneath is dirty
|
|
|
|
@ -1141,6 +1151,43 @@ function UIManager:widgetRepaint(widget, x, y)
|
|
|
|
|
widget:paintTo(Screen.bb, x, y)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- Now, this one is basically widgetRepaint, but tailored for a very,
|
|
|
|
|
-- very specific use-case related to ReaderFooter:setupAutoRefreshTime
|
|
|
|
|
-- (c.f., #6648)
|
|
|
|
|
function UIManager:repaintReaderFooter(readerfooter_widget)
|
|
|
|
|
if not readerfooter_widget then return false end
|
|
|
|
|
|
|
|
|
|
-- Don't repaint if there's another widget than ReaderUI flagged as covers_fullscreen being shown,
|
|
|
|
|
-- or if a non-fullscreen widget is flagged as covers_footer.
|
|
|
|
|
-- This isn't particularly pretty, but, oh, well (#6616).
|
|
|
|
|
local skip_repaint = false
|
|
|
|
|
-- c.f., UIManager:_repaint
|
|
|
|
|
for i = #self._window_stack, 1, -1 do
|
|
|
|
|
local widget = self._window_stack[i].widget
|
|
|
|
|
if widget.covers_fullscreen then
|
|
|
|
|
if widget.name and widget.name == "ReaderUI" then -- luacheck: ignore
|
|
|
|
|
-- NOP (i.e., continue)
|
|
|
|
|
else
|
|
|
|
|
skip_repaint = true
|
|
|
|
|
logger.dbg("Skipping ReaderFooter repaint, because something covers ReaderUI")
|
|
|
|
|
break
|
|
|
|
|
end
|
|
|
|
|
elseif widget.covers_footer then
|
|
|
|
|
skip_repaint = true
|
|
|
|
|
logger.dbg("Skipping ReaderFooter repaint, because something covers ReaderFooter")
|
|
|
|
|
break
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if skip_repaint then return false end
|
|
|
|
|
|
|
|
|
|
logger.dbg("Explicit ReaderFooter repaint:", readerfooter_widget.name or readerfooter_widget.id or tostring(readerfooter_widget))
|
|
|
|
|
-- c.f., ReaderView:paintTo()
|
|
|
|
|
readerfooter_widget:paintTo(Screen.bb, 0, 0)
|
|
|
|
|
|
|
|
|
|
-- Inform the caller that we did, in fact, repaint it.
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function UIManager:setInputTimeout(timeout)
|
|
|
|
|
self.INPUT_TIMEOUT = timeout or 200*1000
|
|
|
|
|
end
|
|
|
|
@ -1178,6 +1225,8 @@ function UIManager:handleInput()
|
|
|
|
|
repeat
|
|
|
|
|
wait_until, now = self:_checkTasks()
|
|
|
|
|
--dbg("---------------------------------------------------")
|
|
|
|
|
--dbg("wait_until", wait_until)
|
|
|
|
|
--dbg("now", now)
|
|
|
|
|
--dbg("exec stack", self._task_queue)
|
|
|
|
|
--dbg("window stack", self._window_stack)
|
|
|
|
|
--dbg("dirty stack", self._dirty)
|
|
|
|
|