aboutsummaryrefslogtreecommitdiffstats
path: root/src/wins.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wins.c')
-rw-r--r--src/wins.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/wins.c b/src/wins.c
index 51d8072..46ac98e 100644
--- a/src/wins.c
+++ b/src/wins.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2017 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -63,7 +63,7 @@ static int layout;
/*
* The screen_mutex mutex and wins_refresh(), wins_wrefresh(), wins_doupdate()
* functions are used to prevent concurrent updates of the screen.
- * It was observed that the display could get screwed up when mulitple threads
+ * It was observed that the display could get screwed up when multiple threads
* tried to refresh the screen at the same time.
*
* Note (2010-03-21):
@@ -229,7 +229,7 @@ void wins_sbar_winc(void)
void wins_sbar_wdec(void)
{
- if (sbarwidth_perc > 0)
+ if (col * sbarwidth_perc / 100 > SBARMINWIDTH)
sbarwidth_perc--;
}
@@ -254,6 +254,15 @@ void wins_slctd_next(void)
slctd_win++;
}
+/* Shift-TAB key was hit in the interface, need to select previous window. */
+void wins_slctd_prev(void)
+{
+ if (slctd_win == CAL)
+ slctd_win = TOD;
+ else
+ slctd_win--;
+}
+
static void wins_init_panels(void)
{
wins_scrollwin_init(&sw_cal, win[CAL].y, win[CAL].x,
@@ -593,8 +602,6 @@ void wins_prepare_external(void)
{
if (notify_bar())
notify_stop_main_thread();
- if (conf.periodic_save > 0)
- io_stop_psave_thread();
def_prog_mode();
ui_mode = UI_CMDLINE;
clear();
@@ -615,8 +622,6 @@ void wins_unprepare_external(void)
wins_resize();
if (notify_bar())
notify_start_main_thread();
- if (conf.periodic_save > 0)
- io_start_psave_thread();
}
/*
@@ -628,8 +633,8 @@ void wins_launch_external(const char *arg[])
int pid;
wins_prepare_external();
- if ((pid = shell_exec(NULL, NULL, *arg, arg)))
- child_wait(NULL, NULL, pid);
+ if ((pid = shell_exec(NULL, NULL, NULL, 0, *arg, arg)))
+ child_wait(NULL, NULL, NULL, pid);
wins_unprepare_external();
}
@@ -655,6 +660,7 @@ void wins_update_bindings(void)
static int bindings_cal[] = {
KEY_GENERIC_HELP, KEY_GENERIC_QUIT, KEY_GENERIC_SAVE,
KEY_GENERIC_RELOAD, KEY_GENERIC_CHANGE_VIEW,
+ KEY_GENERIC_PREV_VIEW,
KEY_GENERIC_SCROLL_DOWN, KEY_GENERIC_SCROLL_UP, KEY_MOVE_UP,
KEY_MOVE_DOWN, KEY_MOVE_LEFT, KEY_MOVE_RIGHT, KEY_GENERIC_GOTO,
KEY_GENERIC_IMPORT, KEY_GENERIC_EXPORT, KEY_START_OF_WEEK,
@@ -670,6 +676,7 @@ void wins_update_bindings(void)
static int bindings_apoint[] = {
KEY_GENERIC_HELP, KEY_GENERIC_QUIT, KEY_GENERIC_SAVE,
KEY_GENERIC_RELOAD, KEY_GENERIC_CHANGE_VIEW,
+ KEY_GENERIC_PREV_VIEW,
KEY_GENERIC_IMPORT, KEY_GENERIC_EXPORT, KEY_ADD_ITEM,
KEY_DEL_ITEM, KEY_EDIT_ITEM, KEY_VIEW_ITEM, KEY_PIPE_ITEM,
KEY_GENERIC_REDRAW, KEY_REPEAT_ITEM, KEY_FLAG_ITEM,
@@ -686,6 +693,7 @@ void wins_update_bindings(void)
static int bindings_todo[] = {
KEY_GENERIC_HELP, KEY_GENERIC_QUIT, KEY_GENERIC_SAVE,
KEY_GENERIC_RELOAD, KEY_GENERIC_CHANGE_VIEW,
+ KEY_GENERIC_PREV_VIEW,
KEY_GENERIC_SCROLL_DOWN, KEY_GENERIC_SCROLL_UP,
KEY_GENERIC_IMPORT, KEY_GENERIC_EXPORT, KEY_ADD_ITEM,
KEY_DEL_ITEM, KEY_EDIT_ITEM, KEY_VIEW_ITEM, KEY_PIPE_ITEM,