mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-08 20:41:59 +03:00
Don't generate click event after drag action.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
cfd2c35241
commit
b305deba64
@ -41,6 +41,7 @@
|
|||||||
/*** file scope variables ************************************************************************/
|
/*** file scope variables ************************************************************************/
|
||||||
|
|
||||||
static int last_buttons_down;
|
static int last_buttons_down;
|
||||||
|
static gboolean was_drag = FALSE;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
/*** file scope functions ************************************************************************/
|
/*** file scope functions ************************************************************************/
|
||||||
@ -128,7 +129,7 @@ easy_mouse_translator (Gpm_Event * event, void *data)
|
|||||||
msg = MSG_MOUSE_UP;
|
msg = MSG_MOUSE_UP;
|
||||||
|
|
||||||
if (in_widget)
|
if (in_widget)
|
||||||
run_click = TRUE;
|
run_click = !was_drag;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When using xterm, event->buttons reports the buttons' state
|
* When using xterm, event->buttons reports the buttons' state
|
||||||
@ -157,6 +158,9 @@ easy_mouse_translator (Gpm_Event * event, void *data)
|
|||||||
{
|
{
|
||||||
mouse_event_t local;
|
mouse_event_t local;
|
||||||
|
|
||||||
|
/* Rememer the current state for next event. */
|
||||||
|
was_drag = ((event->type & GPM_DRAG) != 0);
|
||||||
|
|
||||||
init_mouse_event (&local, msg, event, w);
|
init_mouse_event (&local, msg, event, w);
|
||||||
|
|
||||||
w->Mouse.callback (w, msg, &local);
|
w->Mouse.callback (w, msg, &local);
|
||||||
|
Loading…
Reference in New Issue
Block a user