aboutsummaryrefslogtreecommitdiffstats
path: root/window-xlib.c
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-04-12 18:24:47 -0400
committerJesse Luehrs <doy@tozt.net>2014-04-12 19:17:05 -0400
commitac972f2c2a080305d0c1a3dacd7fd72666e3d4b0 (patch)
treed8baa4282e99934cbde558c56e8fb0eae2fe719f /window-xlib.c
parent5b2b1de7b7f559287ed59cad757907efdf8fcb7d (diff)
downloadrunes-ac972f2c2a080305d0c1a3dacd7fd72666e3d4b0.tar.gz
runes-ac972f2c2a080305d0c1a3dacd7fd72666e3d4b0.zip
handle window resizing
Diffstat (limited to 'window-xlib.c')
-rw-r--r--window-xlib.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/window-xlib.c b/window-xlib.c
index 8023eb2..d89af2e 100644
--- a/window-xlib.c
+++ b/window-xlib.c
@@ -23,6 +23,8 @@ static void runes_window_backend_process_event(uv_work_t *req, int status);
static void runes_window_backend_map_window(RunesTerm *t);
static void runes_window_backend_init_wm_properties(
RunesTerm *t, int argc, char *argv[]);
+static void runes_window_backend_resize_window(
+ RunesTerm *t, int width, int height);
void runes_window_backend_init(RunesTerm *t)
{
@@ -208,6 +210,11 @@ static void runes_window_backend_process_event(uv_work_t *req, int status)
case Expose:
runes_window_backend_flush(t);
break;
+ case ConfigureNotify:
+ while (XCheckTypedWindowEvent(w->dpy, w->w, ConfigureNotify, e));
+ runes_window_backend_resize_window(
+ t, e->xconfigure.width, e->xconfigure.height);
+ break;
case ClientMessage: {
Atom a = e->xclient.data.l[0];
if (a == w->atoms[RUNES_ATOM_WM_DELETE_WINDOW]) {
@@ -287,3 +294,14 @@ static void runes_window_backend_init_wm_properties(
runes_window_backend_set_icon_name(t, "runes", 5);
runes_window_backend_set_window_title(t, "runes", 5);
}
+
+static void runes_window_backend_resize_window(
+ RunesTerm *t, int width, int height)
+{
+ if (width != t->xpixel || height != t->ypixel) {
+ cairo_xlib_surface_set_size(
+ cairo_get_target(t->backend_cr), width, height);
+ runes_display_set_window_size(t, width, height);
+ runes_pty_backend_set_window_size(t);
+ }
+}