diff options
| author | Brandon Schaefer <brandontschaefer@gmail.com> | 2014-02-25 14:10:53 -0800 |
|---|---|---|
| committer | Brandon Schaefer <brandontschaefer@gmail.com> | 2014-02-25 14:10:53 -0800 |
| commit | ade5d4df2cec075d10858fb17ee42d7f7d17b837 (patch) | |
| tree | 25e8193c2432bf7bd4e5d0f5ab00a2968498cf24 /plugins | |
| parent | 9fa062baba39b5f608ffc4dd5541d520c8417e76 (diff) | |
* Move to storing up to monitors::MAX launchers. This way we can tell what
width each launcher is when doing positions on dash/hud/panel (bzr r3680.6.1)
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/unityshell/src/unityshell.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index 67cfd1cbc..8c20e9315 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -3622,14 +3622,19 @@ void UnityScreen::initLauncher() session_controller_ = std::make_shared<session::Controller>(manager); AddChild(session_controller_.get()); - auto on_launcher_size_changed = [this] (nux::Area*, int w, int h) { + auto on_launcher_size_changed = [this] (nux::Area* area, int w, int h) { /* The launcher geometry includes 1px used to draw the right margin * that must not be considered when drawing an overlay */ + + nux::Geometry const& geo = area->GetAbsoluteGeometry(); + int monitor = WindowManager::Default().MonitorGeometryIn(geo); + int launcher_width = w - 1; - hud_controller_->launcher_width = launcher_width; - dash_controller_->launcher_width = launcher_width; - panel_controller_->launcher_width = launcher_width; - shortcut_controller_->SetAdjustment(launcher_width, panel_style_.PanelHeight()); + //hud_controller_->SetLauncherWidth(launcher_width, monitor); + //dash_controller_->SetLauncherWidth(launcher_width, monitor); + unity::Settings::Instance().SetLauncherWidth(launcher_width, monitor); + //panel_controller_->launcher_width = launcher_width; + //shortcut_controller_->SetAdjustment(launcher_width, panel_style_.PanelHeight(monitor)); CompOption::Value v(launcher_width); screen->setOptionForPlugin("expo", "x_offset", v); @@ -3637,10 +3642,13 @@ void UnityScreen::initLauncher() if (launcher_controller_->options()->hide_mode != LAUNCHER_HIDE_NEVER) screen->setOptionForPlugin("scale", "x_offset", v); }; - launcher_controller_->launcher().size_changed.connect(on_launcher_size_changed); - auto* l = &launcher_controller_->launcher(); - on_launcher_size_changed(l, l->GetWidth(), l->GetHeight()); + for (auto const& launcher : launcher_controller_->launchers()) + { + launcher->size_changed.connect(on_launcher_size_changed); + + on_launcher_size_changed(launcher.GetPointer(), launcher->GetWidth(), launcher->GetHeight()); + } ScheduleRelayout(0); } |
