From a3ae06fdbb142e4a7e3a9d304eca65181e4cd067 Mon Sep 17 00:00:00 2001 From: Cyd <34154246+cyd01@users.noreply.github.com> Date: Thu, 9 Apr 2020 10:31:09 +0200 Subject: [PATCH] Trying to fix #152 with @systemmonkey42 solution --- 0.73_My_PuTTY/windows/window.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/0.73_My_PuTTY/windows/window.c b/0.73_My_PuTTY/windows/window.c index e6a0ed8..deee3ee 100644 --- a/0.73_My_PuTTY/windows/window.c +++ b/0.73_My_PuTTY/windows/window.c @@ -5211,18 +5211,20 @@ else if((UINT_PTR)wParam == TIMER_LOGROTATION) { // log rotation #ifdef MOD_PERSO if( (wParam == VK_TAB) && (GetKeyState(VK_CONTROL) & 0x8000) ) { // CTRL + TAB to switch between windows - if( (message==WM_KEYUP) && conf_get_int(conf, CONF_ctrl_tab_switch) && GetCtrlTabFlag() ) { - struct ctrl_tab_info info = { (GetKeyState(VK_SHIFT) & 0x8000) ? 1 : -1, hwnd, } ; + if (conf_get_int(conf, CONF_ctrl_tab_switch) && GetCtrlTabFlag()) { + if( message==WM_KEYUP ) { + struct ctrl_tab_info info = { (GetKeyState(VK_SHIFT) & 0x8000) ? 1 : -1, hwnd, } ; - info.next_hi_date_time = info.self_hi_date_time = GetWindowLong(hwnd, 0); - info.next_lo_date_time = info.self_lo_date_time = GetWindowLong(hwnd, 4); - EnumWindows(CtrlTabWindowProc, (LPARAM) &info); - if (info.next != NULL) - if( info.next != hwnd ) - SetForegroundWindow(info.next); - return 0; + info.next_hi_date_time = info.self_hi_date_time = GetWindowLong(hwnd, 0); + info.next_lo_date_time = info.self_lo_date_time = GetWindowLong(hwnd, 4); + EnumWindows(CtrlTabWindowProc, (LPARAM) &info); + if (info.next != NULL) + if( info.next != hwnd ) + SetForegroundWindow(info.next); + return 0; + } + return DefWindowProc(hwnd, message, wParam, lParam); } - return DefWindowProc(hwnd, message, wParam, lParam); } AntiIdleCount = 0 ;