Merge lp:~3v1n0/compiz/extents-resize-fixes into lp:compiz/0.9.11

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Brandon Schaefer
Approved revision: 3831
Merged at revision: 3833
Proposed branch: lp:~3v1n0/compiz/extents-resize-fixes
Merge into: lp:compiz/0.9.11
Diff against target: 46 lines (+10/-2)
2 files modified
src/privatewindow.h (+1/-0)
src/window.cpp (+9/-2)
To merge this branch: bzr merge lp:~3v1n0/compiz/extents-resize-fixes
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Brandon Schaefer (community) Approve
Review via email: mp+207333@code.launchpad.net

Commit message

Window: define proper cases when we need to resize a window when decorating/undecorating

Yeah, again here... So, now when setting the window extents, we resize a window only in these cases:
1) We have a normal window that has never been decorated (lp:1282304)
2) We're (re)decorating a maximized or fullscreen window (lp:1282305)

This seems to work well in all the cases I tested, with no regressions with nedit
(that highlighted an issue with old code path)

Description of the change

So, it seems we need to avoid resizing a window when decorating/undecorating it in some cases, while it's needed when creating a new normal window, or it might be go under the bottom edge of the screen.

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

LGTM :)

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/privatewindow.h'
2--- src/privatewindow.h 2014-01-13 15:52:59 +0000
3+++ src/privatewindow.h 2014-02-20 01:14:41 +0000
4@@ -401,6 +401,7 @@
5 bool shaded;
6 bool hidden;
7 bool grabbed;
8+ bool alreadyDecorated;
9
10 unsigned int desktop;
11
12
13=== modified file 'src/window.cpp'
14--- src/window.cpp 2014-01-17 12:20:34 +0000
15+++ src/window.cpp 2014-02-20 01:14:41 +0000
16@@ -6341,6 +6341,7 @@
17 shaded (false),
18 hidden (false),
19 grabbed (false),
20+ alreadyDecorated (false),
21
22 desktop (0),
23
24@@ -6588,14 +6589,20 @@
25 CompSize sizeDelta;
26
27 /* We don't want to change the size of the window in general, but this is
28- * needed in case that the window is maximized, so that it will extend
29+ * needed in case that a normal windows has just been decorated or if
30+ * the window was maximized or fullscreen, so that it will extend
31 * to use the whole available space. */
32- if ((state() & MAXIMIZE_STATE) == MAXIMIZE_STATE)
33+
34+ if (((priv->type & CompWindowTypeNormalMask) && !priv->alreadyDecorated) ||
35+ (priv->state & MAXIMIZE_STATE) == MAXIMIZE_STATE ||
36+ (priv->state & CompWindowStateFullscreenMask) ||
37+ (priv->type & CompWindowTypeFullscreenMask))
38 {
39 sizeDelta.setWidth (-((b->left + b->right) -
40 (priv->border.left + priv->border.right)));
41 sizeDelta.setHeight (-((b->top + b->bottom) -
42 (priv->border.top + priv->border.bottom)));
43+ priv->alreadyDecorated = true;
44 }
45
46 priv->serverInput = *i;

Subscribers

People subscribed via source and target branches