Merge lp:~gerboland/unity-2d/launcher-menu-mouse-focus into lp:unity-2d

Proposed by Gerry Boland
Status: Merged
Approved by: Michał Sawicz
Approved revision: 765
Merged at revision: 766
Proposed branch: lp:~gerboland/unity-2d/launcher-menu-mouse-focus
Merge into: lp:unity-2d
Diff against target: 37 lines (+10/-0)
2 files modified
libunity-2d-private/src/launchermenu.cpp (+9/-0)
libunity-2d-private/src/launchermenu.h (+1/-0)
To merge this branch: bzr merge lp:~gerboland/unity-2d/launcher-menu-mouse-focus
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
Review via email: mp+79861@code.launchpad.net

Description of the change

[launcher] Have ContextualMenu watch for focusOut event. Fixes bug:877388

To post a comment you must log in.
Revision history for this message
Michał Sawicz (saviq) wrote :

Looks good, does this, by any chance, actually fix bug 817417, too?

review: Approve
Revision history for this message
Gerry Boland (gerboland) wrote :

Yes it does actually. Sweet :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libunity-2d-private/src/launchermenu.cpp'
2--- libunity-2d-private/src/launchermenu.cpp 2011-08-26 08:51:18 +0000
3+++ libunity-2d-private/src/launchermenu.cpp 2011-10-19 17:48:48 +0000
4@@ -157,6 +157,14 @@
5 }
6
7 void
8+LauncherContextualMenu::focusOutEvent(QFocusEvent* event)
9+{
10+ /* Hide menu if mouse click outside widget */
11+ m_hidingDelayTimer.stop();
12+ hide();
13+}
14+
15+void
16 LauncherContextualMenu::show(int x, int y)
17 {
18 m_hidingDelayTimer.stop();
19@@ -304,6 +312,7 @@
20 break;
21 }
22 }
23+ QMenu::setFocus();
24 }
25
26 void
27
28=== modified file 'libunity-2d-private/src/launchermenu.h'
29--- libunity-2d-private/src/launchermenu.h 2011-07-29 13:49:34 +0000
30+++ libunity-2d-private/src/launchermenu.h 2011-10-19 17:48:48 +0000
31@@ -62,6 +62,7 @@
32 void resizeEvent(QResizeEvent* event);
33 void leaveEvent(QEvent* event);
34 void enterEvent(QEvent* event);
35+ void focusOutEvent(QFocusEvent* event);
36 void paintEvent(QPaintEvent* event);
37 void keyPressEvent(QKeyEvent* event);
38

Subscribers

People subscribed via source and target branches