Merge lp:~jassmith/unity/unity.sru-fixes into lp:unity

Proposed by Jason Smith on 2011-05-26
Status: Merged
Approved by: Neil J. Patel on 2011-05-26
Approved revision: 1197
Merged at revision: 1200
Proposed branch: lp:~jassmith/unity/unity.sru-fixes
Merge into: lp:unity
Diff against target: 67 lines (+22/-5)
2 files modified
src/unityshell.cpp (+20/-5)
src/unityshell.h (+2/-0)
To merge this branch: bzr merge lp:~jassmith/unity/unity.sru-fixes
Reviewer Review Type Date Requested Status
Neil J. Patel (community) 2011-05-26 Approve on 2011-05-26
Review via email: mp+62502@code.launchpad.net
To post a comment you must log in.
Neil J. Patel (njpatel) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/unityshell.cpp'
2--- src/unityshell.cpp 2011-05-04 13:18:37 +0000
3+++ src/unityshell.cpp 2011-05-26 15:17:26 +0000
4@@ -676,11 +676,26 @@
5 window->resizeNotify (x, y, w, h);
6 }
7
8+CompPoint
9+UnityWindow::tryNotIntersectLauncher (CompPoint &pos)
10+{
11+ UnityScreen *us = UnityScreen::get (screen);
12+ nux::Geometry geo = us->launcher->GetAbsoluteGeometry ();
13+ CompRect launcherGeo (geo.x, geo.y, geo.width, geo.height);
14+
15+ if (launcherGeo.contains (pos))
16+ {
17+ if (screen->workArea ().contains (CompRect (launcherGeo.right () + 1, pos.y (), window->width (), window->height ())))
18+ pos.setX (launcherGeo.right () + 1);
19+ }
20+
21+ return pos;
22+}
23+
24 bool
25 UnityWindow::place (CompPoint &pos)
26 {
27 UnityScreen *us = UnityScreen::get (screen);
28- nux::Geometry geo = us->launcher->GetAbsoluteGeometry ();
29 Launcher::LauncherHideMode hideMode = us->launcher->GetHideMode ();
30
31 bool result = window->place (pos);
32@@ -689,11 +704,9 @@
33 {
34 case Launcher::LAUNCHER_HIDE_DODGE_WINDOWS:
35 case Launcher::LAUNCHER_HIDE_DODGE_ACTIVE_WINDOW:
36- if (pos.x () <= geo.width && window->width () + geo.width + 1< screen->workArea ().width ())
37- {
38- pos.setX (geo.width + 1);
39- }
40+ pos = tryNotIntersectLauncher (pos);
41 break;
42+
43 default:
44 break;
45 }
46@@ -1057,6 +1070,8 @@
47 self->launcher->SetLaunchAnimation (Launcher::LAUNCH_ANIMATION_PULSE);
48 self->launcher->SetUrgentAnimation (Launcher::URGENT_ANIMATION_WIGGLE);
49 self->ScheduleRelayout (0);
50+
51+ self->OnLauncherHiddenChanged ();
52
53 END_FUNCTION ();
54 }
55
56=== modified file 'src/unityshell.h'
57--- src/unityshell.h 2011-04-26 22:11:36 +0000
58+++ src/unityshell.h 2011-05-26 15:17:26 +0000
59@@ -277,6 +277,8 @@
60 void stateChangeNotify (unsigned int lastState);
61
62 bool place (CompPoint &pos);
63+
64+ CompPoint tryNotIntersectLauncher (CompPoint &pos);
65 };
66
67 #define EX_SCREEN (screen) \