@@ -201,58 +201,55 @@ static void configure_win(session_t *ps, xcb_configure_notify_event_t *ce) {
201
201
202
202
automw = (struct managed_win * )w ;
203
203
204
- if (mw -> state == WSTATE_UNMAPPED || mw -> state == WSTATE_UNMAPPING ||
205
- mw -> state == WSTATE_DESTROYING ) {
206
- // Only restack the window to make sure we can handle future restack
207
- // notification correctly
208
- restack_above (ps ,w ,ce -> above_sibling );
209
- }else {
210
- restack_above (ps ,w ,ce -> above_sibling );
211
-
212
- // If window geometry change, free old extents
213
- if (mw -> g .x != ce -> x || mw -> g .y != ce -> y || mw -> g .width != ce -> width ||
214
- mw -> g .height != ce -> height || mw -> g .border_width != ce -> border_width ) {
215
- // We don't mark the old region as damaged if we have stale
216
- // shape/size/position information. The old region should have
217
- // already been add to damage when the information became stale.
218
- if (!win_check_flags_any (
219
- mw ,WIN_FLAGS_SIZE_STALE |WIN_FLAGS_POSITION_STALE )) {
220
- // Mark the old extents as damaged.
221
- // The new extents will be marked damaged when processing
222
- // window flags.
204
+ restack_above (ps ,w ,ce -> above_sibling );
205
+
206
+ // If window geometry change, free old extents
207
+ if (mw -> g .x != ce -> x || mw -> g .y != ce -> y || mw -> g .width != ce -> width ||
208
+ mw -> g .height != ce -> height || mw -> g .border_width != ce -> border_width ) {
209
+ // We don't mark the old region as damaged if we have stale
210
+ // shape/size/position information. The old region should have
211
+ // already been add to damage when the information became stale.
212
+ if (!win_check_flags_any (mw ,WIN_FLAGS_SIZE_STALE |WIN_FLAGS_POSITION_STALE )) {
213
+ if (mw -> state != WSTATE_UNMAPPED && mw -> state != WSTATE_UNMAPPING &&
214
+ mw -> state != WSTATE_DESTROYING ) {
215
+ // Mark the old extents as damaged. The new extents will
216
+ // be marked damaged when processing window flags.
217
+ // If the window is not mapped, we don't care
223
218
region_t damage ;
224
219
pixman_region32_init (& damage );
225
220
win_extents (mw ,& damage );
226
221
add_damage (ps ,& damage );
227
222
pixman_region32_fini (& damage );
228
223
}
224
+ }
229
225
230
- // Queue pending updates
231
- win_set_flags (mw ,WIN_FLAGS_FACTOR_CHANGED );
232
- ps -> pending_updates = true;
233
-
234
- // At least one of the following if's is true
235
- if (mw -> g .x != ce -> x || mw -> g .y != ce -> y ) {
236
- log_trace ("Window position changed, %dx%d -> %dx%d" ,
237
- mw -> g .x ,mw -> g .y ,ce -> x ,ce -> y );
238
- mw -> g .x = ce -> x ;
239
- mw -> g .y = ce -> y ;
240
- win_set_flags (mw ,WIN_FLAGS_POSITION_STALE );
241
- }
226
+ // Queue pending updates
227
+ win_set_flags (mw ,WIN_FLAGS_FACTOR_CHANGED );
228
+ // TODO(yshui) don't set pending_updates if the window is not
229
+ // visible/mapped
230
+ ps -> pending_updates = true;
242
231
243
- if (mw -> g .width != ce -> width || mw -> g .height != ce -> height ||
244
- mw -> g .border_width != ce -> border_width ) {
245
- log_trace ("Window size changed, %dx%d -> %dx%d" ,
246
- mw -> g .width ,mw -> g .height ,ce -> width ,ce -> height );
247
- mw -> g .width = ce -> width ;
248
- mw -> g .height = ce -> height ;
249
- mw -> g .border_width = ce -> border_width ;
250
- win_set_flags (mw ,WIN_FLAGS_SIZE_STALE );
251
- }
232
+ // At least one of the following if's is true
233
+ if (mw -> g .x != ce -> x || mw -> g .y != ce -> y ) {
234
+ log_trace ("Window position changed, %dx%d -> %dx%d" ,mw -> g .x ,
235
+ mw -> g .y ,ce -> x ,ce -> y );
236
+ mw -> g .x = ce -> x ;
237
+ mw -> g .y = ce -> y ;
238
+ win_set_flags (mw ,WIN_FLAGS_POSITION_STALE );
239
+ }
252
240
253
- // Recalculate which screen this window is on
254
- win_update_screen (ps -> xinerama_nscrs ,ps -> xinerama_scr_regs ,mw );
241
+ if (mw -> g .width != ce -> width || mw -> g .height != ce -> height ||
242
+ mw -> g .border_width != ce -> border_width ) {
243
+ log_trace ("Window size changed, %dx%d -> %dx%d" ,mw -> g .width ,
244
+ mw -> g .height ,ce -> width ,ce -> height );
245
+ mw -> g .width = ce -> width ;
246
+ mw -> g .height = ce -> height ;
247
+ mw -> g .border_width = ce -> border_width ;
248
+ win_set_flags (mw ,WIN_FLAGS_SIZE_STALE );
255
249
}
250
+
251
+ // Recalculate which screen this window is on
252
+ win_update_screen (ps -> xinerama_nscrs ,ps -> xinerama_scr_regs ,mw );
256
253
}
257
254
258
255
// override_redirect flag cannot be changed after window creation, as far