mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 10:04:32 +03:00
Ticket #3208: fix failed gpm connect for vc /dev/tty0.
How to reproduce the bug: * compile mc with gpm support * run the gpm daemon on the console * login to the machine with ssh from console on another machine * run mc At this situation, keyboard response will be sluggish and mc will consume CPU time when idle. The reason is that mc is trying to reopen the Gpm connection over and over again and gpm will try to close the connection over and over again (because the user is not on the local console). Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
673dd73ac0
commit
d1fd9f2303
@ -2091,14 +2091,13 @@ tty_get_event (struct Gpm_Event *event, gboolean redo_event, gboolean block)
|
||||
*event = ev;
|
||||
return EV_MOUSE;
|
||||
}
|
||||
else if (status == 0) /* connection closed; -1 == error */
|
||||
else if (status <= 0) /* connection closed; -1 == error */
|
||||
{
|
||||
if (mouse_fd >= 0 && FD_ISSET (mouse_fd, &select_set))
|
||||
FD_CLR (mouse_fd, &select_set);
|
||||
|
||||
/* Try to reopen gpm_mouse connection */
|
||||
disable_mouse ();
|
||||
enable_mouse ();
|
||||
return EV_NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user