From 00f32120a6c62069b66737a5265d9befa3ac59ac Mon Sep 17 00:00:00 2001 From: Bert Date: Thu, 20 Jan 2011 15:39:08 +0100 Subject: Handle expose events --- main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index e0433d8..cd68350 100644 --- a/main.c +++ b/main.c @@ -69,7 +69,7 @@ int main(int argc, char **argv) { imlib_init(&win); img_load(&img, options->filenames[fileidx]); - img_render(&img, &win); + img_display(&img, &win); run(); @@ -113,4 +113,9 @@ void on_configurenotify(XEvent *ev) { } void on_expose(XEvent *ev) { + if (!ev) + return; + + img_render(&img, &win, ev->xexpose.x, ev->xexpose.y, + ev->xexpose.width, ev->xexpose.height); } -- cgit v1.2.3-54-g00ecf