diff --git a/common/swindow.c b/common/swindow.c index 61fe9300a..cd0fa2675 100644 --- a/common/swindow.c +++ b/common/swindow.c @@ -48,6 +48,7 @@ simplewindow_new(Display *disp, int phys_screen, int x, int y, sw->geometry.width = w; sw->geometry.height = h; sw->display = disp; + sw->phys_screen = phys_screen; wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask | EnterWindowMask | LeaveWindowMask | StructureNotifyMask; @@ -107,6 +108,11 @@ simplewindow_resize(SimpleWindow *sw, unsigned int w, unsigned int h) { sw->geometry.width = w; sw->geometry.height = h; + XFreePixmap(sw->display, sw->drawable); + sw->drawable = XCreatePixmap(sw->display, + RootWindow(sw->display, sw->phys_screen), + w, h, + DefaultDepth(sw->display, sw->phys_screen)); return XResizeWindow(sw->display, sw->window, w, h); } diff --git a/common/swindow.h b/common/swindow.h index 8ed6564bc..f0dcc5d2e 100644 --- a/common/swindow.h +++ b/common/swindow.h @@ -28,6 +28,7 @@ typedef struct SimpleWindow { Display *display; + int phys_screen; Window window; Drawable drawable; area_t geometry;