Merge lp:~saviq/unity-2d/fix-menubar-navigation into lp:unity-2d

Proposed by Michał Sawicz
Status: Merged
Approved by: Gerry Boland
Approved revision: 740
Merged at revision: 740
Proposed branch: lp:~saviq/unity-2d/fix-menubar-navigation
Merge into: lp:unity-2d
Diff against target: 37 lines (+10/-0)
2 files modified
libunity-2d-private/src/indicatorsmanager.cpp (+8/-0)
libunity-2d-private/src/indicatorsmanager.h (+2/-0)
To merge this branch: bzr merge lp:~saviq/unity-2d/fix-menubar-navigation
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Alberto Mardegan (community) Approve
Review via email: mp+77174@code.launchpad.net

Commit message

[panel] only activate menu under cursor if the mouse moved

To post a comment you must log in.
Revision history for this message
Alberto Mardegan (mardy) wrote :

Thanks Michał! Code-wise this looks great!

Unfortunately I cannot test it at the moment -- I'll do that as soon as I'm done working on some Qt issue. :-)
So, it would be great if someone else can verify that the application is indeed functional, and set the review status to "Approved".

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

Yes it works great! I've set this to approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libunity-2d-private/src/indicatorsmanager.cpp'
2--- libunity-2d-private/src/indicatorsmanager.cpp 2011-09-08 15:00:00 +0000
3+++ libunity-2d-private/src/indicatorsmanager.cpp 2011-09-27 14:33:00 +0000
4@@ -127,6 +127,14 @@
5 // Also, delivers motion events to Qt, which will generate correct
6 // enter/leave events for IndicatorEntry widgets.
7 QPoint pos = QCursor::pos();
8+
9+ // Don't send the event unless the mouse has moved
10+ // https://bugs.launchpad.net/bugs/834065
11+ if (!m_lastMousePosition.isNull() && (m_lastMousePosition == pos)) {
12+ return;
13+ }
14+ m_lastMousePosition = pos;
15+
16 QWidget* widget = QApplication::widgetAt(pos);
17 Display* display = QX11Info::display();
18
19
20=== modified file 'libunity-2d-private/src/indicatorsmanager.h'
21--- libunity-2d-private/src/indicatorsmanager.h 2011-08-29 00:47:24 +0000
22+++ libunity-2d-private/src/indicatorsmanager.h 2011-09-27 14:33:00 +0000
23@@ -26,6 +26,7 @@
24 // Qt
25 #include <QMap>
26 #include <QObject>
27+#include <QPoint>
28
29 // libunity-core
30 #include <UnityCore/DBusIndicators.h>
31@@ -63,6 +64,7 @@
32 unity::indicator::DBusIndicators::Ptr m_indicators;
33 QTimer* m_geometrySyncTimer;
34 QTimer* m_mouseTrackerTimer;
35+ QPoint m_lastMousePosition;
36
37 IndicatorEntryWidgetList m_widgetList;
38

Subscribers

People subscribed via source and target branches