From 217dceefaaefdab23731adb3a13efeaeff06d3f7 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 17 Mar 2000 10:46:59 +0000 Subject: [PATCH] Patch to RDB's blinking cursor: make it configurable and by default off. It's terribly distracting. git-svn-id: svn://svn.tartarus.org/sgt/putty@423 cda61777-01e9-0310-a592-d414129be87e --- putty.h | 1 + terminal.c | 6 ++++-- win_res.h | 1 + win_res.rc | 2 ++ windlg.c | 8 ++++++++ 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/putty.h b/putty.h index 3f2c0879..045c7da7 100644 --- a/putty.h +++ b/putty.h @@ -150,6 +150,7 @@ typedef struct { int alt_f4; /* is it special? */ int alt_space; /* is it special? */ int ldisc_term; + int blink_cur; /* Terminal options */ int savelines; int dec_om; diff --git a/terminal.c b/terminal.c index ccbe4449..1de4f3b6 100644 --- a/terminal.c +++ b/terminal.c @@ -1535,8 +1535,10 @@ static void do_paint (Context ctx, int may_optimise){ if (cursor_on) { if (has_focus) { - if (blinker) cursor = ATTR_ACTCURS; - else cursor = 0; + if (blinker || !cfg.blink_cur) + cursor = ATTR_ACTCURS; + else + cursor = 0; } else cursor = ATTR_PASCURS; diff --git a/win_res.h b/win_res.h index 70b1f204..8d4abf2f 100644 --- a/win_res.h +++ b/win_res.h @@ -64,6 +64,7 @@ #define IDC1_ALTF4 1017 #define IDC1_ALTSPACE 1018 #define IDC1_LDISCTERM 1019 +#define IDC1_BLINKCUR 1020 #define IDC2_WRAPMODE 1001 #define IDC2_DECOM 1002 diff --git a/win_res.rc b/win_res.rc index 2c955015..94f90e7a 100644 --- a/win_res.rc +++ b/win_res.rc @@ -125,6 +125,8 @@ BEGIN IDC1_ALTSPACE, 3, 123, 162, 10 AUTOCHECKBOX "&Use local terminal line discipline", IDC1_LDISCTERM, 3, 133, 162, 10 + AUTOCHECKBOX "&Blinking cursor", + IDC1_BLINKCUR, 3, 143, 162, 10 END IDD_PANEL2 DIALOG DISCARDABLE 6, 30, 168, 163 diff --git a/windlg.c b/windlg.c index 2e63f049..ad6ac337 100644 --- a/windlg.c +++ b/windlg.c @@ -162,6 +162,7 @@ static void save_settings (char *section, int do_host) { wppi (sesskey, "AltF4", cfg.alt_f4); wppi (sesskey, "AltSpace", cfg.alt_space); wppi (sesskey, "LdiscTerm", cfg.ldisc_term); + wppi (sesskey, "BlinkCur", cfg.blink_cur); wppi (sesskey, "ScrollbackLines", cfg.savelines); wppi (sesskey, "DECOriginMode", cfg.dec_om); wppi (sesskey, "AutoWrapMode", cfg.wrap_mode); @@ -296,6 +297,7 @@ static void load_settings (char *section, int do_host) { gppi (sesskey, "AltF4", 1, &cfg.alt_f4); gppi (sesskey, "AltSpace", 0, &cfg.alt_space); gppi (sesskey, "LdiscTerm", 0, &cfg.ldisc_term); + gppi (sesskey, "BlinkCur", 0, &cfg.blink_cur); gppi (sesskey, "ScrollbackLines", 200, &cfg.savelines); gppi (sesskey, "DECOriginMode", 0, &cfg.dec_om); gppi (sesskey, "AutoWrapMode", 1, &cfg.wrap_mode); @@ -648,6 +650,7 @@ static int CALLBACK KeyboardProc (HWND hwnd, UINT msg, CheckDlgButton (hwnd, IDC1_ALTF4, cfg.alt_f4); CheckDlgButton (hwnd, IDC1_ALTSPACE, cfg.alt_space); CheckDlgButton (hwnd, IDC1_LDISCTERM, cfg.ldisc_term); + CheckDlgButton (hwnd, IDC1_BLINKCUR, cfg.blink_cur); break; case WM_COMMAND: if (HIWORD(wParam) == BN_CLICKED || @@ -693,6 +696,11 @@ static int CALLBACK KeyboardProc (HWND hwnd, UINT msg, HIWORD(wParam) == BN_DOUBLECLICKED) cfg.ldisc_term = IsDlgButtonChecked (hwnd, IDC1_LDISCTERM); break; + case IDC1_BLINKCUR: + if (HIWORD(wParam) == BN_CLICKED || + HIWORD(wParam) == BN_DOUBLECLICKED) + cfg.blink_cur = IsDlgButtonChecked (hwnd, IDC1_BLINKCUR); + break; } } return GeneralPanelProc (hwnd, msg, wParam, lParam); -- 2.11.0