diff options
author | Lluis Sanchez <lluis@xamarin.com> | 2013-11-14 19:06:04 +0400 |
---|---|---|
committer | Lluis Sanchez <lluis@xamarin.com> | 2013-11-14 19:06:04 +0400 |
commit | 4985e4507387544f2da5b6ab33e75bd0d6d7295f (patch) | |
tree | 34bc386ea6634386010a36416cbdca26ffd52daa /Xwt.Gtk | |
parent | b2680e123a5de6d44e9515cc10faf491431c122f (diff) |
Fixes to match new closing event behavior for Dialog
Diffstat (limited to 'Xwt.Gtk')
-rw-r--r-- | Xwt.Gtk/Xwt.GtkBackend/DialogBackend.cs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/Xwt.Gtk/Xwt.GtkBackend/DialogBackend.cs b/Xwt.Gtk/Xwt.GtkBackend/DialogBackend.cs index 19815997..cf2387de 100644 --- a/Xwt.Gtk/Xwt.GtkBackend/DialogBackend.cs +++ b/Xwt.Gtk/Xwt.GtkBackend/DialogBackend.cs @@ -129,16 +129,19 @@ namespace Xwt.GtkBackend bool keepRunning; do { - MessageService.RunCustomDialog (Window, p != null ? p.Window : null); + var res = MessageService.RunCustomDialog (Window, p != null ? p.Window : null); keepRunning = false; - ApplicationContext.InvokeUserCode(delegate { - keepRunning = !EventSink.OnCloseRequested (); - }); + if (res == (int) Gtk.ResponseType.DeleteEvent) { + ApplicationContext.InvokeUserCode(delegate { + keepRunning = !EventSink.OnCloseRequested (); + }); + if (!keepRunning) { + ApplicationContext.InvokeUserCode(delegate { + EventSink.OnClosed (); + }); + } + } } while (keepRunning); - - ApplicationContext.InvokeUserCode(delegate { - EventSink.OnClosed (); - }); } public void EndLoop () |