mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
Use SetCapture() to fix the problem with double-clicks on saved sessions
carrying throuh to the window below the config box [originally from svn r37]
This commit is contained in:
parent
779a28e84f
commit
485c1f7508
24
windlg.c
24
windlg.c
@ -95,17 +95,13 @@ static void gppi(HKEY key, LPCTSTR name, int def, int *i) {
|
|||||||
*i = val;
|
*i = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
void *posn;
|
|
||||||
void *temp;
|
|
||||||
char dataspace[2048];
|
|
||||||
} DTemplate;
|
|
||||||
|
|
||||||
static HINSTANCE hinst;
|
static HINSTANCE hinst;
|
||||||
|
|
||||||
static char **sessions;
|
static char **sessions;
|
||||||
static int nsessions;
|
static int nsessions;
|
||||||
|
|
||||||
|
static int readytogo;
|
||||||
|
|
||||||
static void save_settings (char *section, int do_host) {
|
static void save_settings (char *section, int do_host) {
|
||||||
int i;
|
int i;
|
||||||
HKEY subkey1, sesskey;
|
HKEY subkey1, sesskey;
|
||||||
@ -428,6 +424,15 @@ static int CALLBACK ConnectionProc (HWND hwnd, UINT msg,
|
|||||||
cfg.protocol==PROT_SSH ? IDC0_PROTSSH : IDC0_PROTTELNET);
|
cfg.protocol==PROT_SSH ? IDC0_PROTSSH : IDC0_PROTTELNET);
|
||||||
CheckDlgButton (hwnd, IDC0_CLOSEEXIT, cfg.close_on_exit);
|
CheckDlgButton (hwnd, IDC0_CLOSEEXIT, cfg.close_on_exit);
|
||||||
break;
|
break;
|
||||||
|
case WM_LBUTTONUP:
|
||||||
|
/*
|
||||||
|
* Button release should trigger WM_OK if there was a
|
||||||
|
* previous double click on the session list.
|
||||||
|
*/
|
||||||
|
ReleaseCapture();
|
||||||
|
if (readytogo)
|
||||||
|
SendMessage (GetParent(hwnd), WM_COMMAND, IDOK, 0);
|
||||||
|
break;
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
switch (LOWORD(wParam)) {
|
switch (LOWORD(wParam)) {
|
||||||
case IDC0_PROTTELNET:
|
case IDC0_PROTTELNET:
|
||||||
@ -525,8 +530,10 @@ static int CALLBACK ConnectionProc (HWND hwnd, UINT msg,
|
|||||||
* Unless it's Default Settings or some other
|
* Unless it's Default Settings or some other
|
||||||
* host-less set of saved settings.
|
* host-less set of saved settings.
|
||||||
*/
|
*/
|
||||||
if (*cfg.host)
|
if (*cfg.host) {
|
||||||
SendMessage (GetParent(hwnd), WM_COMMAND, IDOK, 0);
|
readytogo = TRUE;
|
||||||
|
SetCapture(hwnd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IDC0_SESSDEL:
|
case IDC0_SESSDEL:
|
||||||
@ -1031,7 +1038,6 @@ static int CALLBACK ColourProc (HWND hwnd, UINT msg,
|
|||||||
return GeneralPanelProc (hwnd, msg, wParam, lParam);
|
return GeneralPanelProc (hwnd, msg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
static DTemplate negot, main, reconf, panels[NPANELS];
|
|
||||||
static DLGPROC panelproc[NPANELS] = {
|
static DLGPROC panelproc[NPANELS] = {
|
||||||
ConnectionProc, KeyboardProc, TerminalProc,
|
ConnectionProc, KeyboardProc, TerminalProc,
|
||||||
TelnetProc, SshProc, SelectionProc, ColourProc
|
TelnetProc, SshProc, SelectionProc, ColourProc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user