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
=== modified file 'plugins/unityshell/src/PanelMenuView.cpp'
--- plugins/unityshell/src/PanelMenuView.cpp 2012-02-07 23:25:11 +0000
+++ plugins/unityshell/src/PanelMenuView.cpp 2012-02-08 18:26:19 +0000
@@ -63,6 +63,7 @@
63 _is_inside(false),63 _is_inside(false),
64 _is_maximized(false),64 _is_maximized(false),
65 _is_own_window(false),65 _is_own_window(false),
66 _is_grabbed(false),
66 _last_active_view(nullptr),67 _last_active_view(nullptr),
67 _new_application(nullptr),68 _new_application(nullptr),
68 _last_width(0),69 _last_width(0),
@@ -258,7 +259,7 @@
258{259{
259 bool mouse_inside = TestMousePointerInclusionFilterMouseWheel(mouse_position, event_type);260 bool mouse_inside = TestMousePointerInclusionFilterMouseWheel(mouse_position, event_type);
260261
261 if (mouse_inside == false)262 if (!mouse_inside)
262 return nullptr;263 return nullptr;
263264
264 Area* found_area = nullptr;265 Area* found_area = nullptr;
@@ -1644,7 +1645,7 @@
1644void1645void
1645PanelMenuView::OnPanelViewMouseEnter(int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)1646PanelMenuView::OnPanelViewMouseEnter(int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)
1646{1647{
1647 if (_is_inside != true)1648 if (!_is_inside)
1648 {1649 {
1649 if (_is_grabbed)1650 if (_is_grabbed)
1650 _is_grabbed = false;1651 _is_grabbed = false;
@@ -1658,7 +1659,7 @@
1658void1659void
1659PanelMenuView::OnPanelViewMouseLeave(int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)1660PanelMenuView::OnPanelViewMouseLeave(int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)
1660{1661{
1661 if (_is_inside != false)1662 if (_is_inside)
1662 {1663 {
1663 _is_inside = false;1664 _is_inside = false;
1664 FullRedraw();1665 FullRedraw();