win: put window into UNMAPPED state before mapping
Make sure before the mapping operation begins, the window is always in UNUNMAPPED state. This makes it easier to reason about things, such as resource availability, etc. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
@ -1623,11 +1623,17 @@ void map_win(session_t *ps, win *w) {
|
||||
|
||||
log_debug("Mapping (%#010x \"%s\")", w->id, w->name);
|
||||
|
||||
assert(w->state != WSTATE_DESTROYING);
|
||||
if (w->state != WSTATE_UNMAPPED && w->state != WSTATE_UNMAPPING) {
|
||||
log_warn("Mapping an already mapped window");
|
||||
return;
|
||||
}
|
||||
|
||||
if (w->state == WSTATE_UNMAPPING) {
|
||||
win_skip_fading(ps, &w);
|
||||
assert(w);
|
||||
}
|
||||
|
||||
// We stopped processing window size change when we were unmapped, refresh the
|
||||
// size of the window
|
||||
xcb_get_geometry_cookie_t gcookie = xcb_get_geometry(ps->c, w->id);
|
||||
|
Reference in New Issue
Block a user