diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-02-15 15:46:47 +0100 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-02-15 15:46:47 +0100 |
| commit | 764bdc1620b1a011ff73e4a8c90e31eba20139a6 (patch) | |
| tree | 8bba601a45a7df7cc1de876c74b04c8cf2fbc8d3 /unity-shared | |
| parent | c4a6a935b8fa0b5954019033a58373fc325ab95d (diff) | |
PluginAdapter: use initialization list and use _spread_state instead of grabExist("scale")
It's surely faster... (bzr r3656.2.6)
Diffstat (limited to 'unity-shared')
| -rw-r--r-- | unity-shared/PluginAdapter.cpp | 39 | ||||
| -rw-r--r-- | unity-shared/PluginAdapter.h | 6 |
2 files changed, 20 insertions, 25 deletions
diff --git a/unity-shared/PluginAdapter.cpp b/unity-shared/PluginAdapter.cpp index 67177d7c9..0a4611116 100644 --- a/unity-shared/PluginAdapter.cpp +++ b/unity-shared/PluginAdapter.cpp @@ -57,26 +57,23 @@ void PluginAdapter::Initialize(CompScreen* screen) global_instance.reset(new PluginAdapter(screen)); } -PluginAdapter::PluginAdapter(CompScreen* screen) : - m_Screen(screen), - _in_show_desktop (false), - _last_focused_window(nullptr) -{ - _spread_state = false; - _spread_windows_state = false; - _expo_state = false; - _vp_switch_started = false; - - _grab_show_action = 0; - _grab_hide_action = 0; - _grab_toggle_action = 0; - _coverage_area_before_automaximize = 0.75; - bias_active_to_viewport = false; -} +PluginAdapter::PluginAdapter(CompScreen* screen) + : bias_active_to_viewport(false) + , m_Screen(screen) + , _coverage_area_before_automaximize(0.75) + , _spread_state(false) + , _spread_windows_state(false) + , _expo_state(false) + , _vp_switch_started(false) + , _in_show_desktop(false) + , _grab_show_action(nullptr) + , _grab_hide_action(nullptr) + , _grab_toggle_action(nullptr) + , _last_focused_window(nullptr) +{} PluginAdapter::~PluginAdapter() -{ -} +{} /* A No-op for now, but could be useful later */ void PluginAdapter::OnScreenGrabbed() @@ -367,17 +364,17 @@ void PluginAdapter::TerminateScale() bool PluginAdapter::IsScaleActive() const { - return m_Screen->grabExist("scale"); + return _spread_state; } bool PluginAdapter::IsScaleActiveForGroup() const { - return _spread_windows_state && m_Screen->grabExist("scale"); + return _spread_windows_state && _spread_state; } bool PluginAdapter::IsExpoActive() const { - return m_Screen->grabExist("expo"); + return _expo_state; } bool PluginAdapter::IsWallActive() const diff --git a/unity-shared/PluginAdapter.h b/unity-shared/PluginAdapter.h index eef6f7109..18a5216ad 100644 --- a/unity-shared/PluginAdapter.h +++ b/unity-shared/PluginAdapter.h @@ -205,18 +205,16 @@ private: MultiActionList m_ExpoActionList; MultiActionList m_ScaleActionList; + float _coverage_area_before_automaximize; bool _spread_state; bool _spread_windows_state; bool _expo_state; bool _vp_switch_started; + bool _in_show_desktop; CompAction* _grab_show_action; CompAction* _grab_hide_action; CompAction* _grab_toggle_action; - - float _coverage_area_before_automaximize; - - bool _in_show_desktop; CompWindow* _last_focused_window; }; |
