From 1963f21af2382d72406eb667a70e0cd66a6eb379 Mon Sep 17 00:00:00 2001 From: cyd01 Date: Tue, 9 May 2023 14:50:09 +0200 Subject: [PATCH] Tagging the 0.76.1.9 release of the KiTTY project. --- 0.76_My_PuTTY/timing.c | 4 +- 0.76_My_PuTTY/windows/window.c | 11 ++--- 0.76b_My_PuTTY/terminal/terminal.c | 63 ++++++++++++++++++++++++ 0.76b_My_PuTTY/timing.c | 8 +++ 0.76b_My_PuTTY/version.h | 2 +- 0.76b_My_PuTTY/windows/version_minor.txt | 2 +- 0.76b_My_PuTTY/windows/window.c | 1 + docs/version.txt | 2 +- 8 files changed, 81 insertions(+), 12 deletions(-) diff --git a/0.76_My_PuTTY/timing.c b/0.76_My_PuTTY/timing.c index 3e116a8..8036e43 100644 --- a/0.76_My_PuTTY/timing.c +++ b/0.76_My_PuTTY/timing.c @@ -137,12 +137,10 @@ unsigned long schedule_timer(int ticks, timer_fn_t fn, void *ctx) } first = (struct timer *)index234(timers, 0); - if (first == t || first != NULL && first->now + 10 * (TICKSPERSEC) < now) { + if (first == t) { /* * This timer is the very first on the list, so we must * notify the front end. - * Also notify if the first timer has seriously missed its run time, - * most likely due to a system sleep event. */ timer_change_notify(first->now); } diff --git a/0.76_My_PuTTY/windows/window.c b/0.76_My_PuTTY/windows/window.c index 44c8a3e..76a0397 100644 --- a/0.76_My_PuTTY/windows/window.c +++ b/0.76_My_PuTTY/windows/window.c @@ -685,23 +685,22 @@ static void start_backend(void) start_backend() ; return ; } - } else if( !is_backend_first_connected ) { + } else { MessageBox(NULL, msg, str, MB_OK); } } sfree(str); sfree(msg); - SetSSHConnected(0) ; - queue_toplevel_callback(close_session, NULL); - session_closed = true; if( GetAutoreconnectFlag() && conf_get_int(conf,CONF_failure_reconnect) && is_backend_first_connected ) { SetConnBreakIcon(wgs.term_hwnd) ; + SetSSHConnected(0) ; + queue_toplevel_callback(close_session, NULL); + session_closed = true; lp_eventlog(&wgs.logpolicy, "Unable to connect, trying to reconnect...") ; SetTimer(wgs.term_hwnd, TIMER_RECONNECT, GetReconnectDelay()*1000, NULL) ; - } - if( is_backend_first_connected ) { return ; } + else #else char *str = dupprintf("%s Error", appname); char *msg = dupprintf("Unable to open connection to\n%s\n%s", diff --git a/0.76b_My_PuTTY/terminal/terminal.c b/0.76b_My_PuTTY/terminal/terminal.c index 2f19fc2..ee280d2 100644 --- a/0.76b_My_PuTTY/terminal/terminal.c +++ b/0.76b_My_PuTTY/terminal/terminal.c @@ -3855,6 +3855,69 @@ static void do_osc(Terminal *term) #endif } break; +#ifdef MOD_PERSO + case 52: + { + int status = MessageBox(NULL, + "Allow OSC52 clipboard sync?", "PyTTY", MB_OKCANCEL); + + if (status == IDOK) { + + base64_decodestate _d_state; + base64_init_decodestate(&_d_state); + char* d_out = malloc(term->osc_strlen); + int d_count = base64_decode_block( + term->osc_string+1, term->osc_strlen-1, d_out, &_d_state); + + uint32_t fmt; + char* buffer = NULL; + int BufferSize = 0; + + int cnt = MultiByteToWideChar(CP_UTF8, 0, (LPCCH)d_out, d_count, NULL, 0); + if (cnt > 0) { + buffer = calloc(cnt + 1, sizeof(wchar_t)); + MultiByteToWideChar(CP_UTF8, 0, (LPCCH)d_out, d_count, (PWCHAR)buffer, cnt); + } + + fmt = CF_UNICODETEXT; + BufferSize = (wcslen((PWCHAR)buffer) + 1) * sizeof(WCHAR); + + HGLOBAL hData; + void *GData; + + if (buffer && (hData=GlobalAlloc(GMEM_MOVEABLE,BufferSize))) { + + if ((GData=GlobalLock(hData))) { + + memcpy(GData,buffer,BufferSize); + GlobalUnlock(hData); + + if (OpenClipboard(NULL)) { + + EmptyClipboard(); + + if (!SetClipboardData(fmt, (HANDLE)hData)) { + GlobalFree(hData); + } + + CloseClipboard(); + + } else { + GlobalFree(hData); + } + + } else { + GlobalFree(hData); + } + } + + free(buffer); + free(d_out); + } + + break; + } +#endif case 4: if (term->ldisc && !strcmp(term->osc_string, "?")) { unsigned index = term->esc_args[1]; diff --git a/0.76b_My_PuTTY/timing.c b/0.76b_My_PuTTY/timing.c index 3e116a8..b5c2e97 100644 --- a/0.76b_My_PuTTY/timing.c +++ b/0.76b_My_PuTTY/timing.c @@ -137,6 +137,7 @@ unsigned long schedule_timer(int ticks, timer_fn_t fn, void *ctx) } first = (struct timer *)index234(timers, 0); +#ifdef MOD_PERSO if (first == t || first != NULL && first->now + 10 * (TICKSPERSEC) < now) { /* * This timer is the very first on the list, so we must @@ -144,6 +145,13 @@ unsigned long schedule_timer(int ticks, timer_fn_t fn, void *ctx) * Also notify if the first timer has seriously missed its run time, * most likely due to a system sleep event. */ +#else + if (first == t) { + /* + * This timer is the very first on the list, so we must + * notify the front end. + */ +#endif timer_change_notify(first->now); } diff --git a/0.76b_My_PuTTY/version.h b/0.76b_My_PuTTY/version.h index 3a62311..310558f 100644 --- a/0.76b_My_PuTTY/version.h +++ b/0.76b_My_PuTTY/version.h @@ -1,5 +1,5 @@ #define RELEASE 0.76 #define TEXTVER "Release 0.76" #define SSHVER "-Release-0.76" -#define BINARY_VERSION 0,76,1,8 +#define BINARY_VERSION 0,76,1,9 #define SOURCE_COMMIT "unavailable" diff --git a/0.76b_My_PuTTY/windows/version_minor.txt b/0.76b_My_PuTTY/windows/version_minor.txt index 45a4fb7..ec63514 100644 --- a/0.76b_My_PuTTY/windows/version_minor.txt +++ b/0.76b_My_PuTTY/windows/version_minor.txt @@ -1 +1 @@ -8 +9 diff --git a/0.76b_My_PuTTY/windows/window.c b/0.76b_My_PuTTY/windows/window.c index 27b2a52..eb8aeeb 100644 --- a/0.76b_My_PuTTY/windows/window.c +++ b/0.76b_My_PuTTY/windows/window.c @@ -698,6 +698,7 @@ static void start_backend(void) SetConnBreakIcon(wgs.term_hwnd) ; lp_eventlog(&wgs.logpolicy, "Unable to connect, trying to reconnect...") ; SetTimer(wgs.term_hwnd, TIMER_RECONNECT, GetReconnectDelay()*1000, NULL) ; + return ; } if( is_backend_first_connected ) { return ; diff --git a/docs/version.txt b/docs/version.txt index 5a01f0b..718bbed 100644 --- a/docs/version.txt +++ b/docs/version.txt @@ -1 +1 @@ -0.76.1.8 \ No newline at end of file +0.76.1.9 \ No newline at end of file