summaryrefslogtreecommitdiffstats
path: root/src/gui/App.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-11-27 01:45:38 +0000
committerDavid Robillard <d@drobilla.net>2008-11-27 01:45:38 +0000
commitca3bd4c24b7db71b774a560dc4089321d74fee4d (patch)
treee333db8312819e9077c8b81ffbbf4a101f2d32b9 /src/gui/App.cpp
parent9b9a6c9e3eb8da7eb1decd963a6c2f0e69b57ed4 (diff)
downloadingen-ca3bd4c24b7db71b774a560dc4089321d74fee4d.tar.gz
ingen-ca3bd4c24b7db71b774a560dc4089321d74fee4d.tar.bz2
ingen-ca3bd4c24b7db71b774a560dc4089321d74fee4d.zip
Fix orphan etc. errors for 'ingen -egl' (fix ticket #201).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1784 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/App.cpp')
-rw-r--r--src/gui/App.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index 565a976e..4b6abc4a 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -62,6 +62,7 @@ namespace GUI {
class Port;
+Gtk::Main* App::_main = 0;
/// Singleton instance
App* App::_instance = 0;
@@ -95,10 +96,10 @@ App::~App()
}
void
-App::run(int argc, char** argv, Ingen::Shared::World* world)
+App::init(int argc, char** argv, Ingen::Shared::World* world)
{
Gnome::Canvas::init();
- Gtk::Main main(argc, argv);
+ _main = new Gtk::Main(argc, argv);
if (!_instance)
_instance = new App(world);
@@ -135,9 +136,20 @@ App::run(int argc, char** argv, Ingen::Shared::World* world)
Gtk::RC::parse_string(rc_style);
App::instance().connect_window()->start(world);
-
- main.run();
+ // Run main iterations here until we're attached to the engine
+ // (otherwise with 'ingen -egl' we'll get a bunch of notifications about load immediately
+ // before even knowing about the root patch or plugins)
+ while (!App::instance().connect_window()->attached())
+ _main->iteration();
+}
+
+
+void
+App::run()
+{
+ assert(_main);
+ _main->run();
cout << "Gtk exiting." << endl;
}