Merge lp:~compiz-team/compiz/compiz.fix_1186723 into lp:compiz/0.9.10

Proposed by Sam Spilsbury
Status: Rejected
Rejected by: Sam Spilsbury
Proposed branch: lp:~compiz-team/compiz/compiz.fix_1186723
Merge into: lp:compiz/0.9.10
Diff against target: 249 lines (+105/-54)
2 files modified
gtk/window-decorator/tests/test_gwd_settings.cpp (+98/-51)
plugins/decor/src/decor.cpp (+7/-3)
To merge this branch: bzr merge lp:~compiz-team/compiz/compiz.fix_1186723
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Sam Spilsbury Disapprove
Review via email: mp+167473@code.launchpad.net

Commit message

Don't adjust windows with a static gravity for their decorations.

They will adjust themselves.

(LP: #1186723)

Description of the change

Don't adjust windows with a static gravity for their decorations.

They will adjust themselves.

(LP: #1186723)

Please test this, but don't merge it yet.

To post a comment you must log in.
Revision history for this message
MC Return (mc-return) wrote :

Well, I just tested the change in decor.cpp and it does not work here, *but* I am not sure if something with plugin loading from ~/.compiz-1/plugins has been broken recently...
I will soon now for sure...

Revision history for this message
MC Return (mc-return) wrote :

*know

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Never mind this one. I only just got unity compiled now and it seems like we really do have to adjust StaticGravity windows based on their decorations.

(Seriously, why can't guake just undecorate itself before mapping ... that would be so much easier ...)

Revision history for this message
Sam Spilsbury (smspillaz) :
review: Disapprove
Revision history for this message
MC Return (mc-return) wrote :

Yes, you are right -> plugin loading still works -> just retested to make sure...

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

I imagine that this will be folded into an unrevert of the relevant revision.

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Or not.

Unmerged revisions

3736. By Sam Spilsbury

Fixes LP #1186723

3735. By Sam Spilsbury

Don't adjust windows with a static gravity for their decorations.

They will adjust themselves.

(LP: #1168723)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
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:47 +0000
4@@ -258,8 +258,6 @@
5 {
6 };
7
8-const GValue referenceGValue = G_VALUE_INIT;
9-
10 namespace
11 {
12 void gwd_settings_storage_unref (GWDSettingsStorage *storage)
13@@ -287,7 +285,11 @@
14
15 AutoUnsetGValue (GType type)
16 {
17- memcpy (&mValue, &referenceGValue, sizeof (GValue));
18+ /* This is effectively G_VALUE_INIT, we can't use that here
19+ * because this is not a C++11 project */
20+ mValue.g_type = 0;
21+ mValue.data[0].v_int = 0;
22+ mValue.data[1].v_int = 0;
23 g_value_init (&mValue, type);
24 }
25
26@@ -423,109 +425,154 @@
27 EXPECT_CALL (settingsGMock, dispose ());
28 EXPECT_CALL (settingsGMock, finalize ());
29
30+ /* The order of evaluation of matchers in Google Mock appears to be undefined and
31+ * the way GValueMatch is written makes it particularly unsafe when used with
32+ * matchers of multiple types on the same function, since there's no guaruntee
33+ * that the matchers will be traversed in any order. If a type is passed to
34+ * any of the matchers that it doesn't know how to handle then it will
35+ * call directly through to GValueCmp which will run into undefined behaviour
36+ * in itself.
37+ *
38+ * In reality, the API for GValueMatch is probably a little bit broken in this
39+ * sense, but just satisfying each expectation as soon as its set seems to do
40+ * the job here
41+ */
42+
43 /* calling g_object_get_property actually resets
44 * the value so expecting 0x0 is correct */
45 EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_ACTIVE_SHADOW,
46 GValueMatch <gpointer> (0x0, g_value_get_pointer),
47 _));
48+
49+ g_object_get_property (G_OBJECT (settingsMock.get ()),
50+ "active-shadow",
51+ &pointerGValue);
52+
53 EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_INACTIVE_SHADOW,
54 GValueMatch <gpointer> (0x0, g_value_get_pointer),
55 _));
56+
57+ g_object_get_property (G_OBJECT (settingsMock.get ()),
58+ "inactive-shadow",
59+ &pointerGValue);
60+
61 EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_USE_TOOLTIPS,
62 GValueMatch <gboolean> (FALSE, g_value_get_boolean),
63 _));
64+
65+ g_object_get_property (G_OBJECT (settingsMock.get ()),
66+ "use-tooltips",
67+ &booleanGValue);
68+
69 EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_DRAGGABLE_BORDER_WIDTH,
70 GValueMatch <gint> (0, g_value_get_int),
71 _));
72+
73+ g_object_get_property (G_OBJECT (settingsMock.get ()),
74+ "draggable-border-width",
75+ &integerGValue);
76+
77 EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_ATTACH_MODAL_DIALOGS,
78 GValueMatch <gboolean> (FALSE, g_value_get_boolean),
79 _));
80+
81+ g_object_get_property (G_OBJECT (settingsMock.get ()),
82+ "attach-modal-dialogs",
83+ &booleanGValue);
84+
85 EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_BLUR_CHANGED,
86 GValueMatch <gint> (0, g_value_get_int),
87 _));
88+
89+ g_object_get_property (G_OBJECT (settingsMock.get ()),
90+ "blur",
91+ &integerGValue);
92+
93 EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_METACITY_THEME,
94 GValueMatch <const gchar *> (NULL, g_value_get_string),
95 _));
96+
97+ g_object_get_property (G_OBJECT (settingsMock.get ()),
98+ "metacity-theme",
99+ &stringGValue);
100+
101 EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_ACTIVE_OPACITY,
102 GValueMatch <gdouble> (0.0, g_value_get_double),
103 _));
104+
105+ g_object_get_property (G_OBJECT (settingsMock.get ()),
106+ "metacity-active-opacity",
107+ &doubleGValue);
108+
109 EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_INACTIVE_OPACITY,
110 GValueMatch <gdouble> (0.0, g_value_get_double),
111 _));
112+
113+ g_object_get_property (G_OBJECT (settingsMock.get ()),
114+ "metacity-inactive-opacity",
115+ &doubleGValue);
116+
117 EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_ACTIVE_SHADE_OPACITY,
118 GValueMatch <gboolean> (FALSE, g_value_get_boolean),
119 _));
120+
121+ g_object_get_property (G_OBJECT (settingsMock.get ()),
122+ "metacity-active-shade-opacity",
123+ &booleanGValue);
124+
125 EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_INACTIVE_SHADE_OPACITY,
126 GValueMatch <gboolean> (FALSE, g_value_get_boolean),
127 _));
128+
129+ g_object_get_property (G_OBJECT (settingsMock.get ()),
130+ "metacity-inactive-shade-opacity",
131+ &booleanGValue);
132+
133 EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_BUTTON_LAYOUT,
134 GValueMatch <const gchar *> (NULL, g_value_get_string),
135 _));
136+
137+ g_object_get_property (G_OBJECT (settingsMock.get ()),
138+ "metacity-button-layout",
139+ &stringGValue);
140+
141 EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_TITLEBAR_ACTION_DOUBLE_CLICK,
142 GValueMatch <gint> (0, g_value_get_int),
143 _));
144+
145+ g_object_get_property (G_OBJECT (settingsMock.get ()),
146+ "titlebar-double-click-action",
147+ &integerGValue);
148+
149 EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_TITLEBAR_ACTION_MIDDLE_CLICK,
150 GValueMatch <gint> (0, g_value_get_int),
151 _));
152+
153+ g_object_get_property (G_OBJECT (settingsMock.get ()),
154+ "titlebar-middle-click-action",
155+ &integerGValue);
156+
157 EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_TITLEBAR_ACTION_RIGHT_CLICK,
158 GValueMatch <gint> (0, g_value_get_int),
159 _));
160+
161+ g_object_get_property (G_OBJECT (settingsMock.get ()),
162+ "titlebar-right-click-action",
163+ &integerGValue);
164+
165 EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_MOUSE_WHEEL_ACTION,
166 GValueMatch <gint> (0, g_value_get_int),
167 _));
168+
169+ g_object_get_property (G_OBJECT (settingsMock.get ()),
170+ "mouse-wheel-action",
171+ &integerGValue);
172+
173 EXPECT_CALL (settingsGMock, getProperty (GWD_MOCK_SETTINGS_PROPERTY_TITLEBAR_FONT,
174 GValueMatch <const gchar *> (NULL, g_value_get_string),
175 _));
176
177 g_object_get_property (G_OBJECT (settingsMock.get ()),
178- "active-shadow",
179- &pointerGValue);
180- g_object_get_property (G_OBJECT (settingsMock.get ()),
181- "inactive-shadow",
182- &pointerGValue);
183- g_object_get_property (G_OBJECT (settingsMock.get ()),
184- "use-tooltips",
185- &booleanGValue);
186- g_object_get_property (G_OBJECT (settingsMock.get ()),
187- "draggable-border-width",
188- &integerGValue);
189- g_object_get_property (G_OBJECT (settingsMock.get ()),
190- "attach-modal-dialogs",
191- &booleanGValue);
192- g_object_get_property (G_OBJECT (settingsMock.get ()),
193- "blur",
194- &integerGValue);
195- g_object_get_property (G_OBJECT (settingsMock.get ()),
196- "metacity-theme",
197- &stringGValue);
198- g_object_get_property (G_OBJECT (settingsMock.get ()),
199- "metacity-active-opacity",
200- &doubleGValue);
201- g_object_get_property (G_OBJECT (settingsMock.get ()),
202- "metacity-inactive-opacity",
203- &doubleGValue);
204- g_object_get_property (G_OBJECT (settingsMock.get ()),
205- "metacity-active-shade-opacity",
206- &booleanGValue);
207- g_object_get_property (G_OBJECT (settingsMock.get ()),
208- "metacity-inactive-shade-opacity",
209- &booleanGValue);
210- g_object_get_property (G_OBJECT (settingsMock.get ()),
211- "metacity-button-layout",
212- &stringGValue);
213- g_object_get_property (G_OBJECT (settingsMock.get ()),
214- "titlebar-double-click-action",
215- &integerGValue);
216- g_object_get_property (G_OBJECT (settingsMock.get ()),
217- "titlebar-middle-click-action",
218- &integerGValue);
219- g_object_get_property (G_OBJECT (settingsMock.get ()),
220- "titlebar-right-click-action",
221- &integerGValue);
222- g_object_get_property (G_OBJECT (settingsMock.get ()),
223- "mouse-wheel-action",
224- &integerGValue);
225- g_object_get_property (G_OBJECT (settingsMock.get ()),
226 "titlebar-font",
227 &stringGValue);
228 }
229
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:47 +0000
233@@ -1777,9 +1777,13 @@
234 updateGroupShadows ();
235 }
236
237- moveDecoratedWindowBy (movement,
238- sizeDelta,
239- !allowDecoration);
240+ /* Windows with a static gravity should never be moved
241+ * relative to their decoration as they are not placed
242+ * relative to their decoration */
243+ if (window->sizeHints ().win_gravity != StaticGravity)
244+ moveDecoratedWindowBy (movement,
245+ sizeDelta,
246+ !allowDecoration);
247
248 return true;
249 }

Subscribers

People subscribed via source and target branches

to all changes: