summaryrefslogtreecommitdiff
path: root/osd.lua
diff options
context:
space:
mode:
Diffstat (limited to 'osd.lua')
-rw-r--r--osd.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/osd.lua b/osd.lua
index 31cc49c..e638ee8 100644
--- a/osd.lua
+++ b/osd.lua
@@ -54,6 +54,16 @@ function osd.new(init)
return t
end
+function mt:dirty()
+ self.is_dirty = true
+end
+
+function mt:flush(state)
+ if self.is_dirty then
+ self:redraw(state)
+ end
+end
+
function mt:resize(w, h)
self.width = w
self.height = h
@@ -63,6 +73,7 @@ end
function mt:set_status(msg, level)
self.status_msg = msg
self.status_level = level
+ self:dirty()
end
function mt:status_line()
@@ -466,6 +477,8 @@ function mt:redraw(state)
else
self:clear_img(true)
end
+
+ self.is_dirty = false
end
function mt:toggle_hidden()