summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorErkin Bahceci <erkinbah@gmail.com>2009-08-08 11:29:36 -0500
committerErkin Bahceci <erkinbah@gmail.com>2009-08-08 11:29:36 -0500
commitd02ecaa6b58e9b6cb74a3021bf7167e582a8092a (patch)
treeb65c8a27c62a6b0f557ba41292c34afc5574d91f /src
parent284c36f213170aedbbdbba9fac5447b4b75d4391 (diff)
downloadmag-d02ecaa6b58e9b6cb74a3021bf7167e582a8092a.tar.gz
mag-d02ecaa6b58e9b6cb74a3021bf7167e582a8092a.tar.bz2
Disable painting functions when not needed.
Diffstat (limited to 'src')
-rw-r--r--src/mag.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/mag.cpp b/src/mag.cpp
index 686a417..b0a3d57 100644
--- a/src/mag.cpp
+++ b/src/mag.cpp
@@ -331,9 +331,15 @@ MagScreen::donePaint ()
glDisable (target);
}
- if (zoom == 1.0 && !adjust && poller.active ())
+ if (zoom == 1.0 && !adjust)
{
- poller.stop ();
+ // Mag mode has ended
+ cScreen->preparePaintSetEnabled (this, false);
+ cScreen->donePaintSetEnabled (this, false);
+ gScreen->glPaintOutputSetEnabled (this, false);
+
+ if (poller.active ())
+ poller.stop ();
}
cScreen->donePaint ();
@@ -855,6 +861,11 @@ MagScreen::initiate (CompAction *action,
adjust = true;
cScreen->damageScreen ();
+ // Mag mode is starting
+ cScreen->preparePaintSetEnabled (this, true);
+ cScreen->donePaintSetEnabled (this, true);
+ gScreen->glPaintOutputSetEnabled (this, true);
+
return true;
}
@@ -902,9 +913,9 @@ MagScreen::MagScreen (CompScreen *screen) :
zoom (1.0f),
program (0)
{
- ScreenInterface::setHandler (screen);
- CompositeScreenInterface::setHandler (cScreen);
- GLScreenInterface::setHandler (gScreen);
+ ScreenInterface::setHandler (screen, false);
+ CompositeScreenInterface::setHandler (cScreen, false);
+ GLScreenInterface::setHandler (gScreen, false);
poller.setCallback (boost::bind (&MagScreen::positionUpdate, this, _1));