diff --git a/src/terminal/mouse.c b/src/terminal/mouse.c index 9d3badfc..e595043c 100644 --- a/src/terminal/mouse.c +++ b/src/terminal/mouse.c @@ -25,11 +25,13 @@ #include "elinks.h" #include "config/options.h" +#include "dialogs/status.h" #include "intl/libintl.h" #include "main/select.h" #include "main/timer.h" #include "osdep/ascii.h" #include "osdep/osdep.h" +#include "session/session.h" #include "terminal/hardio.h" #include "terminal/itrm.h" #include "terminal/kbd.h" @@ -97,12 +99,20 @@ enable_mouse(void) } void -toggle_mouse(void) +toggle_mouse(struct session *ses) { - if (mouse_enabled) + if (mouse_enabled) { disable_mouse(); - else + } else { enable_mouse(); + } + + if (mouse_enabled) { + mem_free_set(&ses->status.window_status, stracpy(_("Mouse enabled", ses->tab->term))); + } else { + mem_free_set(&ses->status.window_status, stracpy(_("Mouse disabled", ses->tab->term))); + } + print_screen_status(ses); } static int diff --git a/src/terminal/mouse.h b/src/terminal/mouse.h index 272c00a0..4ccf5da9 100644 --- a/src/terminal/mouse.h +++ b/src/terminal/mouse.h @@ -7,6 +7,7 @@ extern "C" { struct interlink_event; struct itrm; +struct session; /* The mouse reporting button byte looks like: * @@ -120,7 +121,7 @@ void send_mouse_init_sequence(int h); void send_mouse_done_sequence(int h); void disable_mouse(void); void enable_mouse(void); -void toggle_mouse(void); +void toggle_mouse(struct session *ses); int decode_terminal_mouse_escape_sequence(struct itrm *itrm, struct interlink_event *ev, int el, int v); #ifdef __cplusplus diff --git a/src/viewer/action.c b/src/viewer/action.c index 440ab71d..5e9499c5 100644 --- a/src/viewer/action.c +++ b/src/viewer/action.c @@ -683,7 +683,7 @@ do_action(struct session *ses, enum main_action action_id, int verbose) case ACT_MAIN_TOGGLE_MOUSE: #ifdef CONFIG_MOUSE - toggle_mouse(); + toggle_mouse(ses); #endif break;