Bug 4497 - MonoDevelops text editor stops responding to mouse events
Summary: MonoDevelops text editor stops responding to mouse events
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: Trunk
Hardware: PC Mac OS
: Highest critical
Target Milestone: 3.0
Assignee: Mike Krüger
Depends on:
Reported: 2012-04-18 09:09 UTC by Alan McGovern
Modified: 2012-10-25 03:37 UTC (History)
9 users (show)

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

Screen dump 1: before deletion (6.32 KB, image/png)
2012-05-07 01:42 UTC, John Costella
Screendump 2: after hitting Ctrl-Delete (6.19 KB, image/png)
2012-05-07 01:43 UTC, John Costella
Screendump 3: after clicking mouse (6.25 KB, image/png)
2012-05-07 01:44 UTC, John Costella
Photo of docked display configuration (60.46 KB, image/jpeg)
2012-05-13 20:39 UTC, John Costella
Screendump of display settings (89.94 KB, image/png)
2012-05-13 20:40 UTC, John Costella

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 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.

Related Links:

Description Alan McGovern 2012-04-18 09:09:45 UTC
The best description is the one given in this screencast:

Comment 1 Mikayla Hutchinson [MSFT] 2012-04-18 19:25:47 UTC
Can you please at least attempt to describe the problem in the bug report?
Comment 2 Alan McGovern 2012-04-20 09:16:55 UTC
1) Select text with mouse
2) Type to replace text
3) You can no longer click anywhere after the caret

The screencast has a good demo of this if you cannot repro with those instructors
Comment 3 Marek Habersack 2012-04-23 07:16:49 UTC
Happens for me as well, with

$ mono --version
Mono JIT compiler version 2.10.9 (tarball Tue Mar 20 15:31:37 EDT 2012)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com

and the bundled gtk
Comment 4 Mikayla Hutchinson [MSFT] 2012-04-23 07:23:17 UTC
Full version info from the about box, please - there are multiple builds of Mono 2.10.9 package with different GTK+ versions.

However, this sounds like a text editor bug. Can you repro with MD 2.8.x on the same Mono?
Comment 5 Mike Krüger 2012-04-24 02:24:06 UTC
I've worked the whole day with the mac version and couldn't repro it.
Comment 6 Marek Habersack 2012-04-24 06:55:30 UTC
It happened to me quite a few times last night, while hacking on a MonoTouch project. Full version info:

MonoDevelop 2.9.5
Installation UUID: b89881f1-4ca3-40ae-824e-87cd657334d5
	Mono 2.10.9 (tarball Tue Mar 20 15:31:37 EDT 2012)
	GTK 2.24.10
	GTK# (
Apple Developer Tools:
	 Xcode 4.3.2 (1177)
	 Build 4E2002
Monotouch: 5.2.11
Mono for Android:
Build information:
	Release ID: 20905000
	Git revision: b180fd06567eabe9968cdf9723fa1f8ba7476e93-dirty
	Build date: 2012-04-23 16:47:37+0000
	Xamarin addins: 54aebec5f70ddcb025d2082040bd4982ec79bd6d
Operating System:
	Mac OS X 10.7.3
	Darwin higgs.local 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64
