diff options
| author | Marco Trevisan (TreviƱo) <mail@3v1n0.net> | 2014-03-12 23:45:35 +0000 |
|---|---|---|
| committer | CI bot <ps-jenkins@lists.canonical.com> | 2014-03-12 23:45:35 +0000 |
| commit | a769b6d9a38392f9432ab0b288552048cdf99c25 (patch) | |
| tree | c51f32b36268d0993bfd5a00f78e944577b3cf72 /unity-shared | |
| parent | 01521e07153f45dd1fcb79074dd42452f2aadd43 (diff) | |
| parent | f583952dcfcf2b4528f832ffecdb4199377c83e4 (diff) | |
UnityScreen: use switcher's LayoutSystem to compute the scaled windows geometries
Thanks to this, both the Alt+Tab and Spread will use the same codepath to define the positioning of the scaled windows. Fixes: 925454, 1286158 (bzr r3714)
Diffstat (limited to 'unity-shared')
| -rw-r--r-- | unity-shared/LayoutSystem.cpp | 7 | ||||
| -rw-r--r-- | unity-shared/LayoutSystem.h | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/unity-shared/LayoutSystem.cpp b/unity-shared/LayoutSystem.cpp index c3c3f5599..f2ea8b87a 100644 --- a/unity-shared/LayoutSystem.cpp +++ b/unity-shared/LayoutSystem.cpp @@ -125,12 +125,12 @@ nux::Geometry LayoutSystem::LayoutRow(LayoutWindow::Vector const& row, nux::Geom for (LayoutWindow::Ptr const& window : row) { // we dont allow scaling up - float final_scalar = std::min(1.0f, (unpadded_bounds.height / (float)window->geo.height) * global_scalar); + window->scale = std::min(1.0f, (unpadded_bounds.height / (float)window->geo.height) * global_scalar); window->result.x = x; window->result.y = y; - window->result.width = window->geo.width * final_scalar; - window->result.height = window->geo.height * final_scalar; + window->result.width = window->geo.width * window->scale; + window->result.height = window->geo.height * window->scale; x += window->result.width; } @@ -275,6 +275,7 @@ LayoutWindow::LayoutWindow(Window xid) , decoration_height(0) , selected(false) , aspect_ratio(geo.width / static_cast<float>(geo.height)) + , scale(1.0f) , alpha(0.0f) { auto& wm = WindowManager::Default(); diff --git a/unity-shared/LayoutSystem.h b/unity-shared/LayoutSystem.h index 4fd190b40..6241f727c 100644 --- a/unity-shared/LayoutSystem.h +++ b/unity-shared/LayoutSystem.h @@ -46,6 +46,7 @@ public: bool selected; float aspect_ratio; + float scale; float alpha; protected: |
