Ensure that Extension::init() is only performed once

And call init from Workspace ctor before it gets called
somewhere else (e.g. in the compositor).

REVIEW: 104578
This commit is contained in:
Martin Gräßlin 2012-04-13 08:39:04 +02:00
parent 3ed63d4c45
commit ed7d612ef3
2 changed files with 9 additions and 1 deletions

View file

@ -76,6 +76,10 @@ void Extensions::addData(const char* name)
void Extensions::init()
{
static bool initPerformed = false;
if (initPerformed) {
return;
}
int event_base, error_base;
data_nextensions = 0;
shape_version = 0;
@ -135,6 +139,7 @@ void Extensions::init()
<< " render: 0x" << QString::number(render_version, 16)
<< " fixes: 0x" << QString::number(fixes_version, 16)
<< " non_native_pixmaps: " << non_native_pixmaps << endl;
initPerformed = true;
}
void Extensions::fillExtensionsData(const char**& extensions, int& nextensions, int*&opcodes, int*& error_bases)

View file

@ -174,6 +174,10 @@ Workspace::Workspace(bool restore)
desktopGrid_[1] = 0;
_self = this;
// first initialize the extensions
Extensions::init();
// PluginMgr needs access to the config file, so we need to wait for it for finishing
reparseConfigFuture.waitForFinished();
options->loadConfig();
@ -219,7 +223,6 @@ Workspace::Workspace(bool restore)
ExposureMask
);
Extensions::init();
compositingSuspended = !options->isUseCompositing();
#ifdef KWIN_BUILD_TABBOX
// need to create the tabbox before compositing scene is setup