diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2012-09-06 14:15:04 +0200 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2012-09-06 14:15:04 +0200 |
| commit | 7d3f08c00e2e4a6347eefb513d05a6daede2ed0a (patch) | |
| tree | 260c209878ddae677b02576dae573d45ad436de5 /plugins/unityshell | |
| parent | 8c5d01310b6d9cde6fdde1392c90195f9876d839 (diff) | |
UnityShell: avoid to compute PluginAdapter() address multiple times in handleEvent
(bzr r2655.6.2)
Diffstat (limited to 'plugins/unityshell')
| -rw-r--r-- | plugins/unityshell/src/unityshell.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index 2ab62db25..501450d67 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -1623,14 +1623,16 @@ void UnityScreen::nuxDamageCompiz() void UnityScreen::handleEvent(XEvent* event) { bool skip_other_plugins = false; + auto wm = PluginAdapter::Default(); + switch (event->type) { case FocusIn: case FocusOut: if (event->xfocus.mode == NotifyGrab) - PluginAdapter::Default()->OnScreenGrabbed(); + wm->OnScreenGrabbed(); else if (event->xfocus.mode == NotifyUngrab) - PluginAdapter::Default()->OnScreenUngrabbed(); + wm->OnScreenUngrabbed(); #ifndef USE_MODERN_COMPIZ_GL cScreen->damageScreen(); // evil hack #endif @@ -1647,7 +1649,7 @@ void UnityScreen::handleEvent(XEvent* event) _key_nav_mode_requested = false; break; case MotionNotify: - if (PluginAdapter::Default()->IsScaleActive()) + if (wm->IsScaleActive()) { ScaleScreen* ss = ScaleScreen::get(screen); if (CompWindow *w = screen->findWindow(ss->getSelectedWindow())) @@ -1660,7 +1662,7 @@ void UnityScreen::handleEvent(XEvent* event) launcher_controller_->KeyNavTerminate(false); EnableCancelAction(CancelActionTarget::LAUNCHER_SWITCHER, false); } - if (PluginAdapter::Default()->IsScaleActive()) + if (wm->IsScaleActive()) { ScaleScreen* ss = ScaleScreen::get(screen); if (CompWindow *w = screen->findWindow(ss->getSelectedWindow())) @@ -1686,7 +1688,7 @@ void UnityScreen::handleEvent(XEvent* event) } } } - else if (PluginAdapter::Default()->IsScaleActive()) + else if (wm->IsScaleActive()) { ScaleScreen* ss = ScaleScreen::get(screen); if (CompWindow *w = screen->findWindow(ss->getSelectedWindow())) |
