Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
I have a class that inherits NSView and overrides the MouseUp method (MouseDown is also affected by this.) With this NSView placed in a window I expect to only have this MouseUp method called when the mouse is within the bounds of my NSView, not when the mouse is in another part of the window. Normally this is the case, but we've discovered a very strange bug.
If I left-click inside my NSView, then move to another part of this window and right-click then immediately left-click (as if to double-click, but right then left) another call is made to MouseUp on my NSView. The location property of the event is well outside the bounds of my NSView.
I checked an older build of our application (with the runtime bundled) from February 28, 2014 and the same behavior exists, so this is not new.
Could you please provide us the test steps you followed. If possible please
attach a small complete project that demonstrates this behavior.
Also can you please add the logs from the following places?:
On XS IDE Log Location: XS>Help> Open Log Directory> IDE.log file (with latest
Created attachment 8298 [details]
In the sample application, if you left-click inside the red rectangle (the custom NSView) you get a "MouseDown" message in the console from the MouseDown override on the custom NSView. This is expected behavior. If you then proceed to right-click then left-click somewhere outside the red rectangle you will get another "MouseDown" message. This is unexpected.
While unfortunate behavior, this actually has nothing to do with Xamarin.Mac. We're exposing the underlying platform behavior perfectly.
I wrote a quick test app that did exactly what yours did:
And I got the same behavior. If i had to guess, It probably has to do with the way they do tracking loops. You could hit test inside your mouse down handler to see if it is in your Frame to detect this case.