aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'window.c')
-rw-r--r--window.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/window.c b/window.c
index d585c55..0ea3fba 100644
--- a/window.c
+++ b/window.c
@@ -211,19 +211,21 @@ void win_toggle_fullscreen(win_t *win) {
SubstructureNotifyMask, &ev);
}
-Pixmap win_create_pixmap(win_t *win) {
+Pixmap win_create_pixmap(win_t *win, int w, int h) {
if (!win)
return 0;
- return XCreatePixmap(win->env.dpy, win->xwin, THUMB_SIZE, THUMB_SIZE,
- win->env.depth);
+ return XCreatePixmap(win->env.dpy, win->xwin, w, h, win->env.depth);
}
-void win_draw_pixmap(win_t *win, Pixmap pm, int x, int y, int w, int h) {
- if (!win)
- return;
+void win_free_pixmap(win_t *win, Pixmap pm) {
+ if (win && pm)
+ XFreePixmap(win->env.dpy, pm);
+}
- XCopyArea(win->env.dpy, pm, win->pm, bgc, 0, 0, w, h, x, y);
+void win_draw_pixmap(win_t *win, Pixmap pm, int x, int y, int w, int h) {
+ if (win)
+ XCopyArea(win->env.dpy, pm, win->pm, bgc, 0, 0, w, h, x, y);
}
void win_clear(win_t *win) {