From 73a9d3de3bce1b01f73894c6208a89aa203103fd Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Fri, 2 Feb 2018 23:03:43 -0500 Subject: [PATCH] Bring fixes from mono-curses --- Terminal.Gui/MonoCurses/binding.cs | 8 ++++---- Terminal.Gui/MonoCurses/mainloop.cs | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Terminal.Gui/MonoCurses/binding.cs b/Terminal.Gui/MonoCurses/binding.cs index e08024f1e..e698bf47a 100644 --- a/Terminal.Gui/MonoCurses/binding.cs +++ b/Terminal.Gui/MonoCurses/binding.cs @@ -53,9 +53,9 @@ namespace Unix.Terminal { static void FindNCurses () { if (File.Exists ("/usr/lib/libncurses.dylib")) - curses_handle = dlopen ("libncurses.dylib", 0); + curses_handle = dlopen ("libncurses.dylib", 1); else - curses_handle = dlopen ("libncurses.so", 0); + curses_handle = dlopen ("libncurses.so", 1); if (curses_handle == IntPtr.Zero) throw new Exception ("Could not dlopen ncurses"); @@ -314,10 +314,10 @@ namespace Unix.Terminal { #endregion - [DllImport ("libc")] + [DllImport ("dl")] extern static IntPtr dlopen (string file, int mode); - [DllImport ("libc")] + [DllImport ("dl")] extern static IntPtr dlsym (IntPtr handle, string symbol); static IntPtr stdscr; diff --git a/Terminal.Gui/MonoCurses/mainloop.cs b/Terminal.Gui/MonoCurses/mainloop.cs index 442319eab..e120a4a0d 100644 --- a/Terminal.Gui/MonoCurses/mainloop.cs +++ b/Terminal.Gui/MonoCurses/mainloop.cs @@ -243,6 +243,7 @@ namespace Mono.Terminal { foreach (var fd in descriptorWatchers.Keys){ pollmap [i].fd = fd; pollmap [i].events = MapCondition (descriptorWatchers [fd].Condition); + i++; } }