diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-06-12 15:57:35 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-06-12 15:57:35 +0000 |
commit | cdab7783c40f97e482161a3943a750a5feb00aea (patch) | |
tree | 70f4d880a4fad5e106d6277be46acde47e717e87 | |
parent | 2ed056f092f7fea88a8f1bb807b9a3e13f4d37e2 (diff) | |
download | newlib-cr-0x5f1.zip newlib-cr-0x5f1.tar.gz newlib-cr-0x5f1.tar.bz2 |
* fhandler_console.cc (fhandler_console::open): Set console state last.github/cr-0x5f1cr-0x5f1
Only add ENABLE_PROCESSED_INPUT flag if this is the first time we open
the console.
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 13 |
2 files changed, 14 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b67e0ee..40d3e26 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2008-06-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::open): Set console state last. + Only add ENABLE_PROCESSED_INPUT flag if this is the first time we open + the console. + 2008-04-17 Corinna Vinschen <corinna@vinschen.de> * dtable.cc (dtable::init_std_file_from_handle): Fix pipe related test. diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 82ede58..2b51cee 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -682,16 +682,19 @@ fhandler_console::open (int flags, mode_t) dev_state->set_default_attr (); } + tc->rstcons (false); + set_open_status (); + int cons_cnt = cygheap->manage_console_count ("fhandler_console::open", 1); + DWORD cflags; if (GetConsoleMode (get_io_handle (), &cflags)) { - cflags |= ENABLE_PROCESSED_INPUT; - SetConsoleMode (get_io_handle (), ENABLE_WINDOW_INPUT | ENABLE_MOUSE_INPUT | cflags); + if (cons_cnt <= 1) + cflags |= ENABLE_PROCESSED_INPUT; + SetConsoleMode (get_io_handle (), + ENABLE_WINDOW_INPUT | ENABLE_MOUSE_INPUT | cflags); } - tc->rstcons (false); - set_open_status (); - cygheap->manage_console_count ("fhandler_console::open", 1); debug_printf ("opened conin$ %p, conout$ %p", get_io_handle (), get_output_handle ()); |