Loaded assemblies:
ICSharpCode.SharpZipLib    /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/ICSharpCode.SharpZipLib/
Xamarin.Ide.Mac        /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/Xamarin.Ide/Xamarin.Ide.Mac.dll
MonoDevelop.GtkCore     /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.GtkCore/MonoDevelop.GtkCore.dll
Mono.Security          /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/Mono.Security/
libsteticui            /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.GtkCore/libsteticui.dll
libstetic              /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.GtkCore/libstetic.dll
nunit.util         /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/NUnit/nunit.util.dll
nunit.framework    /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/NUnit/nunit.framework.dll
nunit.core.interfaces /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/NUnit/nunit.core.interfaces.dll
nunit.core         /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/NUnit/nunit.core.dll
MonoDevelop.NUnit      /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/NUnit/MonoDevelop.NUnit.dll
Mono.Cairo             /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/Mono.Cairo/
MonoDeveloperExtensions     /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDeveloperExtensions/MonoDeveloperExtensions.dll
Mono.Debugging         /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/bin/Mono.Debugging.dll
pango-sharp           /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/pango-sharp/
MonoDevelop.CSharpBinding     /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/BackendBindings/MonoDevelop.CSharpBinding.dll
MonoDevelop.Refactoring     /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Refactoring/MonoDevelop.Refactoring.dll
MonoDevelop.Moonlight     /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Moonlight/MonoDevelop.Moonlight.dll
monodoc                /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/monodoc/
MonoDevelop.AspNet     /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.AspNet/MonoDevelop.AspNet.dll
MonoDevelop.XmlEditor     /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor.dll
MonoDevelop.Deployment     /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Deployment/MonoDevelop.Deployment.dll
System.Drawing         /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/System.Drawing/
Mono.Cecil             /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/bin/Mono.Cecil.dll
MonoDevelop.MonoDroid    /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoDroid/MonoDevelop.MonoDroid.dll
Mono.AndroidTools      /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoDroid/Mono.AndroidTools.dll
MonoDevelop.IPhone     /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.IPhone/MonoDevelop.IPhone.dll
MonoDevelop.MacDev     /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MacDev/MonoDevelop.MacDev.dll
MonoDevelop.DesignerSupport     /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.dll
MacPlatform            /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/MacPlatform.dll
MonoMac                /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/MonoMac.dll
MonoDevelop.VersionControl     /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/VersionControl/MonoDevelop.VersionControl.dll
MonoDevelop.SourceEditor2     /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/DisplayBindings/SourceEditor/MonoDevelop.SourceEditor2.dll
MonoDevelop.Debugger     /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.Debugger/MonoDevelop.Debugger.dll
Xamarin.Ide            /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/AddIns/Xamarin.Ide/Xamarin.Ide.dll
System.Configuration     /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/System.Configuration/
ICSharpCode.NRefactory     /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/bin/ICSharpCode.NRefactory.dll
gdk-sharp             /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/gdk-sharp/
Mono.TextEditor        /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/bin/Mono.TextEditor.dll
atk-sharp             /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/atk-sharp/
glib-sharp            /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/glib-sharp/
gtk-sharp             /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/gtk-sharp/
Mono.Posix             /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/Mono.Posix/
Mono.Addins            /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/Mono.Addins/
Mono.Addins.Setup      /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/Mono.Addins.Setup/
System.Xml             /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/System.Xml/
System.Xml.Linq        /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/System.Xml.Linq/
System.Core            /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/System.Core/
System                 /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/System/
MonoDevelop.Core       /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/bin/MonoDevelop.Core.dll
MonoDevelop.Ide        /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/bin/MonoDevelop.Ide.dll
MonoDevelop            /Applications/MonoDevelop Master.app/Contents/MacOS/lib/monodevelop/bin/MonoDevelop.exe
mscorlib               /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/mscorlib.dll
Comment 7 Alan McGovern 2012-04-24 07:20:40 UTC
I can no longer repro this with 2.10.9_10 . I'll keep trying though.
Comment 8 Chris Hardy [MSFT] 2012-04-25 16:36:52 UTC
I get the same issue here: http://screencast.com/t/Rvdy3k7D

MonoDevelop 2.9.6
Installation UUID: bfe4d389-101c-473e-bbcd-d2e0678bb8bb
	Mono 2.10.9 (tarball Tue Mar 20 15:31:37 EDT 2012)
	GTK 2.24.10
	GTK# (
Apple Developer Tools:
	 Xcode 4.3.2 (1177)
	 Build 4E2002
Mono for Android:
Android SDK: /Users/chrisntr/Library/Developer/Xamarin/android-sdk-mac_x86
Supported Android versions:
	Version: 1.6	ApiLevel: 4
	Version: 2.1	ApiLevel: 7
	Version: 2.2	ApiLevel: 8
	Version: 2.3	ApiLevel: 10
	Version: 3.1	ApiLevel: 12
	Version: 4.0	ApiLevel: 14
	Version: 4.0.3	ApiLevel: 15
Java SDK: /usr/bin

Monotouch: 5.2.11 (Evaluation)
Build information:
	Release ID: 20906000
	Git revision: e970f9fefabd2b1680df1a4d1c3b8d2d627659e7-dirty
	Build date: 2012-04-25 17:10:39+0000
	Xamarin addins: 80e247455ee40db3fed8b2fe30fe219244604c5c
Operating System:
	Mac OS X 10.7.3
	Darwin Chris-MacBook-Air.local 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64
Loaded assemblies:
Comment 9 Marek Habersack 2012-04-26 04:51:12 UTC
Alan, I had it happen once with 2.10.9_10 - so there's some improvement but it's still there.
Comment 10 Mike Krüger 2012-04-26 06:23:59 UTC
More traces are in #4651.

