From 76581ac4a67ed1d440a9e9a34d65b04fa494888e Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 10 Apr 2014 22:02:11 -0400 Subject: redraw the window when it's hidden and reshown --- window-xlib.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'window-xlib.c') diff --git a/window-xlib.c b/window-xlib.c index 7360dde..17351ed 100644 --- a/window-xlib.c +++ b/window-xlib.c @@ -66,6 +66,9 @@ static void runes_process_event(uv_work_t *req, int status) free(buf); break; } + case Expose: + runes_window_backend_flush(t); + break; case ClientMessage: { Atom a = e->xclient.data.l[0]; if (a == w->atoms[RUNES_ATOM_WM_DELETE_WINDOW]) { @@ -130,7 +133,7 @@ static void runes_window_init_loop(RunesTerm *t) w = &t->w; XGetICValues(w->ic, XNFilterEvents, &mask, NULL); - XSelectInput(w->dpy, w->w, mask|KeyPressMask|StructureNotifyMask); + XSelectInput(w->dpy, w->w, mask|KeyPressMask|StructureNotifyMask|ExposureMask); XSetICFocus(w->ic); data = malloc(sizeof(RunesXlibLoopData)); @@ -201,6 +204,8 @@ cairo_surface_t *runes_window_backend_surface_create(RunesTerm *t) void runes_window_backend_flush(RunesTerm *t) { + cairo_set_source_surface(t->backend_cr, cairo_get_target(t->cr), 0.0, 0.0); + cairo_paint(t->backend_cr); XFlush(t->w.dpy); } @@ -208,7 +213,7 @@ void runes_window_backend_get_size(RunesTerm *t, int *xpixel, int *ypixel) { cairo_surface_t *surface; - surface = cairo_get_target(t->cr); + surface = cairo_get_target(t->backend_cr); *xpixel = cairo_xlib_surface_get_width(surface); *ypixel = cairo_xlib_surface_get_height(surface); } -- cgit v1.2.3-54-g00ecf