The mousewheel issue likely has to do with Forms/MainView/MainViewF (near the top). I don't have Mono and I'm not absolutely positive about the __MonoCS__ flag. This bit of code (and associated stuff perhaps) allows windows to capture the mousewheel even if a control is not currently focused. Did you build against mono yourself, because if you're relying on a build against .NET well ... this is the kind of stuff that would throw ... or so it seems to me
#if !__MonoCS__
#region P/Invoke declarations
[DllImport("user32.dll")]
static extern IntPtr WindowFromPoint(Point pt);
[DllImport("user32.dll")]
static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp);
#endregion P/Invoke declarations
#region IMessageFilter
/// <summary>
/// Sends mousewheel messages to the control that the mouse-cursor is
/// hovering over.
/// </summary>
/// <param name="m">the message</param>
/// <returns>true if a mousewheel message was handled successfully</returns>
/// <remarks>https://stackoverflow.com/questions/4769854/windows-forms-capturing-mousewheel#4769961</remarks>
public bool PreFilterMessage(ref Message m)
{
if (m.Msg == 0x20a)
{
// WM_MOUSEWHEEL - find the control at screen position m.LParam
var pos = new Point(m.LParam.ToInt32());
IntPtr hWnd = WindowFromPoint(pos);
if (hWnd != IntPtr.Zero && hWnd != m.HWnd && Control.FromHandle(hWnd) != null)
{
SendMessage(hWnd, m.Msg, m.WParam, m.LParam);
return true;
}
}
return false;
}
#endregion IMessageFilter
#endif
__MonoCS__ is no longer defined, by the default compiler, since Mono version 5.
Even if, as you already noted, compiler and runtime might differ.
I have opened a pull-request which checks for Mono at runtime. If, it does not activate the mouse wheel filtering and prints a message to the console.
This needs reconsidering if ever WindowFromPoint, and maybe sendMessage, gets to works with Mono.
It would be safer to runtime-check if that function exists or implement the mouse wheeling differently.
But that is totally out of my league/time at the moment.
It should work flawlessly on Windows / .Net, but I cannot test that.
Anyway, have a nice weekend!