aboutsummaryrefslogtreecommitdiffstats
path: root/window-xlib.c
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-04-12 20:28:39 -0400
committerJesse Luehrs <doy@tozt.net>2014-04-12 20:28:39 -0400
commit29cb0263d11cd90f991afbfe5d80dfa4212a69f5 (patch)
treeb983ed569c964acaab5492c7c356fa58b2505e2e /window-xlib.c
parent00996e01627cf984c5c441bfb95bd2f0c0fde085 (diff)
downloadrunes-29cb0263d11cd90f991afbfe5d80dfa4212a69f5.tar.gz
runes-29cb0263d11cd90f991afbfe5d80dfa4212a69f5.zip
don't allow the window to shrink below one pixel
it causes an error if you try that
Diffstat (limited to 'window-xlib.c')
-rw-r--r--window-xlib.c9
1 files changed, 9 insertions, 0 deletions
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);