summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKimmo Hämäläinen <kimmo.hamalainen@nokia.com>2010-10-14 12:08:44 +0300
committerKimmo Hämäläinen <kimmo.hamalainen@nokia.com>2010-10-14 12:08:44 +0300
commit26d8eebe44fc6f28afe49f5e3d9a78ba41a356bd (patch)
tree3fd7117af6bb9ba21ca3b1903985cda2d1b12288
parent975ccea8f404febb1f0c62c15b2b6f22fe858c12 (diff)
Fixes: NB#196385 - Display is not updated correctly after screen blank on-off sequence, take two
- also set followsCurrentApplicationWindowOrientation property for NB#179761
-rw-r--r--decorators/mdecorator/mdecoratorwindow.cpp13
-rw-r--r--src/mcompositemanager.cpp27
2 files changed, 26 insertions, 14 deletions
diff --git a/decorators/mdecorator/mdecoratorwindow.cpp b/decorators/mdecorator/mdecoratorwindow.cpp
index 92347a0..d6ab04a 100644
--- a/decorators/mdecorator/mdecoratorwindow.cpp
+++ b/decorators/mdecorator/mdecoratorwindow.cpp
@@ -73,10 +73,10 @@ protected:
virtual void activateEvent() {
}
- virtual void setAutoRotation(bool mode) {
- decorwindow->setOrientationAngleLocked(!mode);
- if (!mode)
- decorwindow->setOrientationAngle(M::Angle0);
+ virtual void setAutoRotation(bool mode)
+ {
+ Q_UNUSED(mode)
+ // we follow the orientation of the topmost app
}
virtual void setOnlyStatusbar(bool mode)
@@ -112,10 +112,6 @@ MDecoratorWindow::MDecoratorWindow(QWidget *parent)
managedWindowAtom = XInternAtom(QX11Info::display(),
"_MDECORATOR_MANAGED_WINDOW", False);
- // default setting is not to rotate automatically
- setOrientationAngle(M::Angle0);
- setOrientationAngleLocked(true);
-
homeButtonPanel = new MHomeButtonPanel();
escapeButtonPanel = new MEscapeButtonPanel();
navigationBar = new MNavigationBar();
@@ -142,6 +138,7 @@ MDecoratorWindow::MDecoratorWindow(QWidget *parent)
setMDecoratorWindowProperty();
setInputRegion();
+ setProperty("followsCurrentApplicationWindowOrientation", true);
}
void MDecoratorWindow::setWindowTitle(const QString& title)
diff --git a/src/mcompositemanager.cpp b/src/mcompositemanager.cpp
index 1243ba5..5873592 100644
--- a/src/mcompositemanager.cpp
+++ b/src/mcompositemanager.cpp
@@ -366,7 +366,8 @@ public:
map_requests.push_back(window);
else {
// create the damage object before mapping to get 'em all
- window->damageTracking(true);
+ if (!mcmp->device_state->displayOff())
+ window->damageTracking(true);
window->setBeingMapped(true); // don't disable compositing
XMapWindow(QX11Info::display(), window->winId());
}
@@ -379,7 +380,8 @@ public slots:
// first come first served
MWindowPropertyCache *w = map_requests.takeFirst();
// create the damage object before mapping to get 'em all
- w->damageTracking(true);
+ if (!mcmp->device_state->displayOff())
+ w->damageTracking(true);
w->setBeingMapped(true); // don't disable compositing
XMapWindow(QX11Info::display(), w->winId());
}
@@ -389,9 +391,12 @@ private:
QList<MWindowPropertyCache*> map_requests;
explicit MapRequesterPrivate(QObject* parent = 0)
:QObject(parent)
- {}
+ {
+ mcmp = dynamic_cast<MCompositeManagerPrivate*>(parent);
+ }
static MapRequesterPrivate *d;
+ MCompositeManagerPrivate *mcmp;
};
MapRequesterPrivate* MapRequesterPrivate::d = 0;
@@ -732,6 +737,7 @@ MCompositeManagerPrivate::MCompositeManagerPrivate(QObject *p)
watch = new MCompositeScene(this);
atom = MCompAtoms::instance();
+ MapRequesterPrivate::instance(this);
device_state = new MDeviceState(this);
connect(device_state, SIGNAL(displayStateChange(bool)),
@@ -929,8 +935,6 @@ bool MCompositeManagerPrivate::needDecoration(Window window,
void MCompositeManagerPrivate::damageEvent(XDamageNotifyEvent *e)
{
- if (device_state->displayOff())
- return;
XserverRegion r = XFixesCreateRegion(QX11Info::display(), 0, 0);
int num;
XDamageSubtract(QX11Info::display(), e->damage, None, r);
@@ -2655,8 +2659,11 @@ void MCompositeManagerPrivate::displayOff(bool display_off)
/* stop pinging to save some battery */
for (QHash<Window, MCompositeWindow *>::iterator it = windows.begin();
it != windows.end(); ++it) {
- MCompositeWindow *i = it.value();
+ MCompositeWindow *i = it.value();
i->stopPing();
+ // stop damage tracking while the display is off
+ if (i->propertyCache())
+ i->propertyCache()->damageTracking(false);
}
} else {
scene()->views()[0]->setUpdatesEnabled(true);
@@ -2664,6 +2671,14 @@ void MCompositeManagerPrivate::displayOff(bool display_off)
enableCompositing(false);
/* start pinging again */
pingTopmost();
+ // restart damage tracking
+ for (QHash<Window, MCompositeWindow *>::iterator it = windows.begin();
+ it != windows.end(); ++it) {
+ MCompositeWindow *i = it.value();
+ if (i->propertyCache() && (i->propertyCache()->isMapped() ||
+ i->propertyCache()->beingMapped()))
+ i->propertyCache()->damageTracking(true);
+ }
}
dirtyStacking(true); // VisibilityNotify generation
}