Merge lp:~sbte/unity/fix-919328 into lp:unity

Proposed by Sven Baars
Status: Merged
Approved by: Thomi Richards
Approved revision: no longer in the source branch.
Merged at revision: 1957
Proposed branch: lp:~sbte/unity/fix-919328
Merge into: lp:unity
Diff against target: 38 lines (+4/-3)
1 file modified
plugins/unityshell/src/PanelMenuView.cpp (+4/-3)
To merge this branch: bzr merge lp:~sbte/unity/fix-919328
Reviewer Review Type Date Requested Status
Thomi Richards (community) Approve
Review via email: mp+92100@code.launchpad.net

Description of the change

Initialize _is_grabbed before use. Also remove some comparisons to true and false.

Fixes https://bugs.launchpad.net/unity/+bug/919328

To post a comment you must log in.
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

Looks great - thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/PanelMenuView.cpp'
2--- plugins/unityshell/src/PanelMenuView.cpp 2012-02-07 23:25:11 +0000
3+++ plugins/unityshell/src/PanelMenuView.cpp 2012-02-08 18:26:19 +0000
4@@ -63,6 +63,7 @@
5 _is_inside(false),
6 _is_maximized(false),
7 _is_own_window(false),
8+ _is_grabbed(false),
9 _last_active_view(nullptr),
10 _new_application(nullptr),
11 _last_width(0),
12@@ -258,7 +259,7 @@
13 {
14 bool mouse_inside = TestMousePointerInclusionFilterMouseWheel(mouse_position, event_type);
15
16- if (mouse_inside == false)
17+ if (!mouse_inside)
18 return nullptr;
19
20 Area* found_area = nullptr;
21@@ -1644,7 +1645,7 @@
22 void
23 PanelMenuView::OnPanelViewMouseEnter(int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)
24 {
25- if (_is_inside != true)
26+ if (!_is_inside)
27 {
28 if (_is_grabbed)
29 _is_grabbed = false;
30@@ -1658,7 +1659,7 @@
31 void
32 PanelMenuView::OnPanelViewMouseLeave(int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)
33 {
34- if (_is_inside != false)
35+ if (_is_inside)
36 {
37 _is_inside = false;
38 FullRedraw();