mirror of
https://github.com/yshui/picom.git
synced 2025-04-21 18:03:02 -04:00
core: queue update and redraw when wm tree becomes consistent
When the wm tree is not consistent, there might be certain updates we can't do (e.g. refreshing window leaders). So once the wm tree becomes consistent we should retry. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
61361ad319
commit
0d7b254fd9
1 changed files with 8 additions and 0 deletions
|
@ -1448,6 +1448,8 @@ static void unredirect(session_t *ps) {
|
|||
/// keeps an internal queue of events, so we have to be 100% sure no events are
|
||||
/// left in that queue before we go to sleep.
|
||||
static void handle_x_events(struct session *ps) {
|
||||
bool wm_was_consistent = wm_is_consistent(ps->wm);
|
||||
|
||||
if (ps->vblank_scheduler) {
|
||||
vblank_handle_x_events(ps->vblank_scheduler);
|
||||
}
|
||||
|
@ -1478,6 +1480,12 @@ static void handle_x_events(struct session *ps) {
|
|||
log_fatal("X11 server connection broke (error %d)", err);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (wm_is_consistent(ps->wm) != wm_was_consistent && !wm_was_consistent) {
|
||||
log_debug("Window tree has just become consistent, queueing redraw.");
|
||||
ps->pending_updates = true;
|
||||
queue_redraw(ps);
|
||||
}
|
||||
}
|
||||
|
||||
static void handle_x_events_ev(EV_P attr_unused, ev_prepare *w, int revents attr_unused) {
|
||||
|
|
Loading…
Add table
Reference in a new issue