*** This bug has been marked as a duplicate of bug 4651 ***
Comment 11 Alan McGovern 2012-04-26 06:30:23 UTC
These bugs are completely separate. The focus issue can appear dozens and dozens of times with no crash. The crash in 4651 is an issue we are trying to track down but as of yet have no idea what is causing it.
Comment 12 Mikayla Hutchinson [MSFT] 2012-04-27 15:54:51 UTC
When this happens, are there any gdk warnings in the MD logs?
Comment 13 Mikayla Hutchinson [MSFT] 2012-04-27 17:08:34 UTC
I've been seeing this a bit. It looks like the code completion window is taking a grab and not releasing it in some cases. Sometimes when the code completion window pops up again after this bug occurs, it still has some kind of grab, because moving the mouse over it causes it to scroll as if it were dragging.
Comment 14 Marek Habersack 2012-04-30 06:08:47 UTC
(In reply to comment #12)
> When this happens, are there any gdk warnings in the MD logs?

none for me
Comment 15 Mikayla Hutchinson [MSFT] 2012-05-02 11:28:03 UTC
This appears to only happen since newresolver. The relevant change appears to be that the code completion window is *hidden*, not *destroyed*. This is more efficient as it doesn't have to be recreated, so makes code completion faster. 

My current theory is that the GTK window takes a grab when shown and doesn't always correctly release it when hidden. This then - in some circumstances - triggers bug 4651.

For now, we changed the code completion code to destroy the window.
Comment 16 Mike Krüger 2012-05-07 00:17:34 UTC
*** Bug 4684 has been marked as a duplicate of this bug. ***
Comment 17 John Costella 2012-05-07 01:42:10 UTC
Created attachment 1811 [details]
Screen dump 1: before deletion

I don't know if the following is the same bug (or related to Bug 4684 which may or may not actually be a dupe of this one) but I'm hoping this will be useful.

MD 2.9.5 alpha

Scenario: had typed 'var main = DihMemberIds' (the rest of the line was going to make it 'var main = DihMemberIds(0);' or something like that). Decided I would call the variable 'all' instead of 'main', so ctrl-lefted to the start of 'main' and typed 'all'. 

State of editor (just the relevant bit shown, for confidentiality) shown in 'pre-del.png'.

Then I hit Ctrl-Delete to delete 'main'. Nothing happened, then after one second, the 'm' of main turned to whitespace, with the rest unchanged (i.e. 'main' changed to ' ain'). I'll attach this in the next attachment.

Then, if I click the mouse somewhere else (even in another app on a different screen), the rest of the 'Ctrl-Delete' word deletion actually takes place. (See third attachment) (Clicking a key like 'End' also makes it happen.)

It seems like there are repaint triggers missing or blocked for the editor redrawing.

This behaviour occurred over and over if I did the same thing to the same line, but doesn't happen if I do it elsewhere. (And completing the line of code with '(0);' so that it is syntactically correct -- red squiggle gone and compiles -- doesn't stop the same thing happening either.)

As I said, not sure if this is the same bug or related.
Comment 18 John Costella 2012-05-07 01:43:12 UTC
Created attachment 1812 [details]
Screendump 2: after hitting Ctrl-Delete

See above description
Comment 19 John Costella 2012-05-07 01:44:07 UTC
Created attachment 1813 [details]
Screendump 3: after clicking mouse

See description above
Comment 20 Mike Krüger 2012-05-07 01:49:59 UTC
John Costella: It might be a side effect of another program.
Comment 21 Kristian Rietveld (inactive) 2012-05-13 12:27:08 UTC
(Comment 15)
> My current theory is that the GTK window takes a grab when shown and doesn't
> always correctly release it when hidden. This then - in some circumstances -
> triggers bug 4651.

