summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2009-06-20 10:41:11 +0000
committerFrederic Culot <calcurse@culot.org>2009-06-20 10:41:11 +0000
commit78c04955873fce8513ffc5e2318361f4fed0ea38 (patch)
treef1d65d8f8fef747dce61e7cbcbd74546a7549c3d
parent88594755503acb4e1526e64b848814025f45896e (diff)
downloadcalcurse-78c04955873fce8513ffc5e2318361f4fed0ea38.tar.gz
calcurse-78c04955873fce8513ffc5e2318361f4fed0ea38.zip
Bugfix: avoid a possible freeze under OpenBSD when changing color from within the configuration screen.
-rwxr-xr-xChangeLog8
-rwxr-xr-xsrc/custom.c15
2 files changed, 20 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 6af8407..26aa412 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-06-20 Frederic Culot <frederic@culot.org>
+
+ * src/custom.c (set_confwin_attr): new function
+
+ * src/custom.c: fix a bug that caused calcurse to freeze under
+ OpenBSD when changing theme color from within the configuration
+ screen
+
2009-06-01 Frederic Culot <frederic@culot.org>
* src/io.c: patch submitted by Francois Boulogne to fix gcc
diff --git a/src/custom.c b/src/custom.c
index b265881..4d41fca 100755
--- a/src/custom.c
+++ b/src/custom.c
@@ -1,4 +1,4 @@
-/* $calcurse: custom.c,v 1.37 2009/01/24 14:44:25 culot Exp $ */
+/* $calcurse: custom.c,v 1.38 2009/06/20 10:41:12 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -542,6 +542,14 @@ custom_layout_config (void)
#undef NBLAYOUTS
#undef LAYOUTSPERCOL
+static void
+set_confwin_attr (window_t *cwin)
+{
+ cwin->h = (notify_bar ())? row - 3 : row - 2;
+ cwin->w = col;
+ cwin->x = cwin->y = 0;
+}
+
/*
* Create a configuration window and initialize status and notification bar
* (useful in case of window resize).
@@ -557,8 +565,8 @@ custom_confwin_init (window_t *confwin, char *label)
}
wins_get_config ();
- confwin->h = (notify_bar ())? row - 3 : row - 2;
- confwin->p = newwin (confwin->h, col, 0, 0);
+ set_confwin_attr (confwin);
+ confwin->p = newwin (confwin->h, col, 0, 0);
box (confwin->p, 0, 0);
wins_show (confwin->p, label);
delwin (win[STA].p);
@@ -735,6 +743,7 @@ custom_color_config (void)
need_reset = 1;
theme_changed = 0;
conf_win.p = 0;
+ set_confwin_attr (&conf_win);
display_color_config (&conf_win, &mark_fore, &mark_back, cursor,
need_reset, theme_changed);