diff --git a/src/Window.cpp b/src/Window.cpp index 7dc1d65..2848599 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -142,11 +142,17 @@ void Window::end_batch() { m_invalidated_area = {0, 0, 0, 0}; } +void Window::swallow_batches() { + m_batches = 0; + m_did_relayout_during_batch = false; + m_invalidated_area = {0, 0, 0, 0}; +} + void Window::run(bool block) { XEvent e; bool is_loop_batch_started = false; - end_batch(); + swallow_batches(); for (;;) { if (block || XPending(m_x_display)) diff --git a/src/Window.hpp b/src/Window.hpp index 5976b1c..9ca6599 100644 --- a/src/Window.hpp +++ b/src/Window.hpp @@ -22,6 +22,7 @@ public: void start_batch(); void end_batch(); + void swallow_batches(); Painter &painter() { return m_painter; }