mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-26 01:32:25 +00:00
`Copy All' ought to de-highlight any existing selection, in line
with any other operation that shifts the X selection to stuff other than the highlighted text. [originally from svn r3098]
This commit is contained in:
parent
1be4188a3c
commit
ed46f3aa53
@ -3555,7 +3555,7 @@ void term_scroll(Terminal *term, int rel, int where)
|
|||||||
term_update(term);
|
term_update(term);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void clipme(Terminal *term, pos top, pos bottom, int rect)
|
static void clipme(Terminal *term, pos top, pos bottom, int rect, int desel)
|
||||||
{
|
{
|
||||||
wchar_t *workbuf;
|
wchar_t *workbuf;
|
||||||
wchar_t *wbptr; /* where next char goes within workbuf */
|
wchar_t *wbptr; /* where next char goes within workbuf */
|
||||||
@ -3703,7 +3703,7 @@ static void clipme(Terminal *term, pos top, pos bottom, int rect)
|
|||||||
wblen++;
|
wblen++;
|
||||||
*wbptr++ = 0;
|
*wbptr++ = 0;
|
||||||
#endif
|
#endif
|
||||||
write_clip(term->frontend, workbuf, wblen, FALSE); /* transfer to clipbd */
|
write_clip(term->frontend, workbuf, wblen, desel); /* transfer to clipbd */
|
||||||
if (buflen > 0) /* indicates we allocated this buffer */
|
if (buflen > 0) /* indicates we allocated this buffer */
|
||||||
sfree(workbuf);
|
sfree(workbuf);
|
||||||
}
|
}
|
||||||
@ -3713,7 +3713,7 @@ void term_copyall(Terminal *term)
|
|||||||
pos top;
|
pos top;
|
||||||
top.y = -sblines(term);
|
top.y = -sblines(term);
|
||||||
top.x = 0;
|
top.x = 0;
|
||||||
clipme(term, top, term->curs, 0);
|
clipme(term, top, term->curs, 0, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -4178,7 +4178,7 @@ void term_mouse(Terminal *term, Mouse_Button braw, Mouse_Button bcooked,
|
|||||||
* data to the clipboard.
|
* data to the clipboard.
|
||||||
*/
|
*/
|
||||||
clipme(term, term->selstart, term->selend,
|
clipme(term, term->selstart, term->selend,
|
||||||
(term->seltype == RECTANGULAR));
|
(term->seltype == RECTANGULAR), FALSE);
|
||||||
term->selstate = SELECTED;
|
term->selstate = SELECTED;
|
||||||
} else
|
} else
|
||||||
term->selstate = NO_SELECTION;
|
term->selstate = NO_SELECTION;
|
||||||
|
@ -1312,6 +1312,9 @@ void write_clip(void *frontend, wchar_t * data, int len, int must_deselect)
|
|||||||
gtk_selection_add_target(inst->area, GDK_SELECTION_PRIMARY,
|
gtk_selection_add_target(inst->area, GDK_SELECTION_PRIMARY,
|
||||||
utf8_string_atom, 1);
|
utf8_string_atom, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (must_deselect)
|
||||||
|
term_deselect(inst->term);
|
||||||
}
|
}
|
||||||
|
|
||||||
void selection_get(GtkWidget *widget, GtkSelectionData *seldata,
|
void selection_get(GtkWidget *widget, GtkSelectionData *seldata,
|
||||||
|
Loading…
Reference in New Issue
Block a user