aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert Münnich <ber.t@gmx.com>2012-10-29 23:23:50 +0100
committerBert Münnich <ber.t@gmx.com>2012-10-29 23:23:50 +0100
commit22a8b665716edab993ce09008d0fb541498d633b (patch)
treee25921f0458ac7803f1248d6d9259719fb482dbd
parent4a5d5d26aa8c66ef9c4e64cc355c63888b04d4e3 (diff)
Fixed BadDrawable errors caused by invalid window pixmap
-rw-r--r--window.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/window.c b/window.c
index 71a7915..b9970a6 100644
--- a/window.c
+++ b/window.c
@@ -267,12 +267,11 @@ bool win_configure(win_t *win, XConfigureEvent *c) {
}
void win_expose(win_t *win, XExposeEvent *e) {
- if (win == NULL || win->xwin == None || e == NULL)
+ if (win == NULL || win->xwin == None || win->pm == None || e == NULL)
return;
- if (win->pm != None)
- XCopyArea(win->env.dpy, win->pm, win->xwin, gc,
- e->x, e->y, e->width, e->height, e->x, e->y);
+ XCopyArea(win->env.dpy, win->pm, win->xwin, gc,
+ e->x, e->y, e->width, e->height, e->x, e->y);
}
bool win_moveresize(win_t *win, int x, int y, unsigned int w, unsigned int h) {
@@ -359,7 +358,7 @@ void win_draw_bar(win_t *win) {
int len, x, y, w, tw = 0, seplen;
const char *rt;
- if (win == NULL || win->xwin == None)
+ if (win == NULL || win->xwin == None || win->pm == None)
return;
e = &win->env;
@@ -407,7 +406,7 @@ void win_draw_bar(win_t *win) {
}
void win_draw(win_t *win) {
- if (win == NULL || win->xwin == None)
+ if (win == NULL || win->xwin == None || win->pm == None)
return;
if (win->barh > 0)