aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-04-30 02:29:38 -0400
committerJesse Luehrs <doy@tozt.net>2014-04-30 02:29:38 -0400
commit59be0a78dff68ee4a2fc29e33705fbc0c8b6c850 (patch)
tree77668df5741c8126ccbabf644625d6f22b65ebe4
parentc9385fa719d5997ffed17f60422928730bf1ece6 (diff)
downloadrunes-59be0a78dff68ee4a2fc29e33705fbc0c8b6c850.tar.gz
runes-59be0a78dff68ee4a2fc29e33705fbc0c8b6c850.zip
this is never used except by the backend
-rw-r--r--src/term.h1
-rw-r--r--src/window-xlib.c27
-rw-r--r--src/window-xlib.h2
3 files changed, 18 insertions, 12 deletions
diff --git a/src/term.h b/src/term.h
index 5a4f1ae..41f1456 100644
--- a/src/term.h
+++ b/src/term.h
@@ -8,7 +8,6 @@ struct runes_term {
RunesConfig config;
cairo_t *cr;
- cairo_t *backend_cr;
uv_loop_t *loop;
PangoLayout *layout;
diff --git a/src/window-xlib.c b/src/window-xlib.c
index 4904f9c..fc6f0f0 100644
--- a/src/window-xlib.c
+++ b/src/window-xlib.c
@@ -201,7 +201,7 @@ void runes_window_backend_create_window(RunesTerm *t, int argc, char *argv[])
vis = DefaultVisual(w->dpy, DefaultScreen(w->dpy));
surface = cairo_xlib_surface_create(
w->dpy, w->w, vis, normal_hints.base_width, normal_hints.base_height);
- t->backend_cr = cairo_create(surface);
+ w->backend_cr = cairo_create(surface);
cairo_surface_destroy(surface);
XMapWindow(w->dpy, w->w);
@@ -272,9 +272,10 @@ unsigned long runes_window_backend_get_window_id(RunesTerm *t)
void runes_window_backend_get_size(RunesTerm *t, int *xpixel, int *ypixel)
{
+ RunesWindowBackend *w = &t->w;
cairo_surface_t *surface;
- surface = cairo_get_target(t->backend_cr);
+ surface = cairo_get_target(w->backend_cr);
*xpixel = cairo_xlib_surface_get_width(surface);
*ypixel = cairo_xlib_surface_get_height(surface);
}
@@ -313,7 +314,7 @@ void runes_window_backend_cleanup(RunesTerm *t)
RunesWindowBackend *w = &t->w;
XIM im;
- cairo_destroy(t->backend_cr);
+ cairo_destroy(w->backend_cr);
im = XIMOfIC(w->ic);
XDestroyIC(w->ic);
XCloseIM(im);
@@ -401,6 +402,8 @@ static void runes_window_backend_process_event(uv_work_t *req, int status)
static void runes_window_backend_resize_window(
RunesTerm *t, int width, int height)
{
+ RunesWindowBackend *w = &t->w;
+
/* XXX no idea why shrinking the window dimensions to 0 makes xlib think
* that the dimension is 65535 */
if (width < 1 || width >= 65535) {
@@ -412,13 +415,15 @@ static void runes_window_backend_resize_window(
if (width != t->xpixel || height != t->ypixel) {
cairo_xlib_surface_set_size(
- cairo_get_target(t->backend_cr), width, height);
+ cairo_get_target(w->backend_cr), width, height);
runes_display_set_window_size(t);
}
}
static void runes_window_backend_flush(RunesTerm *t)
{
+ RunesWindowBackend *w = &t->w;
+
if (t->scr.audible_bell) {
runes_window_backend_audible_bell(t);
t->scr.audible_bell = 0;
@@ -445,10 +450,10 @@ static void runes_window_backend_flush(RunesTerm *t)
return;
}
- cairo_set_source_surface(t->backend_cr, cairo_get_target(t->cr), 0.0, 0.0);
- cairo_paint(t->backend_cr);
- runes_display_draw_cursor(t, t->backend_cr);
- cairo_surface_flush(cairo_get_target(t->backend_cr));
+ cairo_set_source_surface(w->backend_cr, cairo_get_target(t->cr), 0.0, 0.0);
+ cairo_paint(w->backend_cr);
+ runes_display_draw_cursor(t, w->backend_cr);
+ cairo_surface_flush(cairo_get_target(w->backend_cr));
}
static void runes_window_backend_visual_bell(RunesTerm *t)
@@ -462,9 +467,9 @@ static void runes_window_backend_visual_bell(RunesTerm *t)
uv_timer_t *timer_req;
t->visual_bell_is_ringing = 1;
- cairo_set_source(t->backend_cr, t->config.fgdefault);
- cairo_paint(t->backend_cr);
- cairo_surface_flush(cairo_get_target(t->backend_cr));
+ cairo_set_source(w->backend_cr, t->config.fgdefault);
+ cairo_paint(w->backend_cr);
+ cairo_surface_flush(cairo_get_target(w->backend_cr));
XFlush(w->dpy);
timer_req = malloc(sizeof(uv_timer_t));
diff --git a/src/window-xlib.h b/src/window-xlib.h
index f595982..123c12a 100644
--- a/src/window-xlib.h
+++ b/src/window-xlib.h
@@ -23,6 +23,8 @@ struct runes_window {
Window border_w;
XIC ic;
+ cairo_t *backend_cr;
+
Atom atoms[RUNES_NUM_ATOMS];
};