Merge lp:~alales/unity/unity-4.0-fix-for-791810 into lp:unity/4.0

Proposed by Alain Lessard
Status: Rejected
Rejected by: Marco Trevisan (Treviño)
Proposed branch: lp:~alales/unity/unity-4.0-fix-for-791810
Merge into: lp:unity/4.0
Diff against target: 106 lines (+34/-1)
6 files modified
plugins/unityshell/src/Launcher.cpp (+11/-1)
plugins/unityshell/src/Launcher.h (+1/-0)
plugins/unityshell/src/QuicklistManager.cpp (+6/-0)
plugins/unityshell/src/QuicklistManager.h (+2/-0)
plugins/unityshell/src/QuicklistView.cpp (+13/-0)
plugins/unityshell/src/QuicklistView.h (+1/-0)
To merge this branch: bzr merge lp:~alales/unity/unity-4.0-fix-for-791810
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Disapprove
Andrea Azzarone (community) Needs Fixing
Tim Penhey Pending
Review via email: mp+81768@code.launchpad.net

Description of the change

Reactivate the current quicklist when Expo exit on right-clicking, otherwise another window will be active and the quicklist will freeze (bug #791810).

Has been tested in oneiric with sudo make install + logout + login.

Exit expo set on Button3 in CompizConfig Settings Manager.

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

17 +Launcher::OnExpoTerminated()
18 +{
19 + _hide_machine->SetQuirk (LauncherHideMachine::EXPO_ACTIVE, WindowManager::Default ()->IsExpoActive ());

Plese don't put a space between the function name and the open parenthesis.

20 + _hide_machine->SetQuirk (LauncherHideMachine::SCALE_ACTIVE, WindowManager::Default ()->IsScaleActive ());

Is the above line really needed? We're in the "OnExpoTerminated" function...

26 + if (_hidemode == LAUNCHER_HIDE_NEVER)
27 + return;
28 +}

This if is not really needed. Please remove it.

54 +void QuicklistManager::Activate()
55 +{
56 + if (_current_quicklist)
57 + _current_quicklist->Activate();
58 +}

Wrong indentation. Please fix it :)

After the adjustments i'm going to continue the review. Thanks in advance :)

review: Needs Fixing
1719. By Alain Lessard

Modifications required by code review 1.

Revision history for this message
Alain Lessard (alales) wrote :

On Sat, 2011-11-26 at 01:41 +0000, Andrea Azzarone wrote:
> Review: Needs Fixing
>
> 17 +Launcher::OnExpoTerminated()
> 18 +{
> 19 + _hide_machine->SetQuirk (LauncherHideMachine::EXPO_ACTIVE, WindowManager::Default ()->IsExpoActive ());
>
> Plese don't put a space between the function name and the open parenthesis.

OK, I've done this.

>
> 20 + _hide_machine->SetQuirk (LauncherHideMachine::SCALE_ACTIVE, WindowManager::Default ()->IsScaleActive ());
>
> Is the above line really needed? We're in the "OnExpoTerminated" function...

Prior to my modification, this line was used in the method
Launcher::OnPluginStateChanged()

That method was connected to the terminate_expo event

My intention was to use the same code plus the call to
QuicklistManager::Default()->Activate() that I've added, just to make sure
I don't break any existing features...

>
> 26 + if (_hidemode == LAUNCHER_HIDE_NEVER)
> 27 + return;
> 28 +}
>
> This if is not really needed. Please remove it.

OK, I've done this.

>
> 54 +void QuicklistManager::Activate()
> 55 +{
> 56 + if (_current_quicklist)
> 57 + _current_quicklist->Activate();
> 58 +}
>
> Wrong indentation. Please fix it :)

OK, I've done this.

>
> After the adjustments i'm going to continue the review. Thanks in advance :)

OK. Thanks.

Revision history for this message
Andrea Azzarone (azzar1) wrote :

> On Sat, 2011-11-26 at 01:41 +0000, Andrea Azzarone wrote:
> > Review: Needs Fixing
> >
> > 17 +Launcher::OnExpoTerminated()
> > 18 +{
> > 19 + _hide_machine->SetQuirk (LauncherHideMachine::EXPO_ACTIVE,
> WindowManager::Default ()->IsExpoActive ());
> >
> > Plese don't put a space between the function name and the open parenthesis.
>
> OK, I've done this.
>
> >
> > 20 + _hide_machine->SetQuirk (LauncherHideMachine::SCALE_ACTIVE,
> WindowManager::Default ()->IsScaleActive ());
> >
> > Is the above line really needed? We're in the "OnExpoTerminated" function...
>
> Prior to my modification, this line was used in the method
> Launcher::OnPluginStateChanged()
>
> That method was connected to the terminate_expo event
>
> My intention was to use the same code plus the call to
> QuicklistManager::Default()->Activate() that I've added, just to make sure
> I don't break any existing features...

I know but you still have the function OnPluginStateChanged that is called when the scale/spread plugin state change.

>
> >
> > 26 + if (_hidemode == LAUNCHER_HIDE_NEVER)
> > 27 + return;
> > 28 +}
> >
> > This if is not really needed. Please remove it.
>
> OK, I've done this.
>
> >
> > 54 +void QuicklistManager::Activate()
> > 55 +{
> > 56 + if (_current_quicklist)
> > 57 + _current_quicklist->Activate();
> > 58 +}
> >
> > Wrong indentation. Please fix it :)
>
> OK, I've done this.
>
> >
> > After the adjustments i'm going to continue the review. Thanks in advance :)
>
> OK. Thanks.

