diff options
| author | handsome_feng <445865575@qq.com> | 2015-12-23 09:16:53 +0800 |
|---|---|---|
| committer | handsome_feng <445865575@qq.com> | 2015-12-23 09:16:53 +0800 |
| commit | 2432f4191405393ca5272008b4306aea7296e311 (patch) | |
| tree | 93758906906a817c585511b1915a68957f465383 /dash | |
| parent | df4cda7e759f303159fd9993ea5d9dc4ae26d12d (diff) | |
| parent | 1d05db764d9a136b00e3781db30935257932173a (diff) | |
merging lp:~3v1n0/unity/rotated-improvements
(bzr r3999.7.15)
Diffstat (limited to 'dash')
| -rw-r--r-- | dash/DashController.cpp | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/dash/DashController.cpp b/dash/DashController.cpp index 38a29449c..26c636676 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) @@ -263,13 +260,13 @@ void Controller::Relayout(bool check_monitor) view_->Relayout(); window_->SetGeometry(geo); + + int horizontal_offset = 0; + if (Settings::Instance().launcher_position() == LauncherPosition::LEFT) - { - int launcher_width = unity::Settings::Instance().LauncherSize(monitor_); - view_->SetMonitorOffset(launcher_width, panel::Style::Instance().PanelHeight(monitor_)); - } - else - view_->SetMonitorOffset(0, panel::Style::Instance().PanelHeight(monitor_)); + horizontal_offset = unity::Settings::Instance().LauncherSize(monitor_); + + view_->SetMonitorOffset(horizontal_offset, panel::Style::Instance().PanelHeight(monitor_)); } void Controller::OnMouseDownOutsideWindow(int x, int y, |
