Skip to content

Commit

Permalink
Remember, if ConfigureNotify also contained resize-events.
Browse files Browse the repository at this point in the history
Otherwise, during fast move- and resize events, a resize may be missed
leading to usage of a stale pixmap. See also issue #11.
  • Loading branch information
tycho-kirchner committed Nov 8, 2024
1 parent 7a9d143 commit 92ec779
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions fastcompmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ typedef struct _win {
unsigned int bottom_width;

Bool need_configure;
bool configure_size_changed;
XConfigureEvent queue_configure;

/* for drawing translucent windows */
Expand Down Expand Up @@ -1769,7 +1770,7 @@ do_configure_win(Display *dpy, win* w){
w->need_configure = False;
w->a.x = ce->x;
w->a.y = ce->y;
if (w->a.width != ce->width || w->a.height != ce->height) {
if (w->configure_size_changed) {

#if HAS_NAME_WINDOW_PIXMAP
if (w->pixmap) {
Expand Down Expand Up @@ -1806,6 +1807,7 @@ do_configure_win(Display *dpy, win* w){

clip_changed = True;
w->a.override_redirect = ce->override_redirect;
w->configure_size_changed = false;
set_paint_ignore_region_dirty();
}

Expand All @@ -1826,9 +1828,15 @@ handle_ConfigureNotify(Display *dpy, XConfigureEvent *ce) {
}
return;
}
// save the configure event for later
// save the configure event for later. While on the one hand, we're only
// interested in the final position and size (after timeout), a change in size
// invalidates the pixmap, so remember any resize event.
g_configure_needed = True;
w->need_configure = True;
if (w->a.width != ce->width || w->a.height != ce->height) {
w->configure_size_changed = true;
}

w->queue_configure = *ce;

// w->a.override_redirect = ce->override_redirect;
Expand Down

0 comments on commit 92ec779

Please sign in to comment.