summaryrefslogtreecommitdiff
path: root/src/screen.cpp
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@compiz-fusion.org>2009-03-16 02:50:56 +0100
committerDennis kasprzyk <onestone@compiz-fusion.org>2009-03-16 02:50:56 +0100
commit9491dfd89a24de4db22f371f5723347d82222a4d (patch)
treee52d2e912fb202e8c3d9a2e23c3e1a7f9f30b801 /src/screen.cpp
parent73052cf920028426bebf2eb1def1cb2c3cf6bbc4 (diff)
downloadunity-window-decorator-9491dfd89a24de4db22f371f5723347d82222a4d.tar.gz
unity-window-decorator-9491dfd89a24de4db22f371f5723347d82222a4d.tar.bz2
Don't crash if PrivateScreen is not initialized.
Set the right option.
Diffstat (limited to 'src/screen.cpp')
-rw-r--r--src/screen.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/screen.cpp b/src/screen.cpp
index fbfedda..57baaf2 100644
--- a/src/screen.cpp
+++ b/src/screen.cpp
@@ -68,6 +68,8 @@ static unsigned int virtualModMask[] = {
bool inHandleEvent = false;
+bool screenInitalized = false;
+
CompScreen *targetScreen = NULL;
CompOutput *targetOutput;
@@ -736,7 +738,7 @@ PrivateScreen::setOption (const CompString &name,
if (optionGetVsize () * screen->height () > MAXSHORT)
return false;
- setVirtualScreenSize (optionGetHsize (), optionGetHsize ());
+ setVirtualScreenSize (optionGetHsize (), optionGetVsize ());
break;
case CoreOptions::NumberOfDesktops:
setNumberOfDesktops (optionGetNumberOfDesktops ());
@@ -1964,7 +1966,7 @@ PrivateScreen::detectOutputDevices ()
}
mOptions[CoreOptions::DetectOutputs].value ().set (false);
- screen->setOptionForPlugin ("core", "detect_outputs", value);
+ screen->setOptionForPlugin ("core", "outputs", value);
mOptions[CoreOptions::DetectOutputs].value ().set (true);
}
@@ -3049,7 +3051,7 @@ PrivateScreen::addScreenActions ()
bool
CompScreen::addAction (CompAction *action)
{
- if (!priv->initialized)
+ if (!screenInitalized || !priv->initialized)
return false;
if (action->type () & CompAction::BindingTypeKey)
@@ -4101,10 +4103,12 @@ CompScreen::screenInfo ()
}
CompScreen::CompScreen ():
- PluginClassStorage (screenPluginClassIndices)
+ PluginClassStorage (screenPluginClassIndices),
+ priv (NULL)
{
priv = new PrivateScreen (this);
assert (priv);
+ screenInitalized = true;
}
bool