Merge lp:~compiz-team/compiz-core/oneiric.fix_796594-n into lp:compiz-core/oneiric

Proposed by Sam Spilsbury
Status: Merged
Merged at revision: 2823
Proposed branch: lp:~compiz-team/compiz-core/oneiric.fix_796594-n
Merge into: lp:compiz-core/oneiric
Diff against target: 266 lines (+66/-67)
4 files modified
plugins/decor/src/decor.cpp (+30/-31)
src/window.cpp (+18/-18)
unity/unity_window_decorator/src/events.c (+15/-15)
unity/unity_window_decorator/src/metacity.c (+3/-3)
To merge this branch: bzr merge lp:~compiz-team/compiz-core/oneiric.fix_796594-n
Reviewer Review Type Date Requested Status
Jason Smith (community) Approve
Review via email: mp+77526@code.launchpad.net

This proposal supersedes a proposal from 2011-09-29.

Description of the change

To post a comment you must log in.
2822. By Sam Spilsbury

Remove debug message

Revision history for this message
Jason Smith (jassmith) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/decor/src/decor.cpp'
--- plugins/decor/src/decor.cpp 2011-09-29 04:01:56 +0000
+++ plugins/decor/src/decor.cpp 2011-09-30 02:01:23 +0000
@@ -928,7 +928,7 @@
928 if (!wd)928 if (!wd)
929 return false;929 return false;
930930
931 if ((window->state () & MAXIMIZE_STATE) == MAXIMIZE_STATE)931 if ((window->state () & MAXIMIZE_STATE))
932 window->setWindowFrameExtents (&wd->decor->maxBorder,932 window->setWindowFrameExtents (&wd->decor->maxBorder,
933 &wd->decor->maxInput);933 &wd->decor->maxInput);
934 else if (!window->hasUnmapReference ())934 else if (!window->hasUnmapReference ())
@@ -1078,7 +1078,7 @@
1078 else1078 else
1079 parent = window->frame ();1079 parent = window->frame ();
10801080
1081 if ((window->state () & MAXIMIZE_STATE) == MAXIMIZE_STATE)1081 if ((window->state () & MAXIMIZE_STATE))
1082 {1082 {
1083 border = wd->decor->maxBorder;1083 border = wd->decor->maxBorder;
1084 input = wd->decor->maxInput;1084 input = wd->decor->maxInput;
@@ -1208,7 +1208,7 @@
1208 int bw = server.border () * 2;1208 int bw = server.border () * 2;
1209 CompWindowExtents input;1209 CompWindowExtents input;
12101210
1211 if ((window->state () & MAXIMIZE_STATE) == MAXIMIZE_STATE)1211 if ((window->state () & MAXIMIZE_STATE))
1212 input = wd->decor->maxInput;1212 input = wd->decor->maxInput;
1213 else1213 else
1214 input = wd->decor->input;1214 input = wd->decor->input;
@@ -1995,37 +1995,36 @@
1995void1995void
1996DecorWindow::stateChangeNotify (unsigned int lastState)1996DecorWindow::stateChangeNotify (unsigned int lastState)
1997{1997{
1998 if (!update (true))1998 if (wd && wd->decor)
1999 {1999 {
2000 if (wd && wd->decor)2000 int oldShiftX = shiftX ();
2001 int oldShiftY = shiftY ();
2002 int moveDx, moveDy;
2003
2004 if ((window->state () & MAXIMIZE_STATE))
2001 {2005 {
2002 int oldShiftX = shiftX ();2006 window->setWindowFrameExtents (&wd->decor->maxBorder,
2003 int oldShiftY = shiftY ();2007 &wd->decor->maxInput);
2004 int moveDx, moveDy;
2005
2006 if ((window->state () & MAXIMIZE_STATE) == MAXIMIZE_STATE)
2007 window->setWindowFrameExtents (&wd->decor->maxBorder,
2008 &wd->decor->maxInput);
2009 else
2010 window->setWindowFrameExtents (&wd->decor->border,
2011 &wd->decor->input);
2012
2013 /* Since we immediately update the frame extents, we must
2014 * also update the stored saved window geometry in order
2015 * to prevent the window from shifting back too far once
2016 * unmaximized */
2017
2018 moveDx = shiftX () - oldShiftX;
2019 moveDy = shiftY () - oldShiftY;
2020
2021 if (window->saveMask () & CWX)
2022 window->saveWc ().x += moveDx;
2023
2024 if (window->saveMask () & CWY)
2025 window->saveWc ().y += moveDy;
2026
2027 updateFrame ();
2028 }2008 }
2009 else
2010 window->setWindowFrameExtents (&wd->decor->border,
2011 &wd->decor->input);
2012
2013 /* Since we immediately update the frame extents, we must
2014 * also update the stored saved window geometry in order
2015 * to prevent the window from shifting back too far once
2016 * unmaximized */
2017
2018 moveDx = shiftX () - oldShiftX;
2019 moveDy = shiftY () - oldShiftY;
2020
2021 if (window->saveMask () & CWX)
2022 window->saveWc ().x += moveDx;
2023
2024 if (window->saveMask () & CWY)
2025 window->saveWc ().y += moveDy;
2026
2027 updateFrame ();
2029 }2028 }
20302029
2031 window->stateChangeNotify (lastState);2030 window->stateChangeNotify (lastState);
20322031
=== modified file 'src/window.cpp'
--- src/window.cpp 2011-09-29 04:01:56 +0000
+++ src/window.cpp 2011-09-30 02:01:23 +0000
@@ -3463,8 +3463,8 @@
3463 {3463 {
3464 saveGeometry (CWY | CWHeight);3464 saveGeometry (CWY | CWHeight);
34653465
3466 xwc->height = workArea.height () - serverInput.top -3466 xwc->height = workArea.height () - border.top -
3467 serverInput.bottom - old.border () * 2;3467 border.bottom - old.border () * 2;
34683468
3469 mask |= CWHeight;3469 mask |= CWHeight;
3470 }3470 }
@@ -3477,8 +3477,8 @@
3477 {3477 {
3478 saveGeometry (CWX | CWWidth);3478 saveGeometry (CWX | CWWidth);
34793479
3480 xwc->width = workArea.width () - serverInput.left -3480 xwc->width = workArea.width () - border.left -
3481 serverInput.right - old.border () * 2;3481 border.right - old.border () * 2;
34823482
3483 mask |= CWWidth;3483 mask |= CWWidth;
3484 }3484 }
@@ -3545,9 +3545,9 @@
35453545
3546 if (state & CompWindowStateMaximizedVertMask)3546 if (state & CompWindowStateMaximizedVertMask)
3547 {3547 {
3548 if (old.y () < y + workArea.y () + serverInput.top)3548 if (old.y () < y + workArea.y () + border.top)
3549 {3549 {
3550 xwc->y = y + workArea.y () + serverInput.top;3550 xwc->y = y + workArea.y () + border.top;
3551 mask |= CWY;3551 mask |= CWY;
3552 }3552 }
3553 else3553 else
@@ -3555,16 +3555,16 @@
3555 height = xwc->height + old.border () * 2;3555 height = xwc->height + old.border () * 2;
35563556
3557 max = y + workArea.bottom ();3557 max = y + workArea.bottom ();
3558 if (old.y () + (int) old.height () + serverInput.bottom > max)3558 if (old.y () + (int) old.height () + border.bottom > max)
3559 {3559 {
3560 xwc->y = max - height - serverInput.bottom;3560 xwc->y = max - height - border.bottom;
3561 mask |= CWY;3561 mask |= CWY;
3562 }3562 }
3563 else if (old.y () + height + serverInput.bottom > max)3563 else if (old.y () + height + border.bottom > max)
3564 {3564 {
3565 xwc->y = y + workArea.y () +3565 xwc->y = y + workArea.y () +
3566 (workArea.height () - serverInput.top - height -3566 (workArea.height () - border.top - height -
3567 serverInput.bottom) / 2 + serverInput.top;3567 border.bottom) / 2 + border.top;
3568 mask |= CWY;3568 mask |= CWY;
3569 }3569 }
3570 }3570 }
@@ -3572,9 +3572,9 @@
35723572
3573 if (state & CompWindowStateMaximizedHorzMask)3573 if (state & CompWindowStateMaximizedHorzMask)
3574 {3574 {
3575 if (old.x () < x + workArea.x () + serverInput.left)3575 if (old.x () < x + workArea.x () + border.left)
3576 {3576 {
3577 xwc->x = x + workArea.x () + serverInput.left;3577 xwc->x = x + workArea.x () + border.left;
3578 mask |= CWX;3578 mask |= CWX;
3579 }3579 }
3580 else3580 else
@@ -3582,16 +3582,16 @@
3582 width = xwc->width + old.border () * 2;3582 width = xwc->width + old.border () * 2;
35833583
3584 max = x + workArea.right ();3584 max = x + workArea.right ();
3585 if (old.x () + (int) old.width () + serverInput.right > max)3585 if (old.x () + (int) old.width () + border.right > max)
3586 {3586 {
3587 xwc->x = max - width - serverInput.right;3587 xwc->x = max - width - border.right;
3588 mask |= CWX;3588 mask |= CWX;
3589 }3589 }
3590 else if (old.x () + width + serverInput.right > max)3590 else if (old.x () + width + border.right > max)
3591 {3591 {
3592 xwc->x = x + workArea.x () +3592 xwc->x = x + workArea.x () +
3593 (workArea.width () - serverInput.left - width -3593 (workArea.width () - border.left - width -
3594 serverInput.right) / 2 + serverInput.left;3594 border.right) / 2 + border.left;
3595 mask |= CWX;3595 mask |= CWX;
3596 }3596 }
3597 }3597 }
35983598
=== modified file 'unity/unity_window_decorator/src/events.c'
--- unity/unity_window_decorator/src/events.c 2011-09-22 04:30:04 +0000
+++ unity/unity_window_decorator/src/events.c 2011-09-30 02:01:23 +0000
@@ -136,26 +136,26 @@
136 {136 {
137 if (state == BUTTON_EVENT_ACTION_STATE)137 if (state == BUTTON_EVENT_ACTION_STATE)
138 {138 {
139 if (gtkwd_event->button == 2)139 if (wnck_window_is_maximized (win))
140 wnck_window_unmaximize (win);
141 if (wnck_window_is_maximized_vertically (win))
142 wnck_window_unmaximize_vertically (win);
143 else if (wnck_window_is_maximized_horizontally (win))
144 wnck_window_unmaximize_horizontally (win);
145 else
140 {146 {
141 if (wnck_window_is_maximized_vertically (win))147 if (gtkwd_event->button == 2)
142 wnck_window_unmaximize_vertically (win);148 {
143 else
144 wnck_window_maximize_vertically (win);149 wnck_window_maximize_vertically (win);
145 }150 }
146 else if (gtkwd_event->button == 3)151 else if (gtkwd_event->button == 3)
147 {152 {
148 if (wnck_window_is_maximized_horizontally (win))
149 wnck_window_unmaximize_horizontally (win);
150 else
151 wnck_window_maximize_horizontally (win);153 wnck_window_maximize_horizontally (win);
152 }154 }
153 else
154 {
155 if (wnck_window_is_maximized (win))
156 wnck_window_unmaximize (win);
157 else155 else
156 {
158 wnck_window_maximize (win);157 wnck_window_maximize (win);
158 }
159 }159 }
160 }160 }
161 }161 }
162162
=== modified file 'unity/unity_window_decorator/src/metacity.c'
--- unity/unity_window_decorator/src/metacity.c 2011-09-22 04:30:04 +0000
+++ unity/unity_window_decorator/src/metacity.c 2011-09-30 02:01:23 +0000
@@ -527,7 +527,7 @@
527 if (d->active)527 if (d->active)
528 *flags |= (MetaFrameFlags ) META_FRAME_HAS_FOCUS;528 *flags |= (MetaFrameFlags ) META_FRAME_HAS_FOCUS;
529529
530 if ((d->state & META_MAXIMIZED) == META_MAXIMIZED)530 if ((d->state & META_MAXIMIZED))
531 *flags |= (MetaFrameFlags ) META_FRAME_MAXIMIZED;531 *flags |= (MetaFrameFlags ) META_FRAME_MAXIMIZED;
532532
533 if (d->state & WNCK_WINDOW_STATE_STICKY)533 if (d->state & WNCK_WINDOW_STATE_STICKY)
@@ -1153,7 +1153,7 @@
1153 decor_context_t *context;1153 decor_context_t *context;
1154 decor_shadow_t *shadow;1154 decor_shadow_t *shadow;
11551155
1156 if ((d->state & META_MAXIMIZED) == META_MAXIMIZED)1156 if ((d->state & META_MAXIMIZED))
1157 {1157 {
1158 if (!d->frame_window)1158 if (!d->frame_window)
1159 {1159 {
@@ -1217,7 +1217,7 @@
1217 }1217 }
1218 else1218 else
1219 {1219 {
1220 if ((d->state & META_MAXIMIZED) == META_MAXIMIZED)1220 if ((d->state & META_MAXIMIZED))
1221 decor_get_default_layout (context, d->client_width,1221 decor_get_default_layout (context, d->client_width,
1222 d->client_height - titlebar_height,1222 d->client_height - titlebar_height,
1223 &layout);1223 &layout);

Subscribers

People subscribed via source and target branches

to all changes: