summaryrefslogtreecommitdiff
diff options
-rw-r--r--src/unityshell.cpp25
-rw-r--r--src/unityshell.h2
2 files changed, 22 insertions, 5 deletions
diff --git a/src/unityshell.cpp b/src/unityshell.cpp
index aa4cae365..eeae15c3a 100644
--- a/src/unityshell.cpp
+++ b/src/unityshell.cpp
@@ -676,11 +676,26 @@ UnityWindow::resizeNotify (int x, int y, int w, int h)
window->resizeNotify (x, y, w, h);
}
+CompPoint
+UnityWindow::tryNotIntersectLauncher (CompPoint &pos)
+{
+ UnityScreen *us = UnityScreen::get (screen);
+ nux::Geometry geo = us->launcher->GetAbsoluteGeometry ();
+ CompRect launcherGeo (geo.x, geo.y, geo.width, geo.height);
+
+ if (launcherGeo.contains (pos))
+ {
+ if (screen->workArea ().contains (CompRect (launcherGeo.right () + 1, pos.y (), window->width (), window->height ())))
+ pos.setX (launcherGeo.right () + 1);
+ }
+
+ return pos;
+}
+
bool
UnityWindow::place (CompPoint &pos)
{
UnityScreen *us = UnityScreen::get (screen);
- nux::Geometry geo = us->launcher->GetAbsoluteGeometry ();
Launcher::LauncherHideMode hideMode = us->launcher->GetHideMode ();
bool result = window->place (pos);
@@ -689,11 +704,9 @@ UnityWindow::place (CompPoint &pos)
{
case Launcher::LAUNCHER_HIDE_DODGE_WINDOWS:
case Launcher::LAUNCHER_HIDE_DODGE_ACTIVE_WINDOW:
- if (pos.x () <= geo.width && window->width () + geo.width + 1< screen->workArea ().width ())
- {
- pos.setX (geo.width + 1);
- }
+ pos = tryNotIntersectLauncher (pos);
break;
+
default:
break;
}
@@ -1057,6 +1070,8 @@ void UnityScreen::initLauncher (nux::NThread* thread, void* InitData)
self->launcher->SetLaunchAnimation (Launcher::LAUNCH_ANIMATION_PULSE);
self->launcher->SetUrgentAnimation (Launcher::URGENT_ANIMATION_WIGGLE);
self->ScheduleRelayout (0);
+
+ self->OnLauncherHiddenChanged ();
END_FUNCTION ();
}
diff --git a/src/unityshell.h b/src/unityshell.h
index 4c4de9e11..97f664329 100644
--- a/src/unityshell.h
+++ b/src/unityshell.h
@@ -277,6 +277,8 @@ class UnityWindow :
void stateChangeNotify (unsigned int lastState);
bool place (CompPoint &pos);
+
+ CompPoint tryNotIntersectLauncher (CompPoint &pos);
};
#define EX_SCREEN (screen) \