diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2015-12-22 17:15:53 +0100 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2015-12-22 17:15:53 +0100 |
| commit | 753b8c49910e1b7c565398be6dc055ba35ba011a (patch) | |
| tree | c4b8be0480e645e721868dd8215d2d805630c417 /dash | |
| parent | 2b1b874257b70344be656b3007e90aee01f292d8 (diff) | |
DashController: cleanup ideal geometry codepath
(bzr r3999.8.3)
Diffstat (limited to 'dash')
| -rw-r--r-- | dash/DashController.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/dash/DashController.cpp b/dash/DashController.cpp index 38a29449c..2d2799654 100644 --- a/dash/DashController.cpp +++ b/dash/DashController.cpp @@ -231,25 +231,22 @@ int Controller::GetIdealMonitor() nux::Geometry Controller::GetIdealWindowGeometry() { UScreen *uscreen = UScreen::GetDefault(); - auto monitor_geo = uscreen->GetMonitorGeometry(GetIdealMonitor()); + auto ideal_geo = uscreen->GetMonitorGeometry(GetIdealMonitor()); int launcher_size = unity::Settings::Instance().LauncherSize(monitor_); + // We want to cover as much of the screen as possible to grab any mouse events outside + // of our window if (Settings::Instance().launcher_position() == LauncherPosition::LEFT) { - // We want to cover as much of the screen as possible to grab any mouse events outside - // of our window - return nux::Geometry (monitor_geo.x + launcher_size, - monitor_geo.y, - monitor_geo.width - launcher_size, - monitor_geo.height); + ideal_geo.x += launcher_size; + ideal_geo.width -= launcher_size; } else { - return nux::Geometry (monitor_geo.x, - monitor_geo.y, - monitor_geo.width, - monitor_geo.height - launcher_size ); + ideal_geo.height -= launcher_size; } + + return ideal_geo; } void Controller::Relayout(bool check_monitor) |
