From 7a7d7007892eb5d3aca8f8f6edc7ac34ab68a14b Mon Sep 17 00:00:00 2001 From: gouldtj Date: Sat, 1 Sep 2007 04:36:12 +0000 Subject: [PATCH] r16443@tres: ted | 2007-08-30 22:22:32 -0700 Pump some GTK events so that there is more interactivity. --- src/extension/implementation/script.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 98ea9fcee..7a6b5ce5a 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -75,7 +75,11 @@ namespace Inkscape { namespace Extension { namespace Implementation { - +void pump_events (void) { + while( Gtk::Main::events_pending() ) + Gtk::Main::iteration(); + return; +} //Interpreter lookup table struct interpreter_t { @@ -719,6 +723,8 @@ Script::effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *do Inkscape::Extension::db.get(SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE), doc->doc(), tempfilename_in.c_str(), FALSE, FALSE, FALSE); + pump_events(); + if (desktop != NULL) { Inkscape::Util::GSListConstIterator selected = sp_desktop_selection(desktop)->itemList(); @@ -735,6 +741,8 @@ Script::effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *do int data_read = execute(command, params, tempfilename_in, fileout); fileout.toFile(tempfilename_out); + pump_events(); + SPDocument * mydoc = NULL; if (data_read > 10) { mydoc = Inkscape::Extension::open( @@ -742,6 +750,8 @@ Script::effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *do tempfilename_out.c_str()); } // data_read + pump_events(); + // make sure we don't leak file descriptors from g_file_open_tmp close(tempfd_in); close(tempfd_out); -- 2.30.2