diff options
author | Bert Münnich <ber.t@posteo.de> | 2014-07-28 20:36:32 +0200 |
---|---|---|
committer | Bert Münnich <ber.t@posteo.de> | 2014-07-28 20:36:32 +0200 |
commit | bb6721549b30c33b0080975aa19a0b02a916c7e5 (patch) | |
tree | 5836842e5120d9dcdeee1e0efaf94c34d35a04e2 /thumbs.c | |
parent | 5e481912ec983be89f10cbbb21561ed7cc898027 (diff) |
Overhauled window drawing, yet again; fixes issue #155
- Buffer for window content is bigger than the window, minimizes artifacts
when window is resized
- Back to using XSetWindowBackgroundPixmap() instead of XCopyArea(),
no need to handle exposure events; X server can show gray background directly
after resize event before sxiv redraws the window contents
Diffstat (limited to 'thumbs.c')
-rw-r--r-- | thumbs.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -370,7 +370,7 @@ void tns_render(tns_t *tns) win = tns->win; win_clear(win); - imlib_context_set_drawable(win->pm); + imlib_context_set_drawable(win->buf.pm); tns->cols = MAX(1, win->w / thumb_dim); tns->rows = MAX(1, win->h / thumb_dim); @@ -429,14 +429,14 @@ void tns_mark(tns_t *tns, int n, bool mark) else col = win->bgcol; - win_draw_rect(win, win->pm, x - 4, y - 4, 8, 2, true, 0, col); - win_draw_rect(win, win->pm, x - 4, y - 4, 2, 8, true, 0, col); - win_draw_rect(win, win->pm, x + w - 4, y - 4, 8, 2, true, 0, col); - win_draw_rect(win, win->pm, x + w + 2, y - 4, 2, 8, true, 0, col); - win_draw_rect(win, win->pm, x - 4, y + h + 2, 8, 2, true, 0, col); - win_draw_rect(win, win->pm, x - 4, y + h - 4, 2, 8, true, 0, col); - win_draw_rect(win, win->pm, x + w - 4, y + h + 2, 8, 2, true, 0, col); - win_draw_rect(win, win->pm, x + w + 2, y + h - 4, 2, 8, true, 0, col); + win_draw_rect(win, win->buf.pm, x - 4, y - 4, 8, 2, true, 0, col); + win_draw_rect(win, win->buf.pm, x - 4, y - 4, 2, 8, true, 0, col); + win_draw_rect(win, win->buf.pm, x + w - 4, y - 4, 8, 2, true, 0, col); + win_draw_rect(win, win->buf.pm, x + w + 2, y - 4, 2, 8, true, 0, col); + win_draw_rect(win, win->buf.pm, x - 4, y + h + 2, 8, 2, true, 0, col); + win_draw_rect(win, win->buf.pm, x - 4, y + h - 4, 2, 8, true, 0, col); + win_draw_rect(win, win->buf.pm, x + w - 4, y + h + 2, 8, 2, true, 0, col); + win_draw_rect(win, win->buf.pm, x + w + 2, y + h - 4, 2, 8, true, 0, col); } } @@ -457,7 +457,7 @@ void tns_highlight(tns_t *tns, int n, bool hl) else col = win->bgcol; - win_draw_rect(win, win->pm, t->x - 3, t->y - 3, t->w + 6, t->h + 6, + win_draw_rect(win, win->buf.pm, t->x - 3, t->y - 3, t->w + 6, t->h + 6, false, 2, col); if (!hl && t->file->marked) |