Merge lp:~didrocks/unity/fix-696780 into lp:unity

Proposed by Didier Roche-Tolomelli
Status: Merged
Merged at revision: 739
Proposed branch: lp:~didrocks/unity/fix-696780
Merge into: lp:unity
Diff against target: 29 lines (+5/-3)
1 file modified
src/PluginAdapter.cpp (+5/-3)
To merge this branch: bzr merge lp:~didrocks/unity/fix-696780
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Jason Smith (community) Approve
Review via email: mp+45412@code.launchpad.net

Description of the change

fix bug #696780: MAXIMIZE_STATE is a mask composed of horizontal and vertical
maximization. Do a real comparison

To post a comment you must log in.
Revision history for this message
Jason Smith (jassmith) wrote :

+1

review: Approve
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

for the record:
17:52:22 Jason | didrocks, fix your spacing then merge

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/PluginAdapter.cpp'
--- src/PluginAdapter.cpp 2010-12-17 11:02:26 +0000
+++ src/PluginAdapter.cpp 2011-01-06 16:54:11 +0000
@@ -64,12 +64,14 @@
64void64void
65PluginAdapter::NotifyStateChange (CompWindow *window, unsigned int state, unsigned int last_state)65PluginAdapter::NotifyStateChange (CompWindow *window, unsigned int state, unsigned int last_state)
66{66{
67 if (!(last_state & MAXIMIZE_STATE) && (state & MAXIMIZE_STATE))67 if (!((last_state & MAXIMIZE_STATE) == MAXIMIZE_STATE)
68 && ((state & MAXIMIZE_STATE) == MAXIMIZE_STATE))
68 {69 {
69 PluginAdapter::window_maximized.emit (window);70 PluginAdapter::window_maximized.emit (window);
70 WindowManager::window_maximized.emit (window->id ());71 WindowManager::window_maximized.emit (window->id ());
71 }72 }
72 else if ((last_state & MAXIMIZE_STATE) && !(state & MAXIMIZE_STATE))73 else if (((last_state & MAXIMIZE_STATE) == MAXIMIZE_STATE)
74 && !((state & MAXIMIZE_STATE) == MAXIMIZE_STATE))
73 {75 {
74 PluginAdapter::window_restored.emit (window);76 PluginAdapter::window_restored.emit (window);
75 WindowManager::window_restored.emit (window->id ());77 WindowManager::window_restored.emit (window->id ());
@@ -235,7 +237,7 @@
235 window = m_Screen->findWindow (win);237 window = m_Screen->findWindow (win);
236 if (window)238 if (window)
237 {239 {
238 return window->state () & MAXIMIZE_STATE;240 return ((window->state () & MAXIMIZE_STATE) == MAXIMIZE_STATE);
239 }241 }
240242
241 return false;243 return false;