mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 09:27:59 +00:00
Decouple frontend's raw mouse mode from pointer shape.
This paves the way for a followup commit that will make them happen at slightly different times.
This commit is contained in:
parent
07aff63e22
commit
99dfc66457
8
putty.h
8
putty.h
@ -1246,7 +1246,13 @@ struct TermWinVtable {
|
||||
|
||||
void (*set_cursor_pos)(TermWin *, int x, int y);
|
||||
|
||||
/* set_raw_mouse_mode instructs the front end to start sending mouse events
|
||||
* in raw mode suitable for translating into mouse-tracking terminal data
|
||||
* (e.g. include scroll-wheel events and don't bother to identify double-
|
||||
* and triple-clicks). set_raw_mouse_mode_pointer instructs the front end
|
||||
* to change the mouse pointer shape to *indicate* raw mouse mode. */
|
||||
void (*set_raw_mouse_mode)(TermWin *, bool enable);
|
||||
void (*set_raw_mouse_mode_pointer)(TermWin *, bool enable);
|
||||
|
||||
void (*set_scrollbar)(TermWin *, int total, int start, int page);
|
||||
|
||||
@ -1304,6 +1310,8 @@ static inline void win_set_cursor_pos(TermWin *win, int x, int y)
|
||||
{ win->vt->set_cursor_pos(win, x, y); }
|
||||
static inline void win_set_raw_mouse_mode(TermWin *win, bool enable)
|
||||
{ win->vt->set_raw_mouse_mode(win, enable); }
|
||||
static inline void win_set_raw_mouse_mode_pointer(TermWin *win, bool enable)
|
||||
{ win->vt->set_raw_mouse_mode_pointer(win, enable); }
|
||||
static inline void win_set_scrollbar(TermWin *win, int t, int s, int p)
|
||||
{ win->vt->set_scrollbar(win, t, s, p); }
|
||||
static inline void win_bell(TermWin *win, int mode)
|
||||
|
@ -1357,6 +1357,7 @@ static void power_on(Terminal *term, bool clear)
|
||||
term->xterm_extended_mouse = false;
|
||||
term->urxvt_extended_mouse = false;
|
||||
win_set_raw_mouse_mode(term->win, false);
|
||||
win_set_raw_mouse_mode_pointer(term->win, false);
|
||||
term->bracketed_paste = false;
|
||||
term->srm_echo = false;
|
||||
{
|
||||
@ -2829,6 +2830,7 @@ static void term_update_raw_mouse_mode(Terminal *term)
|
||||
{
|
||||
bool want_raw = (term->xterm_mouse != 0 && !term->xterm_mouse_forbidden);
|
||||
win_set_raw_mouse_mode(term->win, want_raw);
|
||||
win_set_raw_mouse_mode_pointer(term->win, want_raw);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -179,6 +179,7 @@ struct GtkFrontend {
|
||||
int system_mod_mask;
|
||||
#endif
|
||||
bool send_raw_mouse;
|
||||
bool pointer_indicates_raw_mouse;
|
||||
unifont_drawctx uctx;
|
||||
#if GTK_CHECK_VERSION(2,0,0)
|
||||
GdkPixbuf *trust_sigil_pb;
|
||||
@ -647,7 +648,7 @@ static void update_mouseptr(GtkFrontend *inst)
|
||||
if (!inst->mouseptr_visible) {
|
||||
gdk_window_set_cursor(gtk_widget_get_window(inst->area),
|
||||
inst->blankcursor);
|
||||
} else if (inst->send_raw_mouse) {
|
||||
} else if (inst->pointer_indicates_raw_mouse) {
|
||||
gdk_window_set_cursor(gtk_widget_get_window(inst->area),
|
||||
inst->rawcursor);
|
||||
} else {
|
||||
@ -2397,13 +2398,16 @@ static void gtk_seat_set_busy_status(Seat *seat, BusyStatus status)
|
||||
update_mouseptr(inst);
|
||||
}
|
||||
|
||||
/*
|
||||
* set or clear the "raw mouse message" mode
|
||||
*/
|
||||
static void gtkwin_set_raw_mouse_mode(TermWin *tw, bool activate)
|
||||
{
|
||||
GtkFrontend *inst = container_of(tw, GtkFrontend, termwin);
|
||||
inst->send_raw_mouse = activate;
|
||||
}
|
||||
|
||||
static void gtkwin_set_raw_mouse_mode_pointer(TermWin *tw, bool activate)
|
||||
{
|
||||
GtkFrontend *inst = container_of(tw, GtkFrontend, termwin);
|
||||
inst->pointer_indicates_raw_mouse = activate;
|
||||
update_mouseptr(inst);
|
||||
}
|
||||
|
||||
@ -5023,6 +5027,7 @@ static const TermWinVtable gtk_termwin_vt = {
|
||||
.free_draw_ctx = gtkwin_free_draw_ctx,
|
||||
.set_cursor_pos = gtkwin_set_cursor_pos,
|
||||
.set_raw_mouse_mode = gtkwin_set_raw_mouse_mode,
|
||||
.set_raw_mouse_mode_pointer = gtkwin_set_raw_mouse_mode_pointer,
|
||||
.set_scrollbar = gtkwin_set_scrollbar,
|
||||
.bell = gtkwin_bell,
|
||||
.clip_write = gtkwin_clip_write,
|
||||
|
@ -202,6 +202,8 @@ static Mouse_Button lastbtn;
|
||||
static bool send_raw_mouse = false;
|
||||
static int wheel_accumulator = 0;
|
||||
|
||||
static bool pointer_indicates_raw_mouse = false;
|
||||
|
||||
static BusyStatus busy_status = BUSY_NOT;
|
||||
|
||||
static char *window_name, *icon_name;
|
||||
@ -226,6 +228,7 @@ static int wintw_char_width(TermWin *, int uc);
|
||||
static void wintw_free_draw_ctx(TermWin *);
|
||||
static void wintw_set_cursor_pos(TermWin *, int x, int y);
|
||||
static void wintw_set_raw_mouse_mode(TermWin *, bool enable);
|
||||
static void wintw_set_raw_mouse_mode_pointer(TermWin *, bool enable);
|
||||
static void wintw_set_scrollbar(TermWin *, int total, int start, int page);
|
||||
static void wintw_bell(TermWin *, int mode);
|
||||
static void wintw_clip_write(
|
||||
@ -252,6 +255,7 @@ static const TermWinVtable windows_termwin_vt = {
|
||||
.free_draw_ctx = wintw_free_draw_ctx,
|
||||
.set_cursor_pos = wintw_set_cursor_pos,
|
||||
.set_raw_mouse_mode = wintw_set_raw_mouse_mode,
|
||||
.set_raw_mouse_mode_pointer = wintw_set_raw_mouse_mode_pointer,
|
||||
.set_scrollbar = wintw_set_scrollbar,
|
||||
.bell = wintw_bell,
|
||||
.clip_write = wintw_clip_write,
|
||||
@ -1087,7 +1091,7 @@ static void update_mouse_pointer(void)
|
||||
static bool forced_visible = false;
|
||||
switch (busy_status) {
|
||||
case BUSY_NOT:
|
||||
if (send_raw_mouse)
|
||||
if (pointer_indicates_raw_mouse)
|
||||
curstype = IDC_ARROW;
|
||||
else
|
||||
curstype = IDC_IBEAM;
|
||||
@ -1124,12 +1128,14 @@ static void win_seat_set_busy_status(Seat *seat, BusyStatus status)
|
||||
update_mouse_pointer();
|
||||
}
|
||||
|
||||
/*
|
||||
* set or clear the "raw mouse message" mode
|
||||
*/
|
||||
static void wintw_set_raw_mouse_mode(TermWin *tw, bool activate)
|
||||
{
|
||||
send_raw_mouse = activate;
|
||||
}
|
||||
|
||||
static void wintw_set_raw_mouse_mode_pointer(TermWin *tw, bool activate)
|
||||
{
|
||||
pointer_indicates_raw_mouse = activate;
|
||||
update_mouse_pointer();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user