diff options
| author | Eleni Maria Stea <elenimaria.stea@canonical.com> | 2014-10-07 13:05:01 +0300 |
|---|---|---|
| committer | Eleni Maria Stea <elenimaria.stea@canonical.com> | 2014-10-07 13:05:01 +0300 |
| commit | b1a98ef88aeebee5f1783640d099fdc1a641e6fb (patch) | |
| tree | 43c181763230b156b76c4e2da90ec1680916959c /plugins | |
| parent | f36d7199859d3f26fa12639a2b66694f34fac81e (diff) | |
changed unityshell plugin to use the new layouting functions
(bzr r3875.3.2)
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/unityshell/src/unityshell.cpp | 70 | ||||
| -rw-r--r-- | plugins/unityshell/src/unityshell.h | 1 |
2 files changed, 0 insertions, 71 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index 9c427c5c0..34978275e 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -3700,76 +3700,6 @@ void UnityScreen::outputChangeNotify() bool UnityScreen::layoutSlotsAndAssignWindows() { - auto const& scaled_windows = sScreen->getWindows(); - - for (auto const& output : screen->outputDevs()) - { - ui::LayoutWindow::Vector layout_windows; - int monitor = UScreen::GetDefault()->GetMonitorAtPosition(output.centerX(), output.centerY()); - double monitor_scale = unity_settings_.em(monitor)->DPIScale(); - - for (ScaleWindow *sw : scaled_windows) - { - if (sw->window->outputDevice() == static_cast<int>(output.id())) - { - UnityWindow::get(sw->window)->deco_win_->scaled = true; - layout_windows.emplace_back(std::make_shared<LayoutWindow>(sw->window->id())); - } - } - - auto max_bounds = NuxGeometryFromCompRect(output.workArea()); - - if (launcher_controller_->options()->hide_mode != LAUNCHER_HIDE_NEVER) - { - int monitor_width = unity_settings_.LauncherWidth(monitor); - max_bounds.x += monitor_width; - max_bounds.width -= monitor_width; - } - - nux::Geometry final_bounds; - ui::LayoutSystem layout; - layout.max_row_height = max_bounds.height; - layout.spacing = local::SCALE_SPACING.CP(monitor_scale); - int padding = local::SCALE_PADDING.CP(monitor_scale); - max_bounds.Expand(-padding, -padding); - layout.LayoutWindows(layout_windows, max_bounds, final_bounds); - - auto lw_it = layout_windows.begin(); - for (auto const& sw : scaled_windows) - { - if (lw_it == layout_windows.end()) - break; - - LayoutWindow::Ptr const& lw = *lw_it; - - if (sw->window->id() != lw->xid) - continue; - - ScaleSlot slot(CompRectFromNuxGeo(lw->result)); - slot.scale = lw->scale; - - float sx = lw->geo.width * slot.scale; - float sy = lw->geo.height * slot.scale; - float cx = (slot.x1() + slot.x2()) / 2; - float cy = (slot.y1() + slot.y2()) / 2; - - CompWindow *w = sw->window; - cx += w->input().left * slot.scale; - cy += w->input().top * slot.scale; - - slot.setGeometry(cx - sx / 2, cy - sy / 2, sx, sy); - slot.filled = true; - - sw->setSlot(slot); - ++lw_it; - } - } - - return true; -} - -bool UnityScreen::layoutSlotsAndAssignWindowsNearest() -{ std::list<ScaleWindow *> scaled_windows = sScreen->getWindows(); for (auto const& output : screen->outputDevs()) { diff --git a/plugins/unityshell/src/unityshell.h b/plugins/unityshell/src/unityshell.h index 223d4cad9..b4ab30d53 100644 --- a/plugins/unityshell/src/unityshell.h +++ b/plugins/unityshell/src/unityshell.h @@ -176,7 +176,6 @@ public: /* window scaling */ bool layoutSlotsAndAssignWindows(); - bool layoutSlotsAndAssignWindowsNearest(); bool showMenuBarInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options); bool showMenuBarTerminate(CompAction* action, CompAction::State state, CompOption::Vector& options); |
