$OpenBSD: patch-interface_c,v 1.1 2008/06/09 22:54:38 martynas Exp $
--- interface.c.orig	Sun Feb 17 15:43:58 2008
+++ interface.c	Sat Jun  7 13:46:09 2008
@@ -31,6 +31,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <errno.h>
+#include <signal.h>
 
 #include "config.h"
 #include "main.h"
@@ -52,6 +53,8 @@ extern int use_colors;
 extern struct categories *first_category;
 extern int cursor_always_visible;
 
+static int resize_dirty = 0;
+
 struct feed *first_bak = NULL;	/* Backup first pointer for filter mode.
 								   Needs to be global so it can be used in the signal handler.
 								   Must be set to NULL by default and whenever it's not used anymore! */
@@ -63,6 +66,13 @@ struct scrolltext {
 	struct scrolltext * prev_ptr;
 };
 
+#ifdef SIGWINCH
+void sig_winch(int p)
+{
+	resize_dirty = 1;
+}
+#endif
+
 /* View newsitem in scrollable window.
  * Speed of this code has been greatly increased in 1.2.1.
  */
@@ -346,10 +356,14 @@ void UIDisplayItem (struct newsitem * current_item, st
 			if (linenumber+(LINES-7) < maxlines)
 				linenumber++;
 		}
-		if (uiinput == KEY_RESIZE) {
+		if (resize_dirty || uiinput == KEY_RESIZE) {
 			rewrap = 1;
 			/* Reset maxlines, otherwise the program will scroll to far down. */
 			maxlines = 0;
+
+			endwin();
+			refresh();
+			resize_dirty = 0;
 		}
 		if (uiinput == keybindings.about)
 			UIAbout();
@@ -792,6 +806,11 @@ int UIDisplayFeed (struct feed * current_feed) {
 				UIAbout();
 			if (uiinput == keybindings.feedinfo)
 				FeedInfo(current_feed);
+			if (resize_dirty || uiinput == KEY_RESIZE) {
+				endwin();
+				refresh();
+				resize_dirty = 0;
+			}
 			/* Redraw screen on ^L */
 			if (uiinput == 12)
 				forceredraw = 1;
@@ -1625,6 +1644,11 @@ void UIMainInterface (void) {
 					/* Reconstruct filter. */
 					filteractivated = 1;
 				}
+			}
+			if (resize_dirty || uiinput == KEY_RESIZE) {
+				endwin();
+				refresh();
+				resize_dirty = 0;
 			}
 			/* Redraw screen on ^L */
 			if (uiinput == 12)
