File tree 2 files changed +27
-0
lines changed
2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -1448,6 +1448,8 @@ static void unredirect(session_t *ps) {
1448
1448
/// keeps an internal queue of events, so we have to be 100% sure no events are
1449
1449
/// left in that queue before we go to sleep.
1450
1450
static void handle_x_events (struct session * ps ) {
1451
+ bool wm_was_consistent = wm_is_consistent (ps -> wm );
1452
+
1451
1453
if (ps -> vblank_scheduler ) {
1452
1454
vblank_handle_x_events (ps -> vblank_scheduler );
1453
1455
}
@@ -1478,6 +1480,12 @@ static void handle_x_events(struct session *ps) {
1478
1480
log_fatal ("X11 server connection broke (error %d)" , err );
1479
1481
exit (1 );
1480
1482
}
1483
+
1484
+ if (wm_is_consistent (ps -> wm ) != wm_was_consistent && !wm_was_consistent ) {
1485
+ log_debug ("Window tree has just become consistent, queueing redraw." );
1486
+ ps -> pending_updates = true;
1487
+ queue_redraw (ps );
1488
+ }
1481
1489
}
1482
1490
1483
1491
static void handle_x_events_ev (EV_P attr_unused , ev_prepare * w , int revents attr_unused ) {
Original file line number Diff line number Diff line change @@ -236,6 +236,22 @@ void wm_refresh_leaders(struct wm *wm) {
236
236
if (!wm -> needs_leader_refresh ) {
237
237
return ;
238
238
}
239
+ if (!wm_is_consistent (wm )) {
240
+ // The window tree has not been fully replicated, we might be missing
241
+ // windows, so we couldn't refresh the leaders here, but also can't leave
242
+ // them NULL. So we just set them to themselves.
243
+ log_debug ("Window tree is not consistent, setting all leaders to "
244
+ "themselves" );
245
+ list_foreach (struct wm_tree_node , i , & wm -> tree .root -> children , siblings ) {
246
+ if (i -> is_zombie ) {
247
+ // Don't change anything about a zombie window.
248
+ continue ;
249
+ }
250
+ i -> leader_final = i ;
251
+ }
252
+ return ;
253
+ }
254
+ log_debug ("Refreshing window leaders" );
239
255
wm -> needs_leader_refresh = false;
240
256
list_foreach (struct wm_tree_node , i , & wm -> tree .root -> children , siblings ) {
241
257
if (i -> is_zombie ) {
@@ -249,6 +265,9 @@ void wm_refresh_leaders(struct wm *wm) {
249
265
continue ;
250
266
}
251
267
wm_find_leader (wm , i );
268
+ BUG_ON_NULL (i -> leader_final );
269
+ log_verbose ("Window %#010x has leader %#010x" , i -> id .x ,
270
+ i -> leader_final -> id .x );
252
271
}
253
272
}
254
273
You can’t perform that action at this time.
0 commit comments