review: Needs Fixing
Revision history for this message
Alain Lessard (alales) wrote :

On Wed, 2011-11-30 at 08:16 +0000, Andrea Azzarone wrote:
> Review: Needs Fixing
>
> > On Sat, 2011-11-26 at 01:41 +0000, Andrea Azzarone wrote:
> > > Review: Needs Fixing
> > >
> > > 17 +Launcher::OnExpoTerminated()
> > > 18 +{
> > > 19 + _hide_machine->SetQuirk (LauncherHideMachine::EXPO_ACTIVE,
> > WindowManager::Default ()->IsExpoActive ());
> > >
> > > Plese don't put a space between the function name and the open parenthesis.
> >
> > OK, I've done this.
> >
> > >
> > > 20 + _hide_machine->SetQuirk (LauncherHideMachine::SCALE_ACTIVE,
> > WindowManager::Default ()->IsScaleActive ());
> > >
> > > Is the above line really needed? We're in the "OnExpoTerminated" function...
> >
> > Prior to my modification, this line was used in the method
> > Launcher::OnPluginStateChanged()
> >
> > That method was connected to the terminate_expo event
> >
> > My intention was to use the same code plus the call to
> > QuicklistManager::Default()->Activate() that I've added, just to make sure
> > I don't break any existing features...
>
> I know but you still have the function OnPluginStateChanged that is called when the scale/spread plugin state change.
>
OK, this is done.
> >
> > >
> > > 26 + if (_hidemode == LAUNCHER_HIDE_NEVER)
> > > 27 + return;
> > > 28 +}
> > >
> > > This if is not really needed. Please remove it.
> >
> > OK, I've done this.
> >
> > >
> > > 54 +void QuicklistManager::Activate()
> > > 55 +{
> > > 56 + if (_current_quicklist)
> > > 57 + _current_quicklist->Activate();
> > > 58 +}
> > >
> > > Wrong indentation. Please fix it :)
> >
> > OK, I've done this.
> >
> > >
> > > After the adjustments i'm going to continue the review. Thanks in advance :)
> >
> > OK. Thanks.

1720. By Alain Lessard

Modifications required by code review 2.

Revision history for this message
Andrea Azzarone (azzar1) wrote :

Ok the code looks good to me and it works well. I don't now if we need a test for it.

review: Approve
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

@Andrea: you'll need a test for this. At least a manual test and ideally an automated test. Can you handle that before approving the branch? Thanks :)

Revision history for this message
Andrea Azzarone (azzar1) :
review: Needs Fixing
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Works well, but we need a test.

Also, it would be cool if you could ask for merge against lp:unity too, since it suffers of the same bug as well.

Going back to tests, I'm not sure if also autopilot is enough here (speaking for the trunk branch), because even if it's easy to to reproduce it, then I'm not sure that we can easily and automatically check that the QL is actually freezed (maybe, using a fake quicklist and making the autopilot to click over one of its entries without getting any signal, but this needs some work).

So, at least for the unity/4.0 branch I guess that a manual test should be fine, so please compile one and add it to this branch following the guidelines that you can find at: http://bazaar.launchpad.net/~unity-team/unity/trunk/view/head:/manual-tests/ReadMe.txt

Thank you.

review: Needs Fixing
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Hi Alain, thank you again for your code.

However, looking better at it, I've seen that we could have done this also without using workarounds to grab pointer or keyboard focus, but just making the quicklist to show only after that the expo plugin has been terminated.

