From 26c2179be7676df3049035e5e65039c7fc232cb7 Mon Sep 17 00:00:00 2001 From: Bert Date: Wed, 16 Feb 2011 21:40:20 +0100 Subject: Refactored thumbs, new files thumbs.[ch] --- window.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'window.c') 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) { -- cgit v1.2.3