fix redundant reflow on application start, might break on some x implementations

This commit is contained in:
hippoz 2022-10-15 22:54:54 +03:00
parent 748bd60194
commit 7cd8169622
Signed by: hippoz
GPG key ID: 7C52899193467641
2 changed files with 8 additions and 1 deletions

View file

@ -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))

View file

@ -22,6 +22,7 @@ public:
void start_batch();
void end_batch();
void swallow_batches();
Painter &painter() { return m_painter; }