core: don't call map_win_start in handle_new_windows

Set WIN_FLAGS_MAPPED instead, it will be handled later. Previously, we
call map_win_start because we need the geometry of the window, which is
updated in map_win_start. Now, we get the geometry in fill_win, so
map_win_start is not needed anymore.

Eliminate a case where destroy_backend could see IMAGES_STALE flags set
on windows.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2020-11-28 22:48:01 +00:00
parent e49ef2ccd8
commit 60f733d17c
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
1 changed files with 1 additions and 4 deletions

View File

@ -1346,10 +1346,7 @@ static void handle_new_windows(session_t *ps) {
}
auto mw = (struct managed_win *)new_w;
if (mw->a.map_state == XCB_MAP_STATE_VIEWABLE) {
// Have to map immediately instead of queue window update
// because we need the window's extent right now.
// We can do this because we are in the critical section.
map_win_start(ps, mw);
win_set_flags(mw, WIN_FLAGS_MAPPED);
// This window might be damaged before we called fill_win
// and created the damage handle. And there is no way for