I have tried a small test where a popup was shown/hidden every 50 milliseconds and on every key press. The popup contains an entry which grabbed  focus when shown. This didn't trigger anything special, so I guess I am still missing a bit of the behavior in MonoDevelop that triggers the crashes ...
Comment 22 John Costella 2012-05-13 19:45:07 UTC
MD alpha went to 3.0.0 beta yesterday (but the auto-updater didn't work, as usual) so I'll monitor today (now = Monday morning) how 3.0.0 beta behaves. 

Mike Krüger: When it happens I'll try to shut everything else down that I can without disrupting my system too much (i.e. close all other open apps at least). I don't see this happening in any other app, though.
Comment 23 Duncan Mak 2012-05-13 20:28:37 UTC
(In reply to comment #22)
> MD alpha went to 3.0.0 beta yesterday (but the auto-updater didn't work, as
> usual) so I'll monitor today (now = Monday morning) how 3.0.0 beta behaves. 

How is the auto-updater not working? Where does it stop?
Comment 24 John Costella 2012-05-13 20:29:34 UTC
Got the same behaviour (ctrl-delete delayed reaction) with MD 3.0.0 beta. Shut down every other application and tried again: same result (repeatable).

WAIT: On a hunch I undocked the machine from the docking station. The problem went away. Re-docking, the problem has not immediately returned (for that same line of text I was undoing and retrying).

OK, that throws attention on the docked configuration. 

The monitor configuration is as follows: laptop (1600 x 900) on the right, external monitor (1080 x 1920, Portrait) on the left. Laptop is the primary screen (has the taskbar). (I'll attach a photo of the layout and a screendump of the display properties window shortly.)

Since I've been running MD on Windows (from Sep 2011, stable version until the last week), when I launch MD the blue splash screen shows in the middle of the primary (laptop) display, but MD itself fires up on the secondary (external) display. As I use MD in Landscape orientation, I have to manually drag it across from the external monitor to the laptop monitor, every time. (MD doesn't remember this setting, unfortunately.)

I have noticed recently that sometimes the beige pop-up suggestion box appears to the left of the laptop monitor, i.e. on the external monitor. That's nice (keeps it out of the way) but I don't think MD ever used to go onto another monitor.

I'm wondering whether MD's repainting is getting confused when the display real estate isn't a simple single rectangular display?
Comment 25 John Costella 2012-05-13 20:35:48 UTC
@Duncan Mak: It told me of the update, downloaded it, then said it was going to update and restart MD. When it restarted, MD was still 2.9.5 (splash screen said so, as did About). I went back into Help / Check for Updates and it claimed to be up to date.

Easiest solution is just to go back to the MD web page and download the installer and install it, which I did. Splash screen and About now both say 3.0.0.

I think the auto-updater might have worked a couple of times in the past eight months, but the other times required this reinstall. Installer seems to clean up old versions nicely. (Sometimes I explicitly uninstall first, but I'm wary of losing settings.)
Comment 26 John Costella 2012-05-13 20:39:11 UTC
Created attachment 1872 [details]
Photo of docked display configuration
Comment 27 John Costella 2012-05-13 20:40:43 UTC
Created attachment 1873 [details]
Screendump of display settings
Comment 28 John Costella 2012-05-14 05:00:05 UTC
@Duncan Mak: Further information: when I fired up MD this evening, About box confirmed 3.0.0. I went into "Check for Updates" and it started downloading 2.9.5!

I guess this makes some (perverted) sense if 3.0.0 is actually beta (as stated on the website) and 2.9.5 is the latest alpha that the auto-updater knows about (it still says it is on the Alpha channel) ... but then again 2.9.5 alpha itself tried to download 3.0.0 ... (this is getting murky!).

Right now I've paused the download and unchecked the "Check automatically" box.
Comment 29 John Costella 2012-05-14 05:42:42 UTC
I've found that the problem occurred again in undocked mode. I even rebooted the machine (so it didn't have any immediate 'memory' of being docked) and it still occurs, with just the laptop screen.
Comment 30 Mikayla Hutchinson [MSFT] 2012-05-14 10:56:59 UTC
John, can we please keep this on topic? This bug is specific to grab issues on the Mac caused by the code completion window. Your Windows redraw bug is bug 4684, and if you're having issues with the updater could you please open a new bug for that?
Comment 31 John Costella 2012-05-14 18:55:55 UTC
Mike, apologies. I thought it'd been marked as a duplicate. The updater was in answer to a question.
Comment 32 Mikayla Hutchinson [MSFT] 2012-05-14 19:52:11 UTC
Yes, sorry for the confusion - Mike Krüger incorrectly marked it as a duplicate, but it's a different issue. I reopened it so it's separate again. We do want more information on your bug, we just want to be able to keep track of what's what :)
Comment 33 John Costella 2012-05-14 20:07:18 UTC
No worries, mate. Just move anything out of place to the right bug. This morning 3.0 stable is out (internal v3.0.1) so I'll investigate using that.
Comment 34 Mike Krüger 2012-10-25 03:37:33 UTC
closing - should be fixed.