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
=== modified file 'plugins/unityshell/src/Launcher.cpp'
--- plugins/unityshell/src/Launcher.cpp 2011-09-29 03:45:59 +0000
+++ plugins/unityshell/src/Launcher.cpp 2011-11-30 15:59:26 +0000
@@ -183,7 +183,7 @@
183 plugin_adapter.initiate_spread.connect(sigc::mem_fun(this, &Launcher::OnPluginStateChanged));183 plugin_adapter.initiate_spread.connect(sigc::mem_fun(this, &Launcher::OnPluginStateChanged));
184 plugin_adapter.initiate_expo.connect(sigc::mem_fun(this, &Launcher::OnPluginStateChanged));184 plugin_adapter.initiate_expo.connect(sigc::mem_fun(this, &Launcher::OnPluginStateChanged));
185 plugin_adapter.terminate_spread.connect(sigc::mem_fun(this, &Launcher::OnPluginStateChanged));185 plugin_adapter.terminate_spread.connect(sigc::mem_fun(this, &Launcher::OnPluginStateChanged));
186 plugin_adapter.terminate_expo.connect(sigc::mem_fun(this, &Launcher::OnPluginStateChanged));186 plugin_adapter.terminate_expo.connect(sigc::mem_fun(this, &Launcher::OnExpoTerminated));
187 plugin_adapter.compiz_screen_viewport_switch_started.connect(sigc::mem_fun(this, &Launcher::OnViewPortSwitchStarted));187 plugin_adapter.compiz_screen_viewport_switch_started.connect(sigc::mem_fun(this, &Launcher::OnViewPortSwitchStarted));
188 plugin_adapter.compiz_screen_viewport_switch_ended.connect(sigc::mem_fun(this, &Launcher::OnViewPortSwitchEnded));188 plugin_adapter.compiz_screen_viewport_switch_ended.connect(sigc::mem_fun(this, &Launcher::OnViewPortSwitchEnded));
189189
@@ -1702,6 +1702,16 @@
1702}1702}
17031703
1704void1704void
1705Launcher::OnExpoTerminated()
1706{
1707 _hide_machine->SetQuirk(LauncherHideMachine::EXPO_ACTIVE, WindowManager::Default()->IsExpoActive());
1708
1709 // reactivate the current quicklist when Expo exit on right-clicking.
1710 // otherwise another window will be active and the quicklist will freeze (bug #791810).
1711 QuicklistManager::Default()->Activate();
1712}
1713
1714void
1705Launcher::OnViewPortSwitchStarted()1715Launcher::OnViewPortSwitchStarted()
1706{1716{
1707 /*1717 /*
17081718
=== modified file 'plugins/unityshell/src/Launcher.h'
--- plugins/unityshell/src/Launcher.h 2011-09-28 16:39:36 +0000
+++ plugins/unityshell/src/Launcher.h 2011-11-30 15:59:26 +0000
@@ -252,6 +252,7 @@
252 void OnDragFinish(GeisAdapter::GeisDragData* data);252 void OnDragFinish(GeisAdapter::GeisDragData* data);
253253
254 void OnPluginStateChanged();254 void OnPluginStateChanged();
255 void OnExpoTerminated();
255256
256 void OnViewPortSwitchStarted();257 void OnViewPortSwitchStarted();
257 void OnViewPortSwitchEnded();258 void OnViewPortSwitchEnded();
258259
=== modified file 'plugins/unityshell/src/QuicklistManager.cpp'
--- plugins/unityshell/src/QuicklistManager.cpp 2011-09-06 18:30:26 +0000
+++ plugins/unityshell/src/QuicklistManager.cpp 2011-11-30 15:59:26 +0000
@@ -58,6 +58,12 @@
58 return _current_quicklist;58 return _current_quicklist;
59}59}
6060
61void QuicklistManager::Activate()
62{
63 if (_current_quicklist)
64 _current_quicklist->Activate();
65}
66
61void QuicklistManager::RegisterQuicklist(QuicklistView* quicklist)67void QuicklistManager::RegisterQuicklist(QuicklistView* quicklist)
62{68{
63 std::list<QuicklistView*>::iterator it;69 std::list<QuicklistView*>::iterator it;
6470
=== modified file 'plugins/unityshell/src/QuicklistManager.h'
--- plugins/unityshell/src/QuicklistManager.h 2011-08-18 04:22:08 +0000
+++ plugins/unityshell/src/QuicklistManager.h 2011-11-30 15:59:26 +0000
@@ -32,6 +32,8 @@
3232
33 QuicklistView* Current();33 QuicklistView* Current();
3434
35 void Activate();
36
35 void RegisterQuicklist(QuicklistView* quicklist);37 void RegisterQuicklist(QuicklistView* quicklist);
36 void ShowQuicklist(QuicklistView* quicklist, int tip_x, int tip_y, bool hide_existing_if_open = true);38 void ShowQuicklist(QuicklistView* quicklist, int tip_x, int tip_y, bool hide_existing_if_open = true);
37 void HideQuicklist(QuicklistView* quicklist);39 void HideQuicklist(QuicklistView* quicklist);
3840
=== modified file 'plugins/unityshell/src/QuicklistView.cpp'
--- plugins/unityshell/src/QuicklistView.cpp 2011-09-06 18:30:26 +0000
+++ plugins/unityshell/src/QuicklistView.cpp 2011-11-30 15:59:26 +0000
@@ -331,6 +331,19 @@
331 BaseWindow::ShowWindow(b, start_modal);331 BaseWindow::ShowWindow(b, start_modal);
332}332}
333333
334void QuicklistView::Activate()
335{
336 // FIXME: ShowWindow shouldn't need to be called first
337 ShowWindow(true);
338 PushToFront();
339 //EnableInputWindow (true, "quicklist", false, true);
340 //SetInputFocus ();
341 GrabPointer();
342 GrabKeyboard();
343 QueueDraw();
344 _compute_blur_bkg = true;
345}
346
334void QuicklistView::Show()347void QuicklistView::Show()
335{348{
336 if (!IsVisible())349 if (!IsVisible())
337350
=== modified file 'plugins/unityshell/src/QuicklistView.h'
--- plugins/unityshell/src/QuicklistView.h 2011-09-06 18:30:26 +0000
+++ plugins/unityshell/src/QuicklistView.h 2011-11-30 15:59:26 +0000
@@ -79,6 +79,7 @@
79 void ShowQuicklistWithTipAt(int anchor_tip_x, int anchor_tip_y);79 void ShowQuicklistWithTipAt(int anchor_tip_x, int anchor_tip_y);
80 virtual void ShowWindow(bool b, bool StartModal = false);80 virtual void ShowWindow(bool b, bool StartModal = false);
8181
82 void Activate();
82 void Show();83 void Show();
83 void Hide();84 void Hide();
8485

Subscribers

People subscribed via source and target branches

to all changes: