mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Fix segfault in case of click on widget that doesn't handle mouse.
Use default mouse callback function if widget doesn't handle mouse. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
a55b3fb684
commit
cef0bb0138
@ -169,6 +169,17 @@ hotkey_cmp (const char *s1, const char *s2)
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
widget_default_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
||||
{
|
||||
/* do nothing */
|
||||
(void) w;
|
||||
(void) msg;
|
||||
(void) event;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static const int *
|
||||
widget_default_get_colors (const Widget * w)
|
||||
{
|
||||
@ -312,7 +323,7 @@ widget_init (Widget * w, int y, int x, int lines, int cols,
|
||||
w->ext_keymap = NULL;
|
||||
w->ext_mode = FALSE;
|
||||
|
||||
w->mouse_callback = mouse_callback;
|
||||
w->mouse_callback = mouse_callback != NULL ? mouse_callback : widget_default_mouse_callback;
|
||||
w->owner = NULL;
|
||||
w->mouse_handler = mouse_handle_event;
|
||||
w->mouse.forced_capture = FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user