From 29cb0263d11cd90f991afbfe5d80dfa4212a69f5 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 12 Apr 2014 20:28:39 -0400 Subject: don't allow the window to shrink below one pixel it causes an error if you try that --- window-xlib.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'window-xlib.c') diff --git a/window-xlib.c b/window-xlib.c index 8320d13..76f97bf 100644 --- a/window-xlib.c +++ b/window-xlib.c @@ -312,6 +312,15 @@ static void runes_window_backend_init_wm_properties( static void runes_window_backend_resize_window( RunesTerm *t, int width, int height) { + /* XXX no idea why shrinking the window dimensions to 0 makes xlib think + * that the dimension is 65535 */ + if (width < 1 || width >= 65535) { + width = 1; + } + if (height < 1 || height >= 65535) { + height = 1; + } + if (width != t->xpixel || height != t->ypixel) { cairo_xlib_surface_set_size( cairo_get_target(t->backend_cr), width, height); -- cgit v1.2.3-54-g00ecf