mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-26 09:42:25 +00:00
Add a parameter to write_clip() so that windlg.c need not call term_deselect
[originally from svn r681]
This commit is contained in:
parent
bbe7ece71f
commit
7b6106d62a
4
plink.c
4
plink.c
@ -38,7 +38,7 @@ static char *password = NULL;
|
|||||||
/*
|
/*
|
||||||
* Stubs for linking with other modules.
|
* Stubs for linking with other modules.
|
||||||
*/
|
*/
|
||||||
void write_clip (void *data, int len) { }
|
void write_clip (void *data, int len, int must_deselect) { }
|
||||||
void term_deselect(void) { }
|
void term_deselect(void) { }
|
||||||
|
|
||||||
HANDLE outhandle;
|
HANDLE outhandle;
|
||||||
@ -112,7 +112,7 @@ static int get_password(const char *prompt, char *str, int maxlen)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int WINAPI stdin_read_thread(void *param) {
|
static int WINAPI stdin_read_thread(void *param) {
|
||||||
struct input_data *idata = (struct input_data *)param;
|
struct input_data *idata = (struct input_data *)param;
|
||||||
HANDLE inhandle;
|
HANDLE inhandle;
|
||||||
|
|
||||||
|
2
putty.h
2
putty.h
@ -244,7 +244,7 @@ Context get_ctx(void);
|
|||||||
void free_ctx (Context);
|
void free_ctx (Context);
|
||||||
void palette_set (int, int, int, int);
|
void palette_set (int, int, int, int);
|
||||||
void palette_reset (void);
|
void palette_reset (void);
|
||||||
void write_clip (void *, int);
|
void write_clip (void *, int, int);
|
||||||
void get_clip (void **, int *);
|
void get_clip (void **, int *);
|
||||||
void optimised_move (int, int, int);
|
void optimised_move (int, int, int);
|
||||||
void connection_fatal(char *, ...);
|
void connection_fatal(char *, ...);
|
||||||
|
2
scp.c
2
scp.c
@ -77,7 +77,7 @@ static void gui_update_stats(char *name, unsigned long size, int percentage, tim
|
|||||||
* (should) never get called.
|
* (should) never get called.
|
||||||
*/
|
*/
|
||||||
void begin_session(void) { }
|
void begin_session(void) { }
|
||||||
void write_clip (void *data, int len) { }
|
void write_clip (void *data, int len, int must_deselect) { }
|
||||||
void term_deselect(void) { }
|
void term_deselect(void) { }
|
||||||
|
|
||||||
/* GUI Adaptation - Sept 2000 */
|
/* GUI Adaptation - Sept 2000 */
|
||||||
|
@ -2001,7 +2001,7 @@ void term_mouse (Mouse_Button b, Mouse_Action a, int x, int y) {
|
|||||||
}
|
}
|
||||||
q = lineend + 1; /* start of next line */
|
q = lineend + 1; /* start of next line */
|
||||||
}
|
}
|
||||||
write_clip (selspace, p - selspace);
|
write_clip (selspace, p - selspace, FALSE);
|
||||||
selstate = SELECTED;
|
selstate = SELECTED;
|
||||||
} else
|
} else
|
||||||
selstate = NO_SELECTION;
|
selstate = NO_SELECTION;
|
||||||
|
12
windlg.c
12
windlg.c
@ -354,6 +354,11 @@ static int CALLBACK LogProc (HWND hwnd, UINT msg,
|
|||||||
char *clipdata;
|
char *clipdata;
|
||||||
static unsigned char sel_nl[] = SEL_NL;
|
static unsigned char sel_nl[] = SEL_NL;
|
||||||
|
|
||||||
|
if (count == 0) { /* can't copy zero stuff */
|
||||||
|
MessageBeep(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
size = 0;
|
size = 0;
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
size += strlen(events[selitems[i]]) + sizeof(sel_nl);
|
size += strlen(events[selitems[i]]) + sizeof(sel_nl);
|
||||||
@ -369,11 +374,14 @@ static int CALLBACK LogProc (HWND hwnd, UINT msg,
|
|||||||
memcpy(p, sel_nl, sizeof(sel_nl));
|
memcpy(p, sel_nl, sizeof(sel_nl));
|
||||||
p += sizeof(sel_nl);
|
p += sizeof(sel_nl);
|
||||||
}
|
}
|
||||||
write_clip(clipdata, size);
|
write_clip(clipdata, size, TRUE);
|
||||||
term_deselect();
|
|
||||||
free(clipdata);
|
free(clipdata);
|
||||||
}
|
}
|
||||||
free(selitems);
|
free(selitems);
|
||||||
|
|
||||||
|
for (i = 0; i < nevents; i++)
|
||||||
|
SendDlgItemMessage(hwnd, IDN_LIST, LB_SETSEL,
|
||||||
|
FALSE, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
10
window.c
10
window.c
@ -2242,7 +2242,7 @@ void palette_reset (void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void write_clip (void *data, int len) {
|
void write_clip (void *data, int len, int must_deselect) {
|
||||||
HGLOBAL clipdata;
|
HGLOBAL clipdata;
|
||||||
void *lock;
|
void *lock;
|
||||||
|
|
||||||
@ -2256,14 +2256,18 @@ void write_clip (void *data, int len) {
|
|||||||
((unsigned char *) lock) [len] = 0;
|
((unsigned char *) lock) [len] = 0;
|
||||||
GlobalUnlock (clipdata);
|
GlobalUnlock (clipdata);
|
||||||
|
|
||||||
SendMessage (hwnd, WM_IGNORE_CLIP, TRUE, 0);
|
if (!must_deselect)
|
||||||
|
SendMessage (hwnd, WM_IGNORE_CLIP, TRUE, 0);
|
||||||
|
|
||||||
if (OpenClipboard (hwnd)) {
|
if (OpenClipboard (hwnd)) {
|
||||||
EmptyClipboard();
|
EmptyClipboard();
|
||||||
SetClipboardData (CF_TEXT, clipdata);
|
SetClipboardData (CF_TEXT, clipdata);
|
||||||
CloseClipboard();
|
CloseClipboard();
|
||||||
} else
|
} else
|
||||||
GlobalFree (clipdata);
|
GlobalFree (clipdata);
|
||||||
SendMessage (hwnd, WM_IGNORE_CLIP, FALSE, 0);
|
|
||||||
|
if (!must_deselect)
|
||||||
|
SendMessage (hwnd, WM_IGNORE_CLIP, FALSE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void get_clip (void **p, int *len) {
|
void get_clip (void **p, int *len) {
|
||||||
|
Loading…
Reference in New Issue
Block a user