]> git.mdlowis.com Git - projs/tide.git/commitdiff
prevent the window from updating when there's too little space to do so
authorMichael D. Lowis <mike@mdlowis.com>
Thu, 17 Nov 2016 00:00:20 +0000 (19:00 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Thu, 17 Nov 2016 00:00:20 +0000 (19:00 -0500)
xedit
xedit.c

diff --git a/xedit b/xedit
index 46924c41024c39b133995066cc9dedf9bdc55d5c..e660043f2f6b923bb845f830daa46802c0ee1dc6 100755 (executable)
Binary files a/xedit and b/xedit differ
diff --git a/xedit.c b/xedit.c
index b2c2a830c05b40fb548df4e4789b0fc24ddb5548..da0f2ea6904ec452c325b707af1674ccb8d68427 100644 (file)
--- a/xedit.c
+++ b/xedit.c
@@ -313,6 +313,9 @@ static void layout(int width, int height) {
 static void redraw(int width, int height) {
     size_t fheight = x11_font_height(Font);
     size_t fwidth  = x11_font_width(Font);
+    /* if the window is too small, don't bother updating. */
+    if (width < fwidth || height < (4 * fheight))
+        return;
     layout(width, height);
     x11_draw_rect(CLR_BASE03, 0, 0, width, height);
     x11_draw_rect(CLR_BASE02, (79 * fwidth) + 2, Regions[EDIT].y-2, fwidth, height - Regions[EDIT].y + 2);