From d80999a1c4d99cf8aa9f1a61d992aefa57a7649a Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 2 Mar 2001 01:55:21 +0000 Subject: [PATCH] * select.cc (peek_console): Don't report read_ready on mouse events unless we are looking for mouse events. * fhandler.h (fhandler_console::mouse_aware): New method. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/fhandler.h | 1 + winsup/cygwin/select.cc | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 4d3d2cffc..d7c02ee8f 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +Thu Mar 1 20:48:11 2001 Christopher Faylor + + * select.cc (peek_console): Don't report read_ready on mouse events + unless we are looking for mouse events. + * fhandler.h (fhandler_console::mouse_aware): New method. + Wed Feb 28 15:10:00 2001 Corinna Vinschen * uinfo.cc: Eliminate `#include '. diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 99321a10e..3607b3b28 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -680,6 +680,7 @@ public: int ioctl (unsigned int cmd, void *); void init (HANDLE, DWORD, mode_t); + bool mouse_aware () {return use_mouse;} select_record *select_read (select_record *s); select_record *select_write (select_record *s); diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index b68161dc4..fe0804979 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -638,7 +638,10 @@ peek_console (select_record *me, int ignra) else if (irec.EventType == MOUSE_EVENT && (irec.Event.MouseEvent.dwEventFlags == 0 || irec.Event.MouseEvent.dwEventFlags == DOUBLE_CLICK)) - return me->read_ready = 1; + { + if (fh->mouse_aware ()) + return me->read_ready = 1; + } else if (irec.EventType == KEY_EVENT && irec.Event.KeyEvent.bKeyDown == TRUE && (irec.Event.KeyEvent.uChar.AsciiChar || get_nonascii_key (irec, tmpbuf))) return me->read_ready = 1; -- 2.43.5