Bug 23591 - ListView.ItemControl.ItemsMouseDown subject to unexpected message processing
Summary: ListView.ItemControl.ItemsMouseDown subject to unexpected message processing
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: Windows.Forms ()
Version: 3.4.0
Hardware: PC Linux
: --- normal
Target Milestone: Community
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-10-03 13:42 UTC by Stephen McConnel
Modified: 2017-09-01 11:55 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
ListView-Crash-Stacktrace.txt shows the complete stack (as recorded inside Monodevelop) where ItemsMouseUp() is called inside ItemsMouseDown(). (11.46 KB, text/plain)
2014-10-03 13:43 UTC, Stephen McConnel
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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 for Bug 23591 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Stephen McConnel 2014-10-03 13:42:33 UTC
The processing for inside ListView.ItemControl.ItemsMouseDown() can sometimes allow ItemsMouseUp() to be called before ItemsMouseDown() has been completed.  I'm attaching a stack trace that shows this happening.  It's a complex enough situation (and somewhat nondeterministic) that I haven't tried to provide an example program.  The Mono codebase in the stack trace is essentially Mono 3.4.0 with a few added lines of code to facilitate trapping the bug without stopping every time in ItemsMouseDown.

The critical bit is that the processing steps for the side-effects of setting "clicked_item.Selected = true" eventually result in Application.DoEvents() being called, which opens the door for the MouseUp event to be processed if the timing is just right.  Our program may be the only that would have such a complex, convoluted process, but then again it might not be alone in this regard.  (And this call does not occur directly in our code, but in third-party software that we are using.)
Comment 1 Stephen McConnel 2014-10-03 13:43:57 UTC
Created attachment 8299 [details]
ListView-Crash-Stacktrace.txt shows the complete stack (as recorded inside Monodevelop) where ItemsMouseUp() is called inside ItemsMouseDown().
Comment 2 Stephen McConnel 2014-10-03 15:19:25 UTC
A proposed fix has been posted as https://github.com/mono/mono/pull/1323.