The fixed code is now on my branch lp:~3v1n0/unity/quicklist-on-expo that is on review at [1] (and [2] for oneiric's unity), I encourage you to look at it.

I'm sorry to say this, but I've to reject your merge request, even if thanks to it I got the proper way to fix the bug you've reported.

[1] https://code.launchpad.net/~3v1n0/unity/quicklist-on-expo/+merge/84421
[2] https://code.launchpad.net/~3v1n0/unity/quicklist-on-expo.stable/+merge/84422

review: Disapprove

Unmerged revisions

1720. By Alain Lessard

Modifications required by code review 2.

1719. By Alain Lessard

Modifications required by code review 1.

1718. By Alain Lessard

reactivate the current quicklist when Expo exit on right-clicking,
otherwise another window will be active and the quicklist will
freeze (bug #791810).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/Launcher.cpp'
2--- plugins/unityshell/src/Launcher.cpp 2011-09-29 03:45:59 +0000
3+++ plugins/unityshell/src/Launcher.cpp 2011-11-30 15:59:26 +0000
4@@ -183,7 +183,7 @@
5 plugin_adapter.initiate_spread.connect(sigc::mem_fun(this, &Launcher::OnPluginStateChanged));
6 plugin_adapter.initiate_expo.connect(sigc::mem_fun(this, &Launcher::OnPluginStateChanged));
7 plugin_adapter.terminate_spread.connect(sigc::mem_fun(this, &Launcher::OnPluginStateChanged));
8- plugin_adapter.terminate_expo.connect(sigc::mem_fun(this, &Launcher::OnPluginStateChanged));
9+ plugin_adapter.terminate_expo.connect(sigc::mem_fun(this, &Launcher::OnExpoTerminated));
10 plugin_adapter.compiz_screen_viewport_switch_started.connect(sigc::mem_fun(this, &Launcher::OnViewPortSwitchStarted));
11 plugin_adapter.compiz_screen_viewport_switch_ended.connect(sigc::mem_fun(this, &Launcher::OnViewPortSwitchEnded));
12
13@@ -1702,6 +1702,16 @@
14 }
15
16 void
17+Launcher::OnExpoTerminated()
18+{
19+ _hide_machine->SetQuirk(LauncherHideMachine::EXPO_ACTIVE, WindowManager::Default()->IsExpoActive());
20+
21+ // reactivate the current quicklist when Expo exit on right-clicking.
22+ // otherwise another window will be active and the quicklist will freeze (bug #791810).
23+ QuicklistManager::Default()->Activate();
24+}
25+
26+void
27 Launcher::OnViewPortSwitchStarted()
28 {
29 /*
30
31=== modified file 'plugins/unityshell/src/Launcher.h'
32--- plugins/unityshell/src/Launcher.h 2011-09-28 16:39:36 +0000
33+++ plugins/unityshell/src/Launcher.h 2011-11-30 15:59:26 +0000
34@@ -252,6 +252,7 @@
35 void OnDragFinish(GeisAdapter::GeisDragData* data);
36
37 void OnPluginStateChanged();
38+ void OnExpoTerminated();
39
40 void OnViewPortSwitchStarted();
41 void OnViewPortSwitchEnded();
42
43=== modified file 'plugins/unityshell/src/QuicklistManager.cpp'
44--- plugins/unityshell/src/QuicklistManager.cpp 2011-09-06 18:30:26 +0000
45+++ plugins/unityshell/src/QuicklistManager.cpp 2011-11-30 15:59:26 +0000
46@@ -58,6 +58,12 @@
47 return _current_quicklist;
48 }
49
50+void QuicklistManager::Activate()
51+{
52+ if (_current_quicklist)
53+ _current_quicklist->Activate();
54+}
55+
56 void QuicklistManager::RegisterQuicklist(QuicklistView* quicklist)
57 {
58 std::list<QuicklistView*>::iterator it;
59
60=== modified file 'plugins/unityshell/src/QuicklistManager.h'
61--- plugins/unityshell/src/QuicklistManager.h 2011-08-18 04:22:08 +0000
62+++ plugins/unityshell/src/QuicklistManager.h 2011-11-30 15:59:26 +0000
63@@ -32,6 +32,8 @@
64
65 QuicklistView* Current();
66
67+ void Activate();
68+
69 void RegisterQuicklist(QuicklistView* quicklist);
70 void ShowQuicklist(QuicklistView* quicklist, int tip_x, int tip_y, bool hide_existing_if_open = true);
71 void HideQuicklist(QuicklistView* quicklist);
72
73=== modified file 'plugins/unityshell/src/QuicklistView.cpp'
74--- plugins/unityshell/src/QuicklistView.cpp 2011-09-06 18:30:26 +0000
75+++ plugins/unityshell/src/QuicklistView.cpp 2011-11-30 15:59:26 +0000
76@@ -331,6 +331,19 @@
77 BaseWindow::ShowWindow(b, start_modal);
78 }
79
80+void QuicklistView::Activate()
81+{
82+ // FIXME: ShowWindow shouldn't need to be called first
83+ ShowWindow(true);
84+ PushToFront();
85+ //EnableInputWindow (true, "quicklist", false, true);
86+ //SetInputFocus ();
87+ GrabPointer();
88+ GrabKeyboard();
89+ QueueDraw();
90+ _compute_blur_bkg = true;
91+}
92+
93 void QuicklistView::Show()
94 {
95 if (!IsVisible())
96
97=== modified file 'plugins/unityshell/src/QuicklistView.h'
98--- plugins/unityshell/src/QuicklistView.h 2011-09-06 18:30:26 +0000
99+++ plugins/unityshell/src/QuicklistView.h 2011-11-30 15:59:26 +0000
100@@ -79,6 +79,7 @@
101 void ShowQuicklistWithTipAt(int anchor_tip_x, int anchor_tip_y);
102 virtual void ShowWindow(bool b, bool StartModal = false);
103
104+ void Activate();
105 void Show();
106 void Hide();
107

Subscribers

People subscribed via source and target branches

to all changes: