mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 19:42:48 -05:00
Add a new seat method to return the cursor position.
The motivation is for the SUPDUP protocol. The server may send a signal for the terminal to reset any input buffers. After this, the server will not know the state of the terminal, so it is required to send its cursor position back.
This commit is contained in:

committed by
Simon Tatham

parent
1efded20a1
commit
a8bb6456d1
@ -373,6 +373,7 @@ static const char *gtk_seat_get_x_display(Seat *seat);
|
||||
static bool gtk_seat_get_windowid(Seat *seat, long *id);
|
||||
#endif
|
||||
static bool gtk_seat_set_trust_status(Seat *seat, bool trusted);
|
||||
static bool gtk_seat_get_cursor_position(Seat *seat, int *x, int *y);
|
||||
|
||||
static const SeatVtable gtk_seat_vt = {
|
||||
gtk_seat_output,
|
||||
@ -399,6 +400,7 @@ static const SeatVtable gtk_seat_vt = {
|
||||
gtk_seat_set_trust_status,
|
||||
nullseat_verbose_yes,
|
||||
nullseat_interactive_yes,
|
||||
gtk_seat_get_cursor_position,
|
||||
};
|
||||
|
||||
static void gtk_eventlog(LogPolicy *lp, const char *string)
|
||||
@ -5530,3 +5532,13 @@ static bool gtk_seat_set_trust_status(Seat *seat, bool trusted)
|
||||
term_set_trust_status(inst->term, trusted);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool gtk_seat_get_cursor_position(Seat *seat, int *x, int *y)
|
||||
{
|
||||
GtkFrontend *inst = container_of(seat, GtkFrontend, seat);
|
||||
if (inst->term) {
|
||||
term_get_cursor_position(inst->term, x, y);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -407,6 +407,7 @@ static const SeatVtable plink_seat_vt = {
|
||||
console_set_trust_status,
|
||||
cmdline_seat_verbose,
|
||||
plink_seat_interactive,
|
||||
nullseat_get_cursor_position,
|
||||
};
|
||||
static Seat plink_seat[1] = {{ &plink_seat_vt }};
|
||||
|
||||
|
Reference in New Issue
Block a user