aboutsummaryrefslogtreecommitdiffstats
path: root/window-xlib.c
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-04-10 22:02:11 -0400
committerJesse Luehrs <doy@tozt.net>2014-04-10 22:02:11 -0400
commit76581ac4a67ed1d440a9e9a34d65b04fa494888e (patch)
tree02a09516816e5c01312a0b023474f22ea0ae40e9 /window-xlib.c
parent91e64a89e379b8dbdc0252e4bd11627c0a5285a0 (diff)
downloadrunes-76581ac4a67ed1d440a9e9a34d65b04fa494888e.tar.gz
runes-76581ac4a67ed1d440a9e9a34d65b04fa494888e.zip
redraw the window when it's hidden and reshown
Diffstat (limited to 'window-xlib.c')
-rw-r--r--window-xlib.c9
1 files changed, 7 insertions, 2 deletions
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);
}