Merge lp:~sil2100/unity/fix_sigc_disconnecting_expo into lp:unity

Proposed by Łukasz Zemczak
Status: Rejected
Rejected by: Marco Trevisan (Treviño)
Proposed branch: lp:~sil2100/unity/fix_sigc_disconnecting_expo
Merge into: lp:unity
Diff against target: 39 lines (+8/-1)
2 files modified
launcher/LauncherIcon.cpp (+7/-1)
launcher/LauncherIcon.h (+1/-0)
To merge this branch: bzr merge lp:~sil2100/unity/fix_sigc_disconnecting_expo
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Disapprove
Review via email: mp+141108@code.launchpad.net

Description of the change

Branch submitted for comment! This is a *workaround*! Now I noticed that it is more a bug in libsigc++!

- Problem:

Bug #1090565 - when exiting from expo using right-click on launcher icon (quicklist opening), every next expo exit (either though click on the workspaces icon or using keybindings) will result in the quicklist being opened afterwards.
The reason for this is that the on every terminate_expo signal, the quicklist-opening callback is executed, since magically it doesn't get disconnected properly after calling .disconnect() from the body of the callback (!?).
NOTE! This might be a bug in sigc! As the same code worked on precise.

- Fix:

This is a workaround. We use a bool flag to disable the callback inside its body.

- Tests:

None right now.

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

Weird. Can be a lambda issue.

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Yes, I need to revisit this one and once again try looking into it. But there's so much other things to do...

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

This is caused by the econnection not being properly set, fixed in branch lp:~3v1n0/unity/quicklist-disconnect-on-expo-terminated

review: Disapprove

Unmerged revisions

3008. By Łukasz Zemczak

Add comment

3007. By Łukasz Zemczak

It seems that disconnecting a handler from a sigc signal is not possible from the handler body (?!). Not sure why. But only this way we'll be sure that the quicklist-showing will be executed only once.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/LauncherIcon.cpp'
2--- launcher/LauncherIcon.cpp 2012-12-12 15:21:38 +0000
3+++ launcher/LauncherIcon.cpp 2013-01-02 08:29:22 +0000
4@@ -73,6 +73,7 @@
5 : _icon_type(type)
6 , _sticky(false)
7 , _remote_urgent(false)
8+ , _quicklist_after_expo(false)
9 , _present_urgency(0)
10 , _progress(0)
11 , _sort_priority(DefaultPriority(type))
12@@ -620,9 +621,14 @@
13 * shwing the icon quicklist. */
14 if (win_manager.IsExpoActive())
15 {
16+ _quicklist_after_expo = true;
17 on_expo_terminated_connection = win_manager.terminate_expo.connect([&, tip_x, tip_y]() {
18- QuicklistManager::Default()->ShowQuicklist(_quicklist.GetPointer(), tip_x, tip_y);
19+ /* XXX: An ugly workaround, since for unknown reasons yet disconnecting
20+ * the signal from inside this particular callback does not work */
21+ if (_quicklist_after_expo)
22+ QuicklistManager::Default()->ShowQuicklist(_quicklist.GetPointer(), tip_x, tip_y);
23 on_expo_terminated_connection.disconnect();
24+ _quicklist_after_expo = false;
25 });
26 }
27 else
28
29=== modified file 'launcher/LauncherIcon.h'
30--- launcher/LauncherIcon.h 2012-11-27 01:09:26 +0000
31+++ launcher/LauncherIcon.h 2013-01-02 08:29:22 +0000
32@@ -309,6 +309,7 @@
33
34 bool _sticky;
35 bool _remote_urgent;
36+ bool _quicklist_after_expo;
37 float _present_urgency;
38 float _progress;
39 int _sort_priority;