summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2011-02-20 17:53:04 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2011-02-20 17:53:04 +0800
commit64be74d58b052a22ccb8fb7c0f4889967fc7962f (patch)
tree1c717491930c21d6c9fa5db7d62fa6379668f185
parenta1d3e2a8b7b1191c2388063aa59d26375ae05b61 (diff)
downloadcompiz-with-glib-mainloop-64be74d58b052a22ccb8fb7c0f4889967fc7962f.tar.gz
compiz-with-glib-mainloop-64be74d58b052a22ccb8fb7c0f4889967fc7962f.tar.bz2
Set default value for vpSize before loading plugins.
There is a race where vpSize won't be updated to its "true value" until we reach core's option change callback or we read the value from the configuration plugin. Since we load all the plugins at once on screenInitPlugins on the command line, some plugins require that this value be set to *something* (It can be changed later) before they are initialized. Fixes incorrect vertex settings with cube, causing it to zoom out infinitely when switching viewports when loaded when compiz starts
-rw-r--r--src/screen.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/screen.cpp b/src/screen.cpp
index 8c93249..bf02566 100644
--- a/src/screen.cpp
+++ b/src/screen.cpp
@@ -4581,6 +4581,13 @@ CompScreen::init (const char *name)
priv->addScreenActions ();
+ /* Need to set a default here so that the value isn't uninitialized
+ * when loading plugins FIXME: Should find a way to initialize options
+ * first and then set this value, or better yet, tie this value directly
+ * to the option */
+ priv->vpSize.setWidth (priv->optionGetHsize ());
+ priv->vpSize.setHeight (priv->optionGetVsize ());
+
priv->initialized = true;
/* TODO: Bailout properly when screenInitPlugins fails
@@ -4594,6 +4601,9 @@ CompScreen::init (const char *name)
/* The active plugins list might have been changed - load any
* new plugins */
+ priv->vpSize.setWidth (priv->optionGetHsize ());
+ priv->vpSize.setHeight (priv->optionGetVsize ());
+
if (priv->dirtyPluginList)
priv->updatePlugins ();
@@ -4623,9 +4633,6 @@ CompScreen::init (const char *name)
}
}
- priv->vpSize.setWidth (priv->optionGetHsize ());
- priv->vpSize.setHeight (priv->optionGetVsize ());
-
/* enforce restack on all windows */
for (CompWindowList::reverse_iterator rit = priv->windows.rbegin ();
rit != priv->windows.rend (); rit++)