event: don't eagerly add damage for configure notify
If a window receives multiple configure notifies in between 2 frames, we add all the in between positions into damage, when we really just need the starting and the end position. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
14
src/win.c
14
src/win.c
@@ -400,6 +400,7 @@ static void win_update_properties(session_t *ps, struct managed_win *w) {
|
||||
win_clear_all_properties_stale(w);
|
||||
}
|
||||
|
||||
/// Handle non-image flags. This phase might set IMAGES_STALE flags
|
||||
void win_process_update_flags(session_t *ps, struct managed_win *w) {
|
||||
if (win_check_flags_all(w, WIN_FLAGS_MAPPED)) {
|
||||
map_win_start(ps, w);
|
||||
@@ -413,12 +414,19 @@ void win_process_update_flags(session_t *ps, struct managed_win *w) {
|
||||
win_clear_flags(w, WIN_FLAGS_CLIENT_STALE);
|
||||
}
|
||||
|
||||
bool damaged = false;
|
||||
if (win_check_flags_all(w, WIN_FLAGS_SIZE_STALE)) {
|
||||
win_on_win_size_change(ps, w);
|
||||
win_update_bounding_shape(ps, w);
|
||||
damaged = true;
|
||||
win_clear_flags(w, WIN_FLAGS_SIZE_STALE);
|
||||
}
|
||||
|
||||
if (win_check_flags_all(w, WIN_FLAGS_POSITION_STALE)) {
|
||||
damaged = true;
|
||||
win_clear_flags(w, WIN_FLAGS_POSITION_STALE);
|
||||
}
|
||||
|
||||
if (win_check_flags_all(w, WIN_FLAGS_PROPERTY_STALE)) {
|
||||
win_update_properties(ps, w);
|
||||
win_clear_flags(w, WIN_FLAGS_PROPERTY_STALE);
|
||||
@@ -429,6 +437,12 @@ void win_process_update_flags(session_t *ps, struct managed_win *w) {
|
||||
win_on_factor_change(ps, w);
|
||||
win_clear_flags(w, WIN_FLAGS_FACTOR_CHANGED);
|
||||
}
|
||||
|
||||
// Add damage, has to be done last so the window has the latest geometry
|
||||
// information.
|
||||
if (damaged) {
|
||||
add_damage_from_win(ps, w);
|
||||
}
|
||||
}
|
||||
|
||||
void win_process_image_flags(session_t *ps, struct managed_win *w) {
|
||||
|
||||
Reference in New Issue
Block a user