Merge lp:~agateau/unity-2d/keep-launcher-when-menu-is-visible into lp:unity-2d/3.0

Proposed by Aurélien Gâteau
Status: Merged
Approved by: Florian Boucault
Approved revision: 447
Merged at revision: 453
Proposed branch: lp:~agateau/unity-2d/keep-launcher-when-menu-is-visible
Merge into: lp:unity-2d/3.0
Diff against target: 50 lines (+11/-13)
2 files modified
launcher/UnityApplications/launchermenu.cpp (+10/-11)
launcher/UnityApplications/launchermenu.h (+1/-2)
To merge this branch: bzr merge lp:~agateau/unity-2d/keep-launcher-when-menu-is-visible
Reviewer Review Type Date Requested Status
Florian Boucault Pending
Review via email: mp+53397@code.launchpad.net

Commit message

[launcher] Fix regression introduced after this branch was merged: visibleChanged() was not emitted reliably.

See https://bugs.launchpad.net/unity-2d/+bug/722713

Description of the change

Fix regression introduced after this branch was merged: visibleChanged() was not emitted reliably.

See https://bugs.launchpad.net/unity-2d/+bug/722713

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/UnityApplications/launchermenu.cpp'
2--- launcher/UnityApplications/launchermenu.cpp 2011-03-14 17:17:27 +0000
3+++ launcher/UnityApplications/launchermenu.cpp 2011-03-15 10:37:24 +0000
4@@ -247,15 +247,14 @@
5 }
6
7 void
8-LauncherContextualMenu::showEvent(QShowEvent* event)
9-{
10- QMenu::showEvent(event);
11- visibleChanged(true);
12-}
13-
14-void
15-LauncherContextualMenu::hideEvent(QHideEvent* event)
16-{
17- QMenu::hideEvent(event);
18- visibleChanged(false);
19+LauncherContextualMenu::setVisible(bool value)
20+{
21+ bool changed = isVisible() != value;
22+ // The call to QMenu::setVisible() could probably be skipped if 'changed'
23+ // is false, but I'd rather keep the class behavior as close to the default
24+ // setVisible() implementation as possible.
25+ QMenu::setVisible(value);
26+ if (changed) {
27+ visibleChanged(value);
28+ }
29 }
30
31=== modified file 'launcher/UnityApplications/launchermenu.h'
32--- launcher/UnityApplications/launchermenu.h 2011-03-14 16:04:14 +0000
33+++ launcher/UnityApplications/launchermenu.h 2011-03-15 10:37:24 +0000
34@@ -49,6 +49,7 @@
35 void setFolded(int folded);
36 void setLauncherItem(LauncherItem* launcherItem);
37 void setTitle(const QString& title);
38+ void setVisible(bool value);
39
40 Q_INVOKABLE void show(int x, int y);
41 Q_INVOKABLE void hide();
42@@ -58,8 +59,6 @@
43 void resizeEvent(QResizeEvent* event);
44 void leaveEvent(QEvent* event);
45 void enterEvent(QEvent* event);
46- void showEvent(QShowEvent* event);
47- void hideEvent(QHideEvent* event);
48
49 Q_SIGNALS:
50 void foldedChanged(bool);

Subscribers

People subscribed via source and target branches