GtkSharp/gtk
Rickard Edström 8e07e7d225 Add a SynchronizationContext implementation for GLib (bnc#621444)
Create a GLibSynchronizationContext that sends code to be run on the
GLib main loop, and set it as the current SynchronizationContext in
Gtk.Init().

When you use the await keyword to do a task asynchronously, by default
the awaiter will capture the current SynchronizationContext, and if
there was one, when the task completes it’ll Post the supplied
continuation back to that context, rather than running it on whatever
thread it wants.

This means that if you use the async/await keywords in your Gtk# app,
things will now work as expected with the GTK main thread. For example:

static async void DoWork () // called in the GTK main thread
{
    // Do some stuff with the UI...
    label.Text = "Starting Work";

    // Run something asynchronously, UI is not frozen
    int res = await DoLongOperation ();

    // Do some more UI stuff, it'll run on the GTK main thread
    label.Text = "Work done";
}

Signed-off-by: Bertrand Lorentz <bertrand.lorentz@gmail.com>
2012-11-08 22:33:46 +01:00
..
glue Fix stack overflow in subclasses of managed containers 2012-10-13 15:06:51 +02:00
gui-thread-check gui-thread-check: Fix some compilation warnings 2012-11-04 18:16:22 +01:00
.gitignore Flatten the bootstrap and remove glade-sharp 2010-11-21 21:18:06 -06:00
Accel.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
AccelKey.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
Action.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
ActionEntry.cs 2004-11-26 Jeroen Zwartepoorte <jeroen@xs4all.nl> 2004-11-26 14:59:38 +00:00
ActionGroup.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
Adjustment.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
Application.cs Add a SynchronizationContext implementation for GLib (bnc#621444) 2012-11-08 22:33:46 +01:00
Bin.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
BindingAttribute.cs 2004-12-23 Mike Kestner <mkestner@novell.com> 2004-12-23 22:59:59 +00:00
Builder.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
Button.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
Calendar.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
CellAreaBox.cs The rest of the first pass. 2011-02-08 22:15:37 -06:00
CellLayout.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
CellLayoutAdapter.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
CellRenderer.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
CellView.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
CheckMenuItem.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
ChildPropertyAttribute.cs Redo child property handling; now we generate classes to hold 2004-11-18 20:31:22 +00:00
Clipboard.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
ColorSelection.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
ComboBox.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
ComboBoxText.cs gtk: Fix creation of ComboBox and ComboBoxText subclasses with entry 2011-12-05 19:14:05 +01:00
Container.cs gtk: Move interface declaration from fix-up to custom code 2012-11-03 17:50:05 +01:00
Dialog.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
Drag.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
Entry.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
EntryCompletion.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
FileChooserDialog.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
Frame.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
Global.cs Move new ShowUri API to partial class. 2011-04-18 11:49:17 -05:00
gtk-api.raw parser: Add property support for ginterface 2011-08-01 21:18:02 +02:00
gtk-sharp-3.0.pc.in Add gio-sharp dep to gtk-sharp pc file 2011-07-18 12:44:44 -05:00
gtk-sharp.dll.config.in Update to Gtk+ 3.0.0 API. 2011-02-12 15:30:20 -06:00
gtk-symbols.xml 2004-03-12 Mike Kestner <mkestner@ximian.com> 2004-03-12 21:18:11 +00:00
gtk.csproj Add a MonoDevelop solution and projects for browsing the codebase 2012-10-13 16:44:10 +02:00
Gtk.metadata gtk: Move interface declaration from fix-up to custom code 2012-11-03 17:50:05 +01:00
HBox.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
HScale.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
IconFactory.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
IconSet.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
IconTheme.cs gtk: Switch to generic collections in some classes 2012-11-04 16:58:50 +01:00
IconView.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
Image.cs gtk: Switch to generic collections in some classes 2012-11-04 16:58:50 +01:00
ImageMenuItem.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
Init.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
ITreeNode.cs Re-fix for yesterday's fix that didn't actually work. 2005-03-15 15:49:30 +00:00
Key.cs dllimport libname updates for Gtk. 2011-02-09 16:54:12 -06:00
Label.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
ListStore.cs gtk: Move interface declaration from fix-up to custom code 2012-11-03 17:50:05 +01:00
Makefile.am gui-thread-check: Merge config/build infrastructure with gtk-sharp 2012-11-04 00:32:09 +00:00
Menu.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
MenuItem.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
MessageDialog.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
NodeCellDataFunc.cs 2009-03-04 Christian Hoff <christian_hoff@gmx.net> 2009-03-04 20:33:12 +00:00
NodeSelection.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
NodeStore.cs gtk: Switch to generic collections in some classes 2012-11-04 16:58:50 +01:00
NodeView.cs gtk: Re-enable NodeView.CreateRowDragIcon method 2011-07-03 16:44:15 +02:00
Notebook.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
PaperSize.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
Plug.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
Printer.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
RadioActionEntry.cs 2004-11-26 Jeroen Zwartepoorte <jeroen@xs4all.nl> 2004-11-26 14:59:38 +00:00
RadioButton.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
RadioMenuItem.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
RadioToolButton.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
RecentManager.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
RowsReorderedHandler.cs 2007-04-17 Mike Kestner <mkestner@novell.com> 2007-04-17 17:42:58 +00:00
ScrolledWindow.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
SelectionData.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
Settings.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
SpinButton.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
StatusIcon.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
Stock.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
StockItem.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
StockManager.cs dllimport libname updates for Gtk. 2011-02-09 16:54:12 -06:00
Style.cs gtk: Remove commented-out code from Gtk.Style 2012-08-05 19:42:34 +02:00
StyleContext.cs Add the gtk_render_* methods to StyleContext 2011-04-21 12:10:36 -05:00
Target.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
TargetEntry.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
TargetList.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
TextAttributes.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
TextBuffer.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
TextChildAnchor.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
TextIter.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
TextMark.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
TextTag.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
TextView.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
ThreadNotify.cs 2004-06-25 Mike Kestner <mkestner@ximian.com> 2004-06-25 18:42:19 +00:00
ToggleActionEntry.cs 2004-11-26 Jeroen Zwartepoorte <jeroen@xs4all.nl> 2004-11-26 14:59:38 +00:00
TreeEnumerator.cs 2005-05-16 Mike Kestner <mkestner@novell.com> 2005-05-16 19:07:27 +00:00
TreeIter.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
TreeMenu.cs The rest of the first pass. 2011-02-08 22:15:37 -06:00
TreeModel.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
TreeModelAdapter.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
TreeModelFilter.cs gtk: Add license header in TreeModelFilter.cs 2012-08-05 19:06:18 +02:00
TreeModelSort.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
TreeNode.cs * gtk/TreeNode.cs: Add Interlocked.Increment rather than ++. This 2005-08-22 17:11:37 +00:00
TreeNodeAttribute.cs 2005-09-02 Ben Maurer <bmaurer@ximian.com> 2005-09-02 22:04:05 +00:00
TreeNodeValueAttribute.cs 2005-09-02 Ben Maurer <bmaurer@ximian.com> 2005-09-02 22:04:05 +00:00
TreePath.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
TreeSelection.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
TreeStore.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
TreeView.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
TreeViewColumn.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
UIManager.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
VBox.cs gtk: Re-indent code that was moved inside partial classes 2012-08-05 17:24:05 +02:00
Viewport.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
VScale.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00
Widget.cs gtk: Switch to generic collections in some classes 2012-11-04 16:58:50 +01:00
Window.cs gtk: Move all .custom files to partial classes 2012-08-05 16:32:41 +02:00