fix on desktop switch
Some checks failed
coding-style / check (push) Has been cancelled

This commit is contained in:
Arda Atci
2023-04-25 03:47:31 +03:00
parent fb99c9e472
commit e9834a5e35
5 changed files with 20 additions and 22 deletions

View File

@@ -292,7 +292,6 @@ typedef struct session {
/// Index of the next free slot in <code>expose_rects</code>.
int n_expose;
/// Current desktop of display
uint32_t prev_desktop;
uint32_t cur_desktop;
// === Window related ===

View File

@@ -458,10 +458,19 @@ static inline void ev_property_notify(session_t *ps, xcb_property_notify_event_t
1L, XCB_ATOM_CARDINAL, 32);
if (prop.nitems) {
ps->prev_desktop = ps->cur_desktop;
ps->cur_desktop = *prop.c32;
if (!ps->prev_desktop)
ps->prev_desktop = ps->cur_desktop;
if (ps->cur_desktop != *prop.c32) {
win_stack_foreach_managed_safe(w, &ps->window_stack) {
if (w->a.override_redirect) {
continue;
}
if (w->cur_desktop & *prop.c32) {
w->dwm_mask = ANIM_NEXT_TAG;
} else if (w->cur_desktop & ps->cur_desktop) {
w->dwm_mask = ANIM_PREV_TAG;
}
}
ps->cur_desktop = *prop.c32;
}
}
}

View File

@@ -1723,7 +1723,6 @@ static void draw_callback_impl(EV_P_ session_t *ps, int revents attr_unused) {
ps->fade_time = 0L;
}
if (!animation_running) {
ps->prev_desktop = ps->cur_desktop;
ps->animation_time = 0L;
}
@@ -1884,7 +1883,6 @@ static session_t *session_init(int argc, char **argv, Display *dpy,
.shadow_context = NULL,
.cur_desktop = 0,
.prev_desktop = 0,
#ifdef CONFIG_VSYNC_DRM
.drm_fd = -1,

View File

@@ -694,14 +694,6 @@ void win_process_update_flags(session_t *ps, struct managed_win *w) {
// w->dwm_mask = ANIM_PREV_TAG;
// else if (w->pending_g.y > 0 && w->g.y < 0 && abs(w->pending_g.y - w->g.y) >= w->pending_g.height)
// w->dwm_mask = ANIM_NEXT_TAG;
if (!w->a.override_redirect && ps->cur_desktop != ps->prev_desktop) {
if (w->cur_desktop == ps->cur_desktop) {
w->dwm_mask = ANIM_NEXT_TAG;
} else {
w->dwm_mask = ANIM_PREV_TAG;
}
}
if (!was_visible || w->dwm_mask) {

View File

@@ -171,8 +171,8 @@ struct managed_win {
/// opacity state, window geometry, window mapped/unmapped state,
/// window mode of the windows above. DOES NOT INCLUDE the body of THIS WINDOW.
/// NULL means reg_ignore has not been calculated for this window.
/// 1 = tag prev , 2 = tag next, 4 = unmap
uint32_t dwm_mask;
/// 1 = tag prev , 2 = tag next, 4 = unmap
uint32_t dwm_mask;
rc_region_t *reg_ignore;
/// Whether the reg_ignore of all windows beneath this window are valid
bool reg_ignore_valid;
@@ -203,11 +203,11 @@ struct managed_win {
/// Inverse of the window distance at the start of animation, for
/// tracking animation progress
double animation_inv_og_distance;
/// Animation info if it is a tag change & check if its changing window sizes
/// 0: no tag change
/// 1: normal tag change animation
/// 2: tag change animation that effects window size
uint16_t animation_is_tag;
/// Animation info if it is a tag change & check if its changing window sizes
/// 0: no tag change
/// 1: normal tag change animation
/// 2: tag change animation that effects window size
uint16_t animation_is_tag;
// Client window related members
/// ID of the top-level client window of the window.