[MonoDevelop] Closing dialog windows from my addin freezes MonoDevelop

Scott Ellington scottellington at comcast.net
Sun Oct 2 16:28:48 EDT 2005

The thing that has confused me is that my event handler *is* running in
the Gui thread, and yet I am still having problems.  Like I said, I
tried using the MonoDevelop threading tools, but obviously these won't
help if I'm already in the Gui thread.

What I think is happening is that Gecko# WebControl widget is spawning a
new thread and that thread is interacting directly with the MonoDevelop
Gui thread.  Since Gecko# does not use MonoDevelop's GuiDispatch
threading tools, there may be some sort of conflict.  Might this be a
possibility?  More evidence to this idea is that I can use this same
gecko# functionality in a simple Gtk# test application without any

And so, assuming this is the problem, by using Gdk.Threads.Enter() and
Leave() I lock Gecko# out of the Gui thread while I am creating my


On Fri, 2005-09-30 at 17:31 -0700, Todd Berman wrote:
> On Fri, 2005-09-30 at 14:08 -0400, Scott Ellington wrote: 
> > I figured this out.  It was a threading issue.  I needed to call
> > Gdk.Threads.Enter() and Leave() as so:
> > 
> > Gdk.Threads.Enter();
> > Runtime.Gui.CommandService.CommandManager.DispatchCommand(FileCommands.NewProject);
> > Gdk.Threads.Leave();
> > 
> > Would it be a good idea for DispatchCommand to call these methods?
> > 
> No. If you have to use that, something is truly broken.
> Whatever code you are calling needs to use the existing in place methods
> for changing threads instead of calling enter and leave, as these do
> have their own issues (go look at the gdk docs for examples).
> At least, that is my understanding. Lluis may be able to give you better
> info.
> --Todd
Scott Ellington <scottellington at comcast.net>

More information about the Monodevelop-list mailing list