Merge lp:~compiz-team/compiz/compiz.fix_1186560 into lp:compiz/0.9.10
- compiz.fix_1186560
- Merge into 0.9.10
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 3751 | ||||
Proposed branch: | lp:~compiz-team/compiz/compiz.fix_1186560 | ||||
Merge into: | lp:compiz/0.9.10 | ||||
Diff against target: |
398 lines (+122/-90) 4 files modified
gtk/window-decorator/tests/test_gwd_settings.cpp (+98/-51) plugins/decor/src/decor.cpp (+21/-35) plugins/decor/src/decor.h (+2/-0) src/window.cpp (+1/-4) |
||||
To merge this branch: | bzr merge lp:~compiz-team/compiz/compiz.fix_1186560 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Compiz Maintainers | Pending | ||
Review via email: mp+167472@code.launchpad.net |
Commit message
Don't cause maximized windows to be double adjusted upon decoration change.
This is effectively a bundle of fixes in one:
1. Don't adjust maximized windows after their decorations change with
addWindowSiz
and then any other decoration size change can handle itself
2. Don't cause the saved co-ordinates to be updated upon unmaximization
3. Don't put the decoration adjustment on a timer. Do it immediately.
The calling WindowInterface
longer a problem.
(LP: #1186560)
Description of the change
Don't cause maximized windows to be double adjusted upon decoration change.
This is effectively a bundle of fixes in one:
1. Don't adjust maximized windows after their decorations change with
addWindowSiz
and then any other decoration size change can handle itself
2. Don't cause the saved co-ordinates to be updated upon unmaximization
3. Don't put the decoration adjustment on a timer. Do it immediately.
The calling WindowInterface
longer a problem.
(LP: #1186560)
Please test this, but don't merge it yet. I'd prefer to wait until we have a testsuite for the decor plugin.
MC Return (mc-return) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3736
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Sam Spilsbury (smspillaz) wrote : | # |
I imagine that this will be folded into an unrevert of the relevant revision.
Preview Diff
1 | === modified file 'gtk/window-decorator/tests/test_gwd_settings.cpp' | |||
2 | --- gtk/window-decorator/tests/test_gwd_settings.cpp 2013-03-06 13:44:06 +0000 | |||
3 | +++ gtk/window-decorator/tests/test_gwd_settings.cpp 2013-06-05 08:25:46 +0000 | |||
4 | @@ -258,8 +258,6 @@ | |||
5 | 258 | { | 258 | { |
6 | 259 | }; | 259 | }; |
7 | 260 | 260 | ||
8 | 261 | const GValue referenceGValue = G_VALUE_INIT; | ||
9 | 262 | |||
10 | 263 | namespace | 261 | namespace |
11 | 264 | { | 262 | { |
12 | 265 | void gwd_settings_storage_unref (GWDSettingsStorage *storage) | 263 | void gwd_settings_storage_unref (GWDSettingsStorage *storage) |
13 | @@ -287,7 +285,11 @@ | |||
14 | 287 | 285 | ||
15 | 288 | AutoUnsetGValue (GType type) | 286 | AutoUnsetGValue (GType type) |
16 | 289 | { | 287 | { |
18 | 290 | memcpy (&mValue, &referenceGValue, sizeof (GValue)); | 288 | /* This is effectively G_VALUE_INIT, we can't use that here |
19 | 289 | * because this is not a C++11 project */ | ||
20 | 290 | mValue.g_type = 0; | ||
21 | 291 | mValue.data[0].v_int = 0; | ||
22 | 292 | mValue.data[1].v_int = 0; | ||
23 | 291 | g_value_init (&mValue, type); | 293 | g_value_init (&mValue, type); |
24 | 292 | } | 294 | } |
25 | 293 | 295 | ||
26 | @@ -423,109 +425,154 @@ | |||
27 | 423 | EXPECT_CALL (settingsGMock, dispose ()); | 425 | EXPECT_CALL (settingsGMock, dispose ()); |
28 | 424 | EXPECT_CALL (settingsGMock, finalize ()); | 426 | EXPECT_CALL (settingsGMock, finalize ()); |
29 | 425 | 427 | ||
30 | 428 | /* The order of evaluation of matchers in Google Mock appears to be undefined and | ||
31 | 429 | * the way GValueMatch is written makes it particularly unsafe when used with | ||
32 | 430 | * matchers of multiple types on the same function, since there's no guaruntee | ||
33 | 431 | * that the matchers will be traversed in any order. If a type is passed to | ||
34 | 432 | * any of the matchers that it doesn't know how to handle then it will | ||
35 | 433 | * call directly through to GValueCmp which will run into undefined behaviour | ||
36 | 434 | * in itself. | ||
37 | 435 | * | ||
38 | 436 | * In reality, the API for GValueMatch is probably a little bit broken in this | ||
39 | 437 | * sense, but just satisfying each expectation as soon as its set seems to do | ||
40 | 438 | * the job here | ||
41 | 439 | */ | ||
42 | 440 | |||
43 | 426 | /* calling g_object_get_property actually resets | 441 | /* calling g_object_get_property actually resets |
44 | 427 | * the value so expecting 0x0 is correct */ | 442 | * the value so expecting 0x0 is correct */ |
45 | 428 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_ACTIVE_SHADOW, | 443 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_ACTIVE_SHADOW, |
46 | 429 | GValueMatch <gpointer> (0x0, g_value_get_pointer), | 444 | GValueMatch <gpointer> (0x0, g_value_get_pointer), |
47 | 430 | _)); | 445 | _)); |
48 | 446 | |||
49 | 447 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
50 | 448 | "active-shadow", | ||
51 | 449 | &pointerGValue); | ||
52 | 450 | |||
53 | 431 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_INACTIVE_SHADOW, | 451 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_INACTIVE_SHADOW, |
54 | 432 | GValueMatch <gpointer> (0x0, g_value_get_pointer), | 452 | GValueMatch <gpointer> (0x0, g_value_get_pointer), |
55 | 433 | _)); | 453 | _)); |
56 | 454 | |||
57 | 455 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
58 | 456 | "inactive-shadow", | ||
59 | 457 | &pointerGValue); | ||
60 | 458 | |||
61 | 434 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_USE_TOOLTIPS, | 459 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_USE_TOOLTIPS, |
62 | 435 | GValueMatch <gboolean> (FALSE, g_value_get_boolean), | 460 | GValueMatch <gboolean> (FALSE, g_value_get_boolean), |
63 | 436 | _)); | 461 | _)); |
64 | 462 | |||
65 | 463 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
66 | 464 | "use-tooltips", | ||
67 | 465 | &booleanGValue); | ||
68 | 466 | |||
69 | 437 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_DRAGGABLE_BORDER_WIDTH, | 467 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_DRAGGABLE_BORDER_WIDTH, |
70 | 438 | GValueMatch <gint> (0, g_value_get_int), | 468 | GValueMatch <gint> (0, g_value_get_int), |
71 | 439 | _)); | 469 | _)); |
72 | 470 | |||
73 | 471 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
74 | 472 | "draggable-border-width", | ||
75 | 473 | &integerGValue); | ||
76 | 474 | |||
77 | 440 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_ATTACH_MODAL_DIALOGS, | 475 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_ATTACH_MODAL_DIALOGS, |
78 | 441 | GValueMatch <gboolean> (FALSE, g_value_get_boolean), | 476 | GValueMatch <gboolean> (FALSE, g_value_get_boolean), |
79 | 442 | _)); | 477 | _)); |
80 | 478 | |||
81 | 479 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
82 | 480 | "attach-modal-dialogs", | ||
83 | 481 | &booleanGValue); | ||
84 | 482 | |||
85 | 443 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_BLUR_CHANGED, | 483 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_BLUR_CHANGED, |
86 | 444 | GValueMatch <gint> (0, g_value_get_int), | 484 | GValueMatch <gint> (0, g_value_get_int), |
87 | 445 | _)); | 485 | _)); |
88 | 486 | |||
89 | 487 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
90 | 488 | "blur", | ||
91 | 489 | &integerGValue); | ||
92 | 490 | |||
93 | 446 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_METACITY_THEME, | 491 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_METACITY_THEME, |
94 | 447 | GValueMatch <const gchar *> (NULL, g_value_get_string), | 492 | GValueMatch <const gchar *> (NULL, g_value_get_string), |
95 | 448 | _)); | 493 | _)); |
96 | 494 | |||
97 | 495 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
98 | 496 | "metacity-theme", | ||
99 | 497 | &stringGValue); | ||
100 | 498 | |||
101 | 449 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_ACTIVE_OPACITY, | 499 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_ACTIVE_OPACITY, |
102 | 450 | GValueMatch <gdouble> (0.0, g_value_get_double), | 500 | GValueMatch <gdouble> (0.0, g_value_get_double), |
103 | 451 | _)); | 501 | _)); |
104 | 502 | |||
105 | 503 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
106 | 504 | "metacity-active-opacity", | ||
107 | 505 | &doubleGValue); | ||
108 | 506 | |||
109 | 452 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_INACTIVE_OPACITY, | 507 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_INACTIVE_OPACITY, |
110 | 453 | GValueMatch <gdouble> (0.0, g_value_get_double), | 508 | GValueMatch <gdouble> (0.0, g_value_get_double), |
111 | 454 | _)); | 509 | _)); |
112 | 510 | |||
113 | 511 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
114 | 512 | "metacity-inactive-opacity", | ||
115 | 513 | &doubleGValue); | ||
116 | 514 | |||
117 | 455 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_ACTIVE_SHADE_OPACITY, | 515 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_ACTIVE_SHADE_OPACITY, |
118 | 456 | GValueMatch <gboolean> (FALSE, g_value_get_boolean), | 516 | GValueMatch <gboolean> (FALSE, g_value_get_boolean), |
119 | 457 | _)); | 517 | _)); |
120 | 518 | |||
121 | 519 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
122 | 520 | "metacity-active-shade-opacity", | ||
123 | 521 | &booleanGValue); | ||
124 | 522 | |||
125 | 458 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_INACTIVE_SHADE_OPACITY, | 523 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_INACTIVE_SHADE_OPACITY, |
126 | 459 | GValueMatch <gboolean> (FALSE, g_value_get_boolean), | 524 | GValueMatch <gboolean> (FALSE, g_value_get_boolean), |
127 | 460 | _)); | 525 | _)); |
128 | 526 | |||
129 | 527 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
130 | 528 | "metacity-inactive-shade-opacity", | ||
131 | 529 | &booleanGValue); | ||
132 | 530 | |||
133 | 461 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_BUTTON_LAYOUT, | 531 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_BUTTON_LAYOUT, |
134 | 462 | GValueMatch <const gchar *> (NULL, g_value_get_string), | 532 | GValueMatch <const gchar *> (NULL, g_value_get_string), |
135 | 463 | _)); | 533 | _)); |
136 | 534 | |||
137 | 535 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
138 | 536 | "metacity-button-layout", | ||
139 | 537 | &stringGValue); | ||
140 | 538 | |||
141 | 464 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_TITLEBAR_ACTION_DOUBLE_CLICK, | 539 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_TITLEBAR_ACTION_DOUBLE_CLICK, |
142 | 465 | GValueMatch <gint> (0, g_value_get_int), | 540 | GValueMatch <gint> (0, g_value_get_int), |
143 | 466 | _)); | 541 | _)); |
144 | 542 | |||
145 | 543 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
146 | 544 | "titlebar-double-click-action", | ||
147 | 545 | &integerGValue); | ||
148 | 546 | |||
149 | 467 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_TITLEBAR_ACTION_MIDDLE_CLICK, | 547 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_TITLEBAR_ACTION_MIDDLE_CLICK, |
150 | 468 | GValueMatch <gint> (0, g_value_get_int), | 548 | GValueMatch <gint> (0, g_value_get_int), |
151 | 469 | _)); | 549 | _)); |
152 | 550 | |||
153 | 551 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
154 | 552 | "titlebar-middle-click-action", | ||
155 | 553 | &integerGValue); | ||
156 | 554 | |||
157 | 470 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_TITLEBAR_ACTION_RIGHT_CLICK, | 555 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_TITLEBAR_ACTION_RIGHT_CLICK, |
158 | 471 | GValueMatch <gint> (0, g_value_get_int), | 556 | GValueMatch <gint> (0, g_value_get_int), |
159 | 472 | _)); | 557 | _)); |
160 | 558 | |||
161 | 559 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
162 | 560 | "titlebar-right-click-action", | ||
163 | 561 | &integerGValue); | ||
164 | 562 | |||
165 | 473 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_MOUSE_WHEEL_ACTION, | 563 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_MOUSE_WHEEL_ACTION, |
166 | 474 | GValueMatch <gint> (0, g_value_get_int), | 564 | GValueMatch <gint> (0, g_value_get_int), |
167 | 475 | _)); | 565 | _)); |
168 | 566 | |||
169 | 567 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
170 | 568 | "mouse-wheel-action", | ||
171 | 569 | &integerGValue); | ||
172 | 570 | |||
173 | 476 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_TITLEBAR_FONT, | 571 | EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_TITLEBAR_FONT, |
174 | 477 | GValueMatch <const gchar *> (NULL, g_value_get_string), | 572 | GValueMatch <const gchar *> (NULL, g_value_get_string), |
175 | 478 | _)); | 573 | _)); |
176 | 479 | 574 | ||
177 | 480 | g_object_get_property (G_OBJECT (settingsMock.get ()), | 575 | g_object_get_property (G_OBJECT (settingsMock.get ()), |
178 | 481 | "active-shadow", | ||
179 | 482 | &pointerGValue); | ||
180 | 483 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
181 | 484 | "inactive-shadow", | ||
182 | 485 | &pointerGValue); | ||
183 | 486 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
184 | 487 | "use-tooltips", | ||
185 | 488 | &booleanGValue); | ||
186 | 489 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
187 | 490 | "draggable-border-width", | ||
188 | 491 | &integerGValue); | ||
189 | 492 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
190 | 493 | "attach-modal-dialogs", | ||
191 | 494 | &booleanGValue); | ||
192 | 495 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
193 | 496 | "blur", | ||
194 | 497 | &integerGValue); | ||
195 | 498 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
196 | 499 | "metacity-theme", | ||
197 | 500 | &stringGValue); | ||
198 | 501 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
199 | 502 | "metacity-active-opacity", | ||
200 | 503 | &doubleGValue); | ||
201 | 504 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
202 | 505 | "metacity-inactive-opacity", | ||
203 | 506 | &doubleGValue); | ||
204 | 507 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
205 | 508 | "metacity-active-shade-opacity", | ||
206 | 509 | &booleanGValue); | ||
207 | 510 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
208 | 511 | "metacity-inactive-shade-opacity", | ||
209 | 512 | &booleanGValue); | ||
210 | 513 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
211 | 514 | "metacity-button-layout", | ||
212 | 515 | &stringGValue); | ||
213 | 516 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
214 | 517 | "titlebar-double-click-action", | ||
215 | 518 | &integerGValue); | ||
216 | 519 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
217 | 520 | "titlebar-middle-click-action", | ||
218 | 521 | &integerGValue); | ||
219 | 522 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
220 | 523 | "titlebar-right-click-action", | ||
221 | 524 | &integerGValue); | ||
222 | 525 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
223 | 526 | "mouse-wheel-action", | ||
224 | 527 | &integerGValue); | ||
225 | 528 | g_object_get_property (G_OBJECT (settingsMock.get ()), | ||
226 | 529 | "titlebar-font", | 576 | "titlebar-font", |
227 | 530 | &stringGValue); | 577 | &stringGValue); |
228 | 531 | } | 578 | } |
229 | 532 | 579 | ||
230 | === modified file 'plugins/decor/src/decor.cpp' | |||
231 | --- plugins/decor/src/decor.cpp 2013-05-20 15:26:11 +0000 | |||
232 | +++ plugins/decor/src/decor.cpp 2013-06-05 08:25:46 +0000 | |||
233 | @@ -1149,9 +1149,8 @@ | |||
234 | 1149 | /* | 1149 | /* |
235 | 1150 | * decorOffsetMove | 1150 | * decorOffsetMove |
236 | 1151 | * | 1151 | * |
240 | 1152 | * Function called on a timer (to avoid calling configureXWindow from | 1152 | * Moves the window by the offset specified in the xwc. |
241 | 1153 | * within a ::moveNotify) which actually moves the window by the offset | 1153 | * Also sends a notification that the window |
239 | 1154 | * specified in the xwc. Also sends a notification that the window | ||
242 | 1155 | * was decorated | 1154 | * was decorated |
243 | 1156 | * | 1155 | * |
244 | 1157 | */ | 1156 | */ |
245 | @@ -1522,7 +1521,7 @@ | |||
246 | 1522 | 1521 | ||
247 | 1523 | int dx = movement.x () - lastShift.x (); | 1522 | int dx = movement.x () - lastShift.x (); |
248 | 1524 | int dy = movement.y () - lastShift.y (); | 1523 | int dy = movement.y () - lastShift.y (); |
250 | 1525 | int dwidth = sizeDelta.width () - lastSizeDelta.height (); | 1524 | int dwidth = sizeDelta.width () - lastSizeDelta.width (); |
251 | 1526 | int dheight = sizeDelta.height () - lastSizeDelta.height (); | 1525 | int dheight = sizeDelta.height () - lastSizeDelta.height (); |
252 | 1527 | 1526 | ||
253 | 1528 | /* We don't apply these rules to override-redirect windows | 1527 | /* We don't apply these rules to override-redirect windows |
254 | @@ -1557,16 +1556,18 @@ | |||
255 | 1557 | if (window->state () & CompWindowStateMaximizedVertMask) | 1556 | if (window->state () & CompWindowStateMaximizedVertMask) |
256 | 1558 | mask &= ~(CWY | CWHeight); | 1557 | mask &= ~(CWY | CWHeight); |
257 | 1559 | 1558 | ||
259 | 1560 | if (window->saveMask () & CWX) | 1559 | /* We don't want to make changes to the saved co-ordinates |
260 | 1560 | * if we're unmaximizing */ | ||
261 | 1561 | if ((window->saveMask () & ~mask) & CWX) | ||
262 | 1561 | window->saveWc ().x += xwc.x; | 1562 | window->saveWc ().x += xwc.x; |
263 | 1562 | 1563 | ||
265 | 1563 | if (window->saveMask () & CWY) | 1564 | if ((window->saveMask () & ~mask) & CWY) |
266 | 1564 | window->saveWc ().y += xwc.y; | 1565 | window->saveWc ().y += xwc.y; |
267 | 1565 | 1566 | ||
269 | 1566 | if (window->saveMask () & CWWidth) | 1567 | if ((window->saveMask () & ~mask) & CWWidth) |
270 | 1567 | window->saveWc ().width += xwc.width; | 1568 | window->saveWc ().width += xwc.width; |
271 | 1568 | 1569 | ||
273 | 1569 | if (window->saveMask () & CWHeight) | 1570 | if ((window->saveMask () & ~mask) & CWHeight) |
274 | 1570 | window->saveWc ().height += xwc.height; | 1571 | window->saveWc ().height += xwc.height; |
275 | 1571 | 1572 | ||
276 | 1572 | /* If the window has not been placed, do not move it this time | 1573 | /* If the window has not been placed, do not move it this time |
277 | @@ -1585,10 +1586,7 @@ | |||
278 | 1585 | * FIXME: CompTimer should really be PIMPL and allow | 1586 | * FIXME: CompTimer should really be PIMPL and allow |
279 | 1586 | * refcounting in case we need to keep it alive | 1587 | * refcounting in case we need to keep it alive |
280 | 1587 | */ | 1588 | */ |
285 | 1588 | if (instant) | 1589 | decorOffsetMove (window, xwc, mask); |
282 | 1589 | decorOffsetMove (window, xwc, mask); | ||
283 | 1590 | else | ||
284 | 1591 | moveUpdate.start (boost::bind (decorOffsetMove, window, xwc, mask), 0); | ||
286 | 1592 | } | 1590 | } |
287 | 1593 | 1591 | ||
288 | 1594 | /* Even if the window has not yet been placed, we still | 1592 | /* Even if the window has not yet been placed, we still |
289 | @@ -1667,6 +1665,7 @@ | |||
290 | 1667 | 1665 | ||
291 | 1668 | bool shadowOnly = bareDecorationOnly (); | 1666 | bool shadowOnly = bareDecorationOnly (); |
292 | 1669 | bool decorate = shouldDecorateWindow (window, shadowOnly, isSwitcher); | 1667 | bool decorate = shouldDecorateWindow (window, shadowOnly, isSwitcher); |
293 | 1668 | unsigned int decorMaximizeState = window->state () & MAXIMIZE_STATE; | ||
294 | 1670 | 1669 | ||
295 | 1671 | if (decorate || frameExtentsRequested) | 1670 | if (decorate || frameExtentsRequested) |
296 | 1672 | { | 1671 | { |
297 | @@ -1689,7 +1688,8 @@ | |||
298 | 1689 | /* Don't bother going any further if | 1688 | /* Don't bother going any further if |
299 | 1690 | * this window is going to get the same | 1689 | * this window is going to get the same |
300 | 1691 | * decoration, just use the old one */ | 1690 | * decoration, just use the old one */ |
302 | 1692 | if (decoration == old) | 1691 | if (decoration == old && |
303 | 1692 | lastMaximizedStateDecorated == decorMaximizeState) | ||
304 | 1693 | return false; | 1693 | return false; |
305 | 1694 | 1694 | ||
306 | 1695 | /* Destroy the old WindowDecoration */ | 1695 | /* Destroy the old WindowDecoration */ |
307 | @@ -1710,12 +1710,15 @@ | |||
308 | 1710 | /* Set extents based on maximize/unmaximize state | 1710 | /* Set extents based on maximize/unmaximize state |
309 | 1711 | * FIXME: With the new type system, this should be | 1711 | * FIXME: With the new type system, this should be |
310 | 1712 | * removed */ | 1712 | * removed */ |
312 | 1713 | if ((window->state () & MAXIMIZE_STATE)) | 1713 | if (decorMaximizeState) |
313 | 1714 | window->setWindowFrameExtents (&decoration->maxBorder, | 1714 | window->setWindowFrameExtents (&decoration->maxBorder, |
314 | 1715 | &decoration->maxInput); | 1715 | &decoration->maxInput); |
315 | 1716 | else if (!window->hasUnmapReference ()) | 1716 | else if (!window->hasUnmapReference ()) |
316 | 1717 | window->setWindowFrameExtents (&decoration->border, | 1717 | window->setWindowFrameExtents (&decoration->border, |
317 | 1718 | &decoration->input); | 1718 | &decoration->input); |
318 | 1719 | |||
319 | 1720 | lastMaximizedStateDecorated = decorMaximizeState; | ||
320 | 1721 | |||
321 | 1719 | /* This window actually needs its decoration contents updated | 1722 | /* This window actually needs its decoration contents updated |
322 | 1720 | * as it was actually visible */ | 1723 | * as it was actually visible */ |
323 | 1721 | if (decorate || | 1724 | if (decorate || |
324 | @@ -2978,13 +2981,7 @@ | |||
325 | 2978 | shading = false; | 2981 | shading = false; |
326 | 2979 | unshading = false; | 2982 | unshading = false; |
327 | 2980 | } | 2983 | } |
335 | 2981 | /* FIXME: we should not need a timer for calling decorWindowUpdate, | 2984 | |
329 | 2982 | and only call updateWindowDecorationScale if decorWindowUpdate | ||
330 | 2983 | returns false. Unfortunately, decorWindowUpdate may call | ||
331 | 2984 | updateWindowOutputExtents, which may call WindowResizeNotify. As | ||
332 | 2985 | we never should call a wrapped function that's currently | ||
333 | 2986 | processed, we need the timer for the moment. updateWindowOutputExtents | ||
334 | 2987 | should be fixed so that it does not emit a resize notification. */ | ||
336 | 2988 | updateMatrix = true; | 2985 | updateMatrix = true; |
337 | 2989 | updateReg = true; | 2986 | updateReg = true; |
338 | 2990 | 2987 | ||
339 | @@ -3009,19 +3006,7 @@ | |||
340 | 3009 | void | 3006 | void |
341 | 3010 | DecorWindow::stateChangeNotify (unsigned int lastState) | 3007 | DecorWindow::stateChangeNotify (unsigned int lastState) |
342 | 3011 | { | 3008 | { |
356 | 3012 | if (wd && wd->decor) | 3009 | update (true); |
344 | 3013 | { | ||
345 | 3014 | if ((window->state () & MAXIMIZE_STATE)) | ||
346 | 3015 | window->setWindowFrameExtents (&wd->decor->maxBorder, | ||
347 | 3016 | &wd->decor->maxInput); | ||
348 | 3017 | else | ||
349 | 3018 | window->setWindowFrameExtents (&wd->decor->border, | ||
350 | 3019 | &wd->decor->input); | ||
351 | 3020 | |||
352 | 3021 | /* The shift will occurr in decorOffsetMove */ | ||
353 | 3022 | |||
354 | 3023 | updateFrame (); | ||
355 | 3024 | } | ||
357 | 3025 | 3010 | ||
358 | 3026 | window->stateChangeNotify (lastState); | 3011 | window->stateChangeNotify (lastState); |
359 | 3027 | } | 3012 | } |
360 | @@ -3258,7 +3243,8 @@ | |||
361 | 3258 | mClipGroup (NULL), | 3243 | mClipGroup (NULL), |
362 | 3259 | mOutputRegion (window->outputRect ()), | 3244 | mOutputRegion (window->outputRect ()), |
363 | 3260 | mInputRegion (window->inputRect ()), | 3245 | mInputRegion (window->inputRect ()), |
365 | 3261 | mRequestor (screen->dpy (), w->id (), &decor) | 3246 | mRequestor (screen->dpy (), w->id (), &decor), |
366 | 3247 | lastMaximizedStateDecorated (0) | ||
367 | 3262 | { | 3248 | { |
368 | 3263 | WindowInterface::setHandler (window); | 3249 | WindowInterface::setHandler (window); |
369 | 3264 | 3250 | ||
370 | 3265 | 3251 | ||
371 | === modified file 'plugins/decor/src/decor.h' | |||
372 | --- plugins/decor/src/decor.h 2013-04-17 23:41:09 +0000 | |||
373 | +++ plugins/decor/src/decor.h 2013-06-05 08:25:46 +0000 | |||
374 | @@ -385,6 +385,8 @@ | |||
375 | 385 | CompPoint lastShift; | 385 | CompPoint lastShift; |
376 | 386 | CompSize lastSizeDelta; | 386 | CompSize lastSizeDelta; |
377 | 387 | 387 | ||
378 | 388 | unsigned int lastMaximizedStateDecorated; | ||
379 | 389 | |||
380 | 388 | private: | 390 | private: |
381 | 389 | 391 | ||
382 | 390 | bool bareDecorationOnly (); | 392 | bool bareDecorationOnly (); |
383 | 391 | 393 | ||
384 | === modified file 'src/window.cpp' | |||
385 | --- src/window.cpp 2013-05-27 16:19:59 +0000 | |||
386 | +++ src/window.cpp 2013-06-05 08:25:46 +0000 | |||
387 | @@ -6610,10 +6610,7 @@ | |||
388 | 6610 | 6610 | ||
389 | 6611 | recalcActions (); | 6611 | recalcActions (); |
390 | 6612 | 6612 | ||
395 | 6613 | bool sizeUpdated = false; | 6613 | bool sizeUpdated = priv->updateFrameWindow (); |
392 | 6614 | |||
393 | 6615 | sizeUpdated |= priv->updateSize (); | ||
394 | 6616 | sizeUpdated |= priv->updateFrameWindow (); | ||
396 | 6617 | 6614 | ||
397 | 6618 | /* Always send a moveNotify | 6615 | /* Always send a moveNotify |
398 | 6619 | * whenever the frame extents update | 6616 | * whenever the frame extents update |
You forgot:
4. Fixed int dwidth = sizeDelta.width () - lastSizeDelta.width (); typo.