diff options
Diffstat (limited to 'unity-shared')
| -rw-r--r-- | unity-shared/PluginAdapter.cpp | 13 | ||||
| -rw-r--r-- | unity-shared/PluginAdapter.h | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/unity-shared/PluginAdapter.cpp b/unity-shared/PluginAdapter.cpp index 10573db86..4470fcddf 100644 --- a/unity-shared/PluginAdapter.cpp +++ b/unity-shared/PluginAdapter.cpp @@ -55,9 +55,18 @@ PluginAdapter& PluginAdapter::Default() } /* static */ -void PluginAdapter::Initialize(CompScreen* screen) +PluginAdapter& PluginAdapter::Initialize(CompScreen* screen) { - global_instance.reset(new PluginAdapter(screen)); + if (!global_instance) + { + global_instance.reset(new PluginAdapter(screen)); + } + else + { + LOG_ERROR(logger) << "Already Initialized!"; + } + + return *global_instance; } PluginAdapter::PluginAdapter(CompScreen* screen) diff --git a/unity-shared/PluginAdapter.h b/unity-shared/PluginAdapter.h index e5c14c7d0..d0a2ec7d7 100644 --- a/unity-shared/PluginAdapter.h +++ b/unity-shared/PluginAdapter.h @@ -60,7 +60,7 @@ public: // You shouldn't get the PluginAdapter if you really want a WindowManager. // The PluginAdapter::Default should really only be called from within unityshell plugin. static PluginAdapter& Default(); - static void Initialize(CompScreen* screen); + static PluginAdapter& Initialize(CompScreen* screen); nux::Property<bool> bias_active_to_viewport; |
