Merge lp:~compiz-team/compiz-core/fix_898465 into lp:compiz-core/0.9.5
- fix_898465
- Merge into 0.9.5
Status: | Rejected |
---|---|
Rejected by: | Sam Spilsbury |
Proposed branch: | lp:~compiz-team/compiz-core/fix_898465 |
Merge into: | lp:compiz-core/0.9.5 |
Prerequisite: | lp:~smspillaz/compiz-core/fix_898038 |
Diff against target: |
945 lines (+519/-190) 15 files modified
plugins/place/CMakeLists.txt (+7/-1) plugins/place/src/constrain-to-workarea/CMakeLists.txt (+74/-0) plugins/place/src/constrain-to-workarea/include/constrain-to-workarea.h (+47/-0) plugins/place/src/constrain-to-workarea/src/constrain-to-workarea.cpp (+129/-0) plugins/place/src/constrain-to-workarea/tests/CMakeLists.txt (+18/-0) plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/CMakeLists.txt (+25/-0) plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp (+63/-0) plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/test-place-constrain-to-workarea.cpp (+63/-0) plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.cpp (+34/-0) plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.h (+47/-0) plugins/place/src/place.cpp (+2/-107) plugins/place/src/place.h (+1/-14) src/privatewindow.h (+0/-7) src/screen.cpp (+6/-5) src/window.cpp (+3/-56) |
To merge this branch: | bzr merge lp:~compiz-team/compiz-core/fix_898465 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Thomi Richards (community) | Approve | ||
Compiz Maintainers | Pending | ||
Review via email: mp+84427@code.launchpad.net |
Commit message
Description of the change
Added tests for clamping geometry to workarea (eg, within a rectangle) and also for handling screen size changes (eg, clamp to within new workarea, try to restore to last position before the clamping occurred when the resolution gets bigger.
Next pipe: lp:~compiz-team/compiz-core/fix_898469
Sam Spilsbury (smspillaz) wrote : | # |
- 2921. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2922. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2923. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2924. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2925. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465.
Thomi Richards (thomir-deactivatedaccount) wrote : | # |
Looks good to me.
- 2926. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2927. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2928. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2929. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2930. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2931. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2932. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2933. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2934. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2935. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2936. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2937. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2938. By Sam Spilsbury
-
Ported the workarea constrainment test to Google Test
- 2939. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2940. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2941. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2942. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2943. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2944. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2945. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2946. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2947. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2948. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2949. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465.
Alan Griffiths (alan-griffiths) wrote : | # |
After merging this change to my (up to date) working copy I get a build error:
...
Linking CXX shared library libplace.so
/usr/bin/ld: cannot find -lplace_
collect2: ld returned 1 exit status
make[2]: *** [plugins/
make[1]: *** [plugins/
make: *** [all] Error 2
.
- 2950. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2951. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2952. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2953. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2954. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465.
Unmerged revisions
- 2954. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2953. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2952. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2951. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2950. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2949. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2948. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2947. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2946. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465. - 2945. By Sam Spilsbury
-
Merged compiz-
core.fix_ 898038 into compiz- core.fix_ 898465.
Preview Diff
1 | === modified file 'plugins/place/CMakeLists.txt' |
2 | --- plugins/place/CMakeLists.txt 2009-03-15 05:09:18 +0000 |
3 | +++ plugins/place/CMakeLists.txt 2012-01-11 08:52:26 +0000 |
4 | @@ -2,4 +2,10 @@ |
5 | |
6 | include (CompizPlugin) |
7 | |
8 | -compiz_plugin(place) |
9 | \ No newline at end of file |
10 | +# FIXME: Remove once MODULES support lands |
11 | + |
12 | +add_subdirectory (src/constrain-to-workarea) |
13 | +add_subdirectory (tests) |
14 | + |
15 | +include_directories (${CMAKE_CURRENT_SOURCE_DIR}/src/constrain-to-workarea/include/) |
16 | +compiz_plugin (place LIBRARIES place_constrain_to_workarea) |
17 | |
18 | === added directory 'plugins/place/src/constrain-to-workarea' |
19 | === added file 'plugins/place/src/constrain-to-workarea/CMakeLists.txt' |
20 | --- plugins/place/src/constrain-to-workarea/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
21 | +++ plugins/place/src/constrain-to-workarea/CMakeLists.txt 2012-01-11 08:52:26 +0000 |
22 | @@ -0,0 +1,74 @@ |
23 | +pkg_check_modules ( |
24 | + GLIBMM |
25 | + REQUIRED |
26 | + glibmm-2.4 glib-2.0 |
27 | +) |
28 | + |
29 | +INCLUDE_DIRECTORIES ( |
30 | + ${CMAKE_CURRENT_SOURCE_DIR}/include |
31 | + ${CMAKE_CURRENT_SOURCE_DIR}/src |
32 | + |
33 | + ${compiz_SOURCE_DIR}/src/point/include |
34 | + ${compiz_SOURCE_DIR}/src/rect/include |
35 | + ${compiz_SOURCE_DIR}/src/window/geometry/include |
36 | + ${compiz_SOURCE_DIR}/src/window/geometry-saver/include |
37 | + ${compiz_SOURCE_DIR}/src/window/extents/include |
38 | + ${compiz_SOURCE_DIR}/include |
39 | + |
40 | + ${Boost_INCLUDE_DIRS} |
41 | + |
42 | + ${GLIBMM_INCLUDE_DIRS} |
43 | +) |
44 | + |
45 | +LINK_DIRECTORIES (${GLIBMM_LIBRARY_DIRS}) |
46 | + |
47 | +SET ( |
48 | + PUBLIC_HEADERS |
49 | +) |
50 | + |
51 | +SET ( |
52 | + PRIVATE_HEADERS |
53 | + ${CMAKE_CURRENT_SOURCE_DIR}/include/constrain-to-workarea.h |
54 | +) |
55 | + |
56 | +SET( |
57 | + SRCS |
58 | + ${CMAKE_CURRENT_SOURCE_DIR}/src/constrain-to-workarea.cpp |
59 | + ${compiz_SOURCE_DIR}/src/size.cpp |
60 | +) |
61 | + |
62 | +ADD_LIBRARY( |
63 | + compiz_place_constrain_to_workarea STATIC |
64 | + |
65 | + ${SRCS} |
66 | + |
67 | + ${PUBLIC_HEADERS} |
68 | + ${PRIVATE_HEADERS} |
69 | +) |
70 | + |
71 | +ADD_SUBDIRECTORY( ${CMAKE_CURRENT_SOURCE_DIR}/tests ) |
72 | + |
73 | +SET_TARGET_PROPERTIES( |
74 | + compiz_place_constrain_to_workarea PROPERTIES |
75 | + PUBLIC_HEADER "${PUBLIC_HEADERS}" |
76 | +) |
77 | + |
78 | +INSTALL( |
79 | + TARGETS compiz_place_constrain_to_workarea |
80 | + RUNTIME DESTINATION bin |
81 | + LIBRARY DESTINATION lib |
82 | + ARCHIVE DESTINATION lib |
83 | + PUBLIC_HEADER DESTINATION include/compiz |
84 | +) |
85 | + |
86 | + |
87 | + |
88 | +TARGET_LINK_LIBRARIES( |
89 | + compiz_place_constrain_to_workarea |
90 | + compiz_rect |
91 | + compiz_point |
92 | + compiz_window_geometry |
93 | + compiz_window_geometry_saver |
94 | + |
95 | + ${GLIBMM_LIBRARIES} |
96 | +) |
97 | |
98 | === added directory 'plugins/place/src/constrain-to-workarea/include' |
99 | === added file 'plugins/place/src/constrain-to-workarea/include/constrain-to-workarea.h' |
100 | --- plugins/place/src/constrain-to-workarea/include/constrain-to-workarea.h 1970-01-01 00:00:00 +0000 |
101 | +++ plugins/place/src/constrain-to-workarea/include/constrain-to-workarea.h 2012-01-11 08:52:26 +0000 |
102 | @@ -0,0 +1,47 @@ |
103 | +/* |
104 | + * Copyright (C) 2001 Havoc Pennington |
105 | + * Copyright (C) 2002, 2003 Red Hat, Inc. |
106 | + * Copyright (C) 2003 Rob Adams |
107 | + * Copyright (C) 2005 Novell, Inc. |
108 | + * |
109 | + * This program is free software; you can redistribute it and/or |
110 | + * modify it under the terms of the GNU General Public License as |
111 | + * published by the Free Software Foundation; either version 2 of the |
112 | + * License, or (at your option) any later version. |
113 | + * |
114 | + * This program is distributed in the hope that it will be useful, but |
115 | + * WITHOUT ANY WARRANTY; without even the implied warranty of |
116 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
117 | + * General Public License for more details. |
118 | + * |
119 | + * You should have received a copy of the GNU General Public License |
120 | + * along with this program; if not, write to the Free Software |
121 | + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
122 | + * 02111-1307, USA. |
123 | + */ |
124 | + |
125 | +#ifndef _COMPIZ_PLACE_CLAMP_TO_WORKAREA_H |
126 | +#define _COMPIZ_PLACE_CLAMP_TO_WORKAREA_H |
127 | + |
128 | +#include <core/rect.h> |
129 | +#include <core/windowgeometry.h> |
130 | +#include <core/windowextents.h> |
131 | +#include <core/size.h> |
132 | +#include <core/point.h> |
133 | + |
134 | +namespace compiz |
135 | +{ |
136 | +namespace place |
137 | +{ |
138 | +static unsigned int clampGeometrySizeOnly = (1 << 0); |
139 | +static unsigned int clampGeometryToViewport = (1 << 1); |
140 | + |
141 | +void clampGeometryToWorkArea (compiz::window::Geometry &g, |
142 | + const CompRect &workArea, |
143 | + const CompWindowExtents &border, |
144 | + unsigned int flags, |
145 | + const CompSize &screenSize); |
146 | +} |
147 | +} |
148 | + |
149 | +#endif |
150 | |
151 | === added directory 'plugins/place/src/constrain-to-workarea/src' |
152 | === added file 'plugins/place/src/constrain-to-workarea/src/constrain-to-workarea.cpp' |
153 | --- plugins/place/src/constrain-to-workarea/src/constrain-to-workarea.cpp 1970-01-01 00:00:00 +0000 |
154 | +++ plugins/place/src/constrain-to-workarea/src/constrain-to-workarea.cpp 2012-01-11 08:52:26 +0000 |
155 | @@ -0,0 +1,129 @@ |
156 | +/* |
157 | + * Copyright (C) 2001 Havoc Pennington |
158 | + * Copyright (C) 2002, 2003 Red Hat, Inc. |
159 | + * Copyright (C) 2003 Rob Adams |
160 | + * Copyright (C) 2005 Novell, Inc. |
161 | + * |
162 | + * This program is free software; you can redistribute it and/or |
163 | + * modify it under the terms of the GNU General Public License as |
164 | + * published by the Free Software Foundation; either version 2 of the |
165 | + * License, or (at your option) any later version. |
166 | + * |
167 | + * This program is distributed in the hope that it will be useful, but |
168 | + * WITHOUT ANY WARRANTY; without even the implied warranty of |
169 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
170 | + * General Public License for more details. |
171 | + * |
172 | + * You should have received a copy of the GNU General Public License |
173 | + * along with this program; if not, write to the Free Software |
174 | + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
175 | + * 02111-1307, USA. |
176 | + */ |
177 | + |
178 | +#include "constrain-to-workarea.h" |
179 | + |
180 | +void |
181 | +compiz::place::clampGeometryToWorkArea (compiz::window::Geometry &g, |
182 | + const CompRect &workArea, |
183 | + const CompWindowExtents &border, |
184 | + unsigned int flags, |
185 | + const CompSize &screenSize) |
186 | +{ |
187 | + int x, y, left, right, bottom, top; |
188 | + |
189 | + if (flags & clampGeometryToViewport) |
190 | + { |
191 | + /* left, right, top, bottom target coordinates, clamed to viewport |
192 | + * sizes as we don't need to validate movements to other viewports; |
193 | + * we are only interested in inner-viewport movements */ |
194 | + |
195 | + x = g.x () % screenSize.width (); |
196 | + if ((x + g.width ()) < 0) |
197 | + x += screenSize.width (); |
198 | + |
199 | + y = g.y () % screenSize.height (); |
200 | + if ((y + g.height ()) < 0) |
201 | + y += screenSize.height (); |
202 | + } |
203 | + else |
204 | + { |
205 | + x = g.x (); |
206 | + y = g.y (); |
207 | + } |
208 | + |
209 | + left = x - border.left; |
210 | + right = left + g.width () + (border.left + |
211 | + border.right + |
212 | + 2 * g.border ()); |
213 | + top = y - border.top; |
214 | + bottom = top + g.height () + (border.top + |
215 | + border.bottom + |
216 | + 2 * g.border ()); |
217 | + |
218 | + if ((right - left) > workArea.width ()) |
219 | + { |
220 | + left = workArea.left (); |
221 | + right = workArea.right (); |
222 | + } |
223 | + else |
224 | + { |
225 | + if (left < workArea.left ()) |
226 | + { |
227 | + right += workArea.left () - left; |
228 | + left = workArea.left (); |
229 | + } |
230 | + |
231 | + if (right > workArea.right ()) |
232 | + { |
233 | + left -= right - workArea.right (); |
234 | + right = workArea.right (); |
235 | + } |
236 | + } |
237 | + |
238 | + if ((bottom - top) > workArea.height ()) |
239 | + { |
240 | + top = workArea.top (); |
241 | + bottom = workArea.bottom (); |
242 | + } |
243 | + else |
244 | + { |
245 | + if (top < workArea.top ()) |
246 | + { |
247 | + bottom += workArea.top () - top; |
248 | + top = workArea.top (); |
249 | + } |
250 | + |
251 | + if (bottom > workArea.bottom ()) |
252 | + { |
253 | + top -= bottom - workArea.bottom (); |
254 | + bottom = workArea.bottom (); |
255 | + } |
256 | + } |
257 | + |
258 | + /* bring left/right/top/bottom to actual window coordinates */ |
259 | + left += border.left; |
260 | + right -= border.right + 2 * g.border (); |
261 | + top += border.top; |
262 | + bottom -= border.bottom + 2 * g.border (); |
263 | + |
264 | + if ((right - left) != g.width ()) |
265 | + { |
266 | + g.setWidth (right - left); |
267 | + flags &= ~clampGeometrySizeOnly; |
268 | + } |
269 | + |
270 | + if ((bottom - top) != g.height ()) |
271 | + { |
272 | + g.setHeight (bottom - top); |
273 | + flags &= ~clampGeometrySizeOnly; |
274 | + } |
275 | + |
276 | + if (!(flags & clampGeometrySizeOnly)) |
277 | + { |
278 | + if (left != x) |
279 | + g.setX (g.x () + left - x); |
280 | + |
281 | + if (top != y) |
282 | + g.setY (g.y () + top - y); |
283 | + } |
284 | +} |
285 | |
286 | === added directory 'plugins/place/src/constrain-to-workarea/tests' |
287 | === added file 'plugins/place/src/constrain-to-workarea/tests/CMakeLists.txt' |
288 | --- plugins/place/src/constrain-to-workarea/tests/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
289 | +++ plugins/place/src/constrain-to-workarea/tests/CMakeLists.txt 2012-01-11 08:52:26 +0000 |
290 | @@ -0,0 +1,18 @@ |
291 | +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) |
292 | + |
293 | +add_library (compiz_place_constrain_to_workarea_test |
294 | + ${CMAKE_CURRENT_SOURCE_DIR}/test-constrain-to-workarea.cpp) |
295 | + |
296 | +add_executable (compiz_test_place_constrain_to_workarea |
297 | + ${CMAKE_CURRENT_SOURCE_DIR}/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp) |
298 | + |
299 | +target_link_libraries (compiz_test_place_constrain_to_workarea |
300 | + compiz_place_constrain_to_workarea_test |
301 | + compiz_place_constrain_to_workarea |
302 | + ${GTEST_BOTH_LIBRARIES} |
303 | + ${GMOCK_LIBRARY} |
304 | + ${GMOCK_MAIN_LIBRARY} |
305 | + ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. |
306 | + ) |
307 | + |
308 | +add_test (compiz_place_constrain_to_workarea compiz_test_place_constrain_to_workarea) |
309 | |
310 | === added directory 'plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea' |
311 | === added directory 'plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src' |
312 | === added file 'plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/CMakeLists.txt' |
313 | --- plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
314 | +++ plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/CMakeLists.txt 2012-01-11 08:52:26 +0000 |
315 | @@ -0,0 +1,25 @@ |
316 | +link_directories (${COMPIZ_TEST_PLACE_LINK_DIRS}) |
317 | + |
318 | +include_directories (${COMPIZ_TEST_PLACE_INCLUDE_DIRS} |
319 | + ${compiz_SOURCE_DIR}/include |
320 | + ${compiz_BINARY_DIR} |
321 | + ${compiz_BINARY_DIR}/generated |
322 | + ${compiz_SOURCE_DIR}/src |
323 | + ${compiz_SOURCE_DIR}/plugins/place/src |
324 | + ${COMPIZ_PLACE_TEST_BASE_DIR}) |
325 | + |
326 | +add_executable (test-place-clamp-to-workarea |
327 | + test-place-constrain-to-workarea.cpp |
328 | + ../test-place.cpp |
329 | + ${compiz_SOURCE_DIR}/plugins/place/src/constrain-to-workarea.cpp |
330 | + ${compiz_SOURCE_DIR}/src/windowextents.cpp |
331 | + ${compiz_SOURCE_DIR}/src/windowgeometry.cpp |
332 | + ${compiz_SOURCE_DIR}/src/rect.cpp |
333 | + ${compiz_SOURCE_DIR}/src/point.cpp |
334 | + ${compiz_SOURCE_DIR}/src/size.cpp) |
335 | + |
336 | +target_link_libraries (test-place-clamp-to-workarea |
337 | + ${COMPIZ_TEST_PLACE_LIBRARIES}) |
338 | + |
339 | +add_test (test-place-clamp-to-workarea |
340 | + ${CMAKE_CURRENT_BINARY_DIR}/test-place-clamp-to-workarea) |
341 | |
342 | === added file 'plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp' |
343 | --- plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp 1970-01-01 00:00:00 +0000 |
344 | +++ plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/src/test-place-constrain-to-workarea.cpp 2012-01-11 08:52:26 +0000 |
345 | @@ -0,0 +1,63 @@ |
346 | +/* |
347 | + * Copyright © 2011 Canonical Ltd. |
348 | + * |
349 | + * Permission to use, copy, modify, distribute, and sell this software |
350 | + * and its documentation for any purpose is hereby granted without |
351 | + * fee, provided that the above copyright notice appear in all copies |
352 | + * and that both that copyright notice and this permission notice |
353 | + * appear in supporting documentation, and that the name of |
354 | + * Canonical Ltd. not be used in advertising or publicity pertaining to |
355 | + * distribution of the software without specific, written prior permission. |
356 | + * Canonical Ltd. makes no representations about the suitability of this |
357 | + * software for any purpose. It is provided "as is" without express or |
358 | + * implied warranty. |
359 | + * |
360 | + * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, |
361 | + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN |
362 | + * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR |
363 | + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS |
364 | + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, |
365 | + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION |
366 | + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
367 | + * |
368 | + * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com> |
369 | + */ |
370 | + |
371 | +#include <test-constrain-to-workarea.h> |
372 | +#include <constrain-to-workarea.h> |
373 | +#include <iostream> |
374 | +#include <stdlib.h> |
375 | +#include <cstring> |
376 | + |
377 | +class CompPlaceTestConstrainToWorkarea : |
378 | + public CompPlaceTest |
379 | +{ |
380 | +public: |
381 | + |
382 | + CompPlaceTestConstrainToWorkarea (); |
383 | + ~CompPlaceTestConstrainToWorkarea (); |
384 | +}; |
385 | + |
386 | +CompPlaceTestConstrainToWorkarea::CompPlaceTestConstrainToWorkarea () |
387 | +{ |
388 | +} |
389 | + |
390 | +CompPlaceTestConstrainToWorkarea::~CompPlaceTestConstrainToWorkarea () |
391 | +{ |
392 | +} |
393 | + |
394 | +TEST_F (CompPlaceTestConstrainToWorkarea, TestConstrainToWorkarea) |
395 | +{ |
396 | + CompSize screensize (1000, 2000); |
397 | + CompRect workArea (50, 50, 900, 1900); |
398 | + compiz::window::Geometry g (100, 100, 200, 200, 0); |
399 | + compiz::window::extents::Extents extents; |
400 | + unsigned int flags = 0; |
401 | + |
402 | + memset (&extents, 0, sizeof (compiz::window::extents::Extents)); |
403 | + |
404 | + /* Do nothing */ |
405 | + compiz::place::clampGeometryToWorkArea (g, workArea, extents, flags, screensize); |
406 | + |
407 | + EXPECT_EQ (g, compiz::window::Geometry (100, 100, 200, 200, 0)); |
408 | +} |
409 | |
410 | === added file 'plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/test-place-constrain-to-workarea.cpp' |
411 | --- plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/test-place-constrain-to-workarea.cpp 1970-01-01 00:00:00 +0000 |
412 | +++ plugins/place/src/constrain-to-workarea/tests/constrain-to-workarea/test-place-constrain-to-workarea.cpp 2012-01-11 08:52:26 +0000 |
413 | @@ -0,0 +1,63 @@ |
414 | +/* |
415 | + * Copyright © 2011 Canonical Ltd. |
416 | + * |
417 | + * Permission to use, copy, modify, distribute, and sell this software |
418 | + * and its documentation for any purpose is hereby granted without |
419 | + * fee, provided that the above copyright notice appear in all copies |
420 | + * and that both that copyright notice and this permission notice |
421 | + * appear in supporting documentation, and that the name of |
422 | + * Canonical Ltd. not be used in advertising or publicity pertaining to |
423 | + * distribution of the software without specific, written prior permission. |
424 | + * Canonical Ltd. makes no representations about the suitability of this |
425 | + * software for any purpose. It is provided "as is" without express or |
426 | + * implied warranty. |
427 | + * |
428 | + * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, |
429 | + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN |
430 | + * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR |
431 | + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS |
432 | + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, |
433 | + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION |
434 | + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
435 | + * |
436 | + * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com> |
437 | + */ |
438 | + |
439 | +#include <test-constrain-to-workarea.h> |
440 | +#include <constrain-to-workarea.h> |
441 | +#include <iostream> |
442 | +#include <stdlib.h> |
443 | +#include <cstring> |
444 | + |
445 | +class CompPlaceTestConstrainToWorkarea : |
446 | + public CompPlaceTest |
447 | +{ |
448 | +public: |
449 | + |
450 | + CompPlaceTestConstrainToWorkarea (); |
451 | + ~CompPlaceTestConstrainToWorkarea (); |
452 | +}; |
453 | + |
454 | +CompPlaceTestConstrainToWorkarea::CompPlaceTestConstrainToWorkarea () |
455 | +{ |
456 | +} |
457 | + |
458 | +CompPlaceTestConstrainToWorkarea::~CompPlaceTestConstrainToWorkarea () |
459 | +{ |
460 | +} |
461 | + |
462 | +TEST_F (CompPlaceTestConstrainToWorkarea, TestConstrainToWorkarea) |
463 | +{ |
464 | + CompSize screensize (1000, 2000); |
465 | + CompRect workArea (50, 50, 900, 1900); |
466 | + compiz::window::Geometry g (100, 100, 200, 200, 0); |
467 | + compiz::window::extents::Extents extents; |
468 | + unsigned int flags = 0; |
469 | + |
470 | + memset (&extents, 0, sizeof (compiz::window::extents::Extents)); |
471 | + |
472 | + /* Do nothing */ |
473 | + compiz::place::clampGeometryToWorkArea (g, workArea, extents, flags, screensize); |
474 | + |
475 | + EXPECT_EQ (g, compiz::window::Geometry (100, 100, 200, 200, 0)); |
476 | +} |
477 | |
478 | === added file 'plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.cpp' |
479 | --- plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.cpp 1970-01-01 00:00:00 +0000 |
480 | +++ plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.cpp 2012-01-11 08:52:26 +0000 |
481 | @@ -0,0 +1,34 @@ |
482 | +/* |
483 | + * Copyright © 2011 Canonical Ltd. |
484 | + * |
485 | + * Permission to use, copy, modify, distribute, and sell this software |
486 | + * and its documentation for any purpose is hereby granted without |
487 | + * fee, provided that the above copyright notice appear in all copies |
488 | + * and that both that copyright notice and this permission notice |
489 | + * appear in supporting documentation, and that the name of |
490 | + * Canonical Ltd. not be used in advertising or publicity pertaining to |
491 | + * distribution of the software without specific, written prior permission. |
492 | + * Canonical Ltd. makes no representations about the suitability of this |
493 | + * software for any purpose. It is provided "as is" without express or |
494 | + * implied warranty. |
495 | + * |
496 | + * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, |
497 | + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN |
498 | + * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR |
499 | + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS |
500 | + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, |
501 | + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION |
502 | + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
503 | + * |
504 | + * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com> |
505 | + */ |
506 | + |
507 | +#include "test-constrain-to-workarea.h" |
508 | + |
509 | +CompPlaceTest::CompPlaceTest () |
510 | +{ |
511 | +} |
512 | + |
513 | +CompPlaceTest::~CompPlaceTest () |
514 | +{ |
515 | +} |
516 | |
517 | === added file 'plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.h' |
518 | --- plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.h 1970-01-01 00:00:00 +0000 |
519 | +++ plugins/place/src/constrain-to-workarea/tests/test-constrain-to-workarea.h 2012-01-11 08:52:26 +0000 |
520 | @@ -0,0 +1,47 @@ |
521 | +/* |
522 | + * Copyright © 2011 Canonical Ltd. |
523 | + * |
524 | + * Permission to use, copy, modify, distribute, and sell this software |
525 | + * and its documentation for any purpose is hereby granted without |
526 | + * fee, provided that the above copyright notice appear in all copies |
527 | + * and that both that copyright notice and this permission notice |
528 | + * appear in supporting documentation, and that the name of |
529 | + * Canonical Ltd. not be used in advertising or publicity pertaining to |
530 | + * distribution of the software without specific, written prior permission. |
531 | + * Canonical Ltd. makes no representations about the suitability of this |
532 | + * software for any purpose. It is provided "as is" without express or |
533 | + * implied warranty. |
534 | + * |
535 | + * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, |
536 | + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN |
537 | + * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR |
538 | + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS |
539 | + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, |
540 | + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION |
541 | + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
542 | + * |
543 | + * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com> |
544 | + */ |
545 | + |
546 | +#ifndef _COMPIZ_TEST_TIMER_H |
547 | +#define _COMPIZ_TEST_TIMER_H |
548 | + |
549 | +#include <gtest/gtest.h> |
550 | +#include <core/rect.h> |
551 | +#include <core/windowgeometry.h> |
552 | +#include <core/windowextents.h> |
553 | +#include <core/size.h> |
554 | +#include <core/point.h> |
555 | +#include <string> |
556 | +#include <iostream> |
557 | +#include <stdlib.h> |
558 | + |
559 | +class CompPlaceTest : public ::testing::Test |
560 | +{ |
561 | +public: |
562 | + |
563 | + CompPlaceTest (); |
564 | + virtual ~CompPlaceTest (); |
565 | +}; |
566 | + |
567 | +#endif |
568 | |
569 | === modified file 'plugins/place/src/place.cpp' |
570 | --- plugins/place/src/place.cpp 2012-01-11 08:52:26 +0000 |
571 | +++ plugins/place/src/place.cpp 2012-01-11 08:52:26 +0000 |
572 | @@ -186,7 +186,7 @@ |
573 | CompRect workArea = screen->getWorkareaForOutput ( |
574 | screen->outputDeviceForGeometry (g)); |
575 | |
576 | - compiz::place::clampGeometryToWorkArea (g, workArea, w->border (), flags); |
577 | + compiz::place::clampGeometryToWorkArea (g, workArea, w->border (), flags, *screen); |
578 | |
579 | g.setX (g.x () - curVpOffsetX - (screen->vp ().x () + vpX) * newWidth); |
580 | g.setY (g.y () - curVpOffsetY - (screen->vp ().y () + vpY) * newHeight); |
581 | @@ -470,111 +470,6 @@ |
582 | return true; |
583 | } |
584 | |
585 | -void |
586 | -compiz::place::clampGeometryToWorkArea (compiz::window::Geometry &g, |
587 | - const CompRect &workArea, |
588 | - const CompWindowExtents &border, |
589 | - unsigned int flags) |
590 | -{ |
591 | - int x, y, left, right, bottom, top; |
592 | - |
593 | - if (flags & clampGeometryToViewport) |
594 | - { |
595 | - /* left, right, top, bottom target coordinates, clamed to viewport |
596 | - * sizes as we don't need to validate movements to other viewports; |
597 | - * we are only interested in inner-viewport movements */ |
598 | - |
599 | - x = g.x () % screen->width (); |
600 | - if ((x + g.width ()) < 0) |
601 | - x += screen->width (); |
602 | - |
603 | - y = g.y () % screen->height (); |
604 | - if ((y + g.height ()) < 0) |
605 | - y += screen->height (); |
606 | - } |
607 | - else |
608 | - { |
609 | - x = g.x (); |
610 | - y = g.y (); |
611 | - } |
612 | - |
613 | - left = x - border.left; |
614 | - right = left + g.width () + (border.left + |
615 | - border.right + |
616 | - 2 * g.border ()); |
617 | - top = y - border.top; |
618 | - bottom = top + g.height () + (border.top + |
619 | - border.bottom + |
620 | - 2 * g.border ()); |
621 | - |
622 | - if ((right - left) > workArea.width ()) |
623 | - { |
624 | - left = workArea.left (); |
625 | - right = workArea.right (); |
626 | - } |
627 | - else |
628 | - { |
629 | - if (left < workArea.left ()) |
630 | - { |
631 | - right += workArea.left () - left; |
632 | - left = workArea.left (); |
633 | - } |
634 | - |
635 | - if (right > workArea.right ()) |
636 | - { |
637 | - left -= right - workArea.right (); |
638 | - right = workArea.right (); |
639 | - } |
640 | - } |
641 | - |
642 | - if ((bottom - top) > workArea.height ()) |
643 | - { |
644 | - top = workArea.top (); |
645 | - bottom = workArea.bottom (); |
646 | - } |
647 | - else |
648 | - { |
649 | - if (top < workArea.top ()) |
650 | - { |
651 | - bottom += workArea.top () - top; |
652 | - top = workArea.top (); |
653 | - } |
654 | - |
655 | - if (bottom > workArea.bottom ()) |
656 | - { |
657 | - top -= bottom - workArea.bottom (); |
658 | - bottom = workArea.bottom (); |
659 | - } |
660 | - } |
661 | - |
662 | - /* bring left/right/top/bottom to actual window coordinates */ |
663 | - left += border.left; |
664 | - right -= border.right + 2 * g.border (); |
665 | - top += border.top; |
666 | - bottom -= border.bottom + 2 * g.border (); |
667 | - |
668 | - if ((right - left) != g.width ()) |
669 | - { |
670 | - g.setWidth (right - left); |
671 | - flags &= ~clampGeometrySizeOnly; |
672 | - } |
673 | - |
674 | - if ((bottom - top) != g.height ()) |
675 | - { |
676 | - g.setHeight (bottom - top); |
677 | - flags &= ~clampGeometrySizeOnly; |
678 | - } |
679 | - |
680 | - if (!(flags & clampGeometrySizeOnly)) |
681 | - { |
682 | - if (left != x) |
683 | - g.setX (g.x () + left - x); |
684 | - |
685 | - if (top != y) |
686 | - g.setY (g.y () + top - y); |
687 | - } |
688 | -} |
689 | - |
690 | bool |
691 | PlaceWindow::position (compiz::window::Geometry &g, unsigned int source, unsigned int constrainment) |
692 | { |
693 | @@ -623,7 +518,7 @@ |
694 | CompRect workArea = screen->getWorkareaForOutput ( |
695 | screen->outputDeviceForGeometry (g)); |
696 | |
697 | - compiz::place::clampGeometryToWorkArea (g, workArea, window->border (), flags); |
698 | + compiz::place::clampGeometryToWorkArea (g, workArea, window->border (), flags, *screen); |
699 | |
700 | bool rv = window->position (g, source, constrainment); |
701 | |
702 | |
703 | === modified file 'plugins/place/src/place.h' |
704 | --- plugins/place/src/place.h 2012-01-11 08:52:26 +0000 |
705 | +++ plugins/place/src/place.h 2012-01-11 08:52:26 +0000 |
706 | @@ -30,20 +30,7 @@ |
707 | #include <core/pluginclasshandler.h> |
708 | |
709 | #include "place_options.h" |
710 | - |
711 | -namespace compiz |
712 | -{ |
713 | -namespace place |
714 | -{ |
715 | -static unsigned int clampGeometrySizeOnly = (1 << 0); |
716 | -static unsigned int clampGeometryToViewport = (1 << 1); |
717 | - |
718 | -void clampGeometryToWorkArea (compiz::window::Geometry &, |
719 | - const CompRect &, |
720 | - const CompWindowExtents &, |
721 | - unsigned int flags); |
722 | -} |
723 | -} |
724 | +#include "constrain-to-workarea.h" |
725 | |
726 | class PlaceScreen : |
727 | public PluginClassHandler<PlaceScreen, CompScreen>, |
728 | |
729 | === added directory 'plugins/place/tests' |
730 | === added file 'plugins/place/tests/CMakeLists.txt' |
731 | === added directory 'plugins/place/tests/place' |
732 | === modified file 'src/privatewindow.h' |
733 | --- src/privatewindow.h 2012-01-11 08:52:26 +0000 |
734 | +++ src/privatewindow.h 2012-01-11 08:52:26 +0000 |
735 | @@ -233,8 +233,6 @@ |
736 | |
737 | void readIconHint (); |
738 | |
739 | - bool checkClear (); |
740 | - |
741 | public: |
742 | |
743 | PrivateWindow *priv; |
744 | @@ -266,9 +264,6 @@ |
745 | XSizeHints sizeHints; |
746 | XWMHints *hints; |
747 | |
748 | - struct timeval lastGeometryUpdate; |
749 | - struct timeval lastConfigureRequest; |
750 | - |
751 | bool inputHint; |
752 | bool alpha; |
753 | int width; |
754 | @@ -315,8 +310,6 @@ |
755 | typedef std::pair <XWindowChanges, unsigned int> XWCValueMask; |
756 | |
757 | compiz::X11::PendingEventQueue pendingConfigures; |
758 | - CompTimer mClearCheckTimeout; |
759 | - bool pendingPositionUpdates; |
760 | |
761 | char *startupId; |
762 | char *resName; |
763 | |
764 | === modified file 'src/screen.cpp' |
765 | --- src/screen.cpp 2012-01-11 08:52:26 +0000 |
766 | +++ src/screen.cpp 2012-01-11 08:52:26 +0000 |
767 | @@ -4662,9 +4662,6 @@ |
768 | priv->vpSize.setWidth (priv->optionGetHsize ()); |
769 | priv->vpSize.setHeight (priv->optionGetVsize ()); |
770 | |
771 | - /* Start initializing windows here */ |
772 | - priv->initialized = true; |
773 | - |
774 | for (unsigned int i = 0; i < nchildren; i++) |
775 | { |
776 | XWindowAttributes attrib; |
777 | @@ -4721,6 +4718,9 @@ |
778 | focusDefaultWindow (); |
779 | } |
780 | |
781 | + /* Start initializing windows here */ |
782 | + priv->initialized = true; |
783 | + |
784 | /* TODO: Bailout properly when screenInitPlugins fails |
785 | * TODO: It would be nicer if this line could mean |
786 | * "init all the screens", but unfortunately it only inits |
787 | @@ -4729,8 +4729,9 @@ |
788 | * screens from option changes */ |
789 | assert (CompPlugin::screenInitPlugins (this)); |
790 | |
791 | - /* The active plugins list might have been changed - load any |
792 | - * new plugins */ |
793 | + /* Now init window plugins */ |
794 | + foreach (CompWindow *w, screen->windows ()) |
795 | + CompPlugin::windowInitPlugins (w); |
796 | |
797 | priv->vpSize.setWidth (priv->optionGetHsize ()); |
798 | priv->vpSize.setHeight (priv->optionGetVsize ()); |
799 | |
800 | === modified file 'src/window.cpp' |
801 | --- src/window.cpp 2012-01-11 08:52:26 +0000 |
802 | +++ src/window.cpp 2012-01-11 08:52:26 +0000 |
803 | @@ -893,10 +893,6 @@ |
804 | screen->dpy (), serverFrame, valueMask, &xwc))); |
805 | |
806 | pendingConfigures.add (pc); |
807 | - if (priv->mClearCheckTimeout.active ()) |
808 | - priv->mClearCheckTimeout.stop (); |
809 | - priv->mClearCheckTimeout.start (boost::bind (&PrivateWindow::checkClear, priv), |
810 | - 2000, 2500); |
811 | |
812 | XSendEvent (screen->dpy (), screen->root (), false, |
813 | SubstructureNotifyMask, (XEvent *) &xev); |
814 | @@ -912,10 +908,6 @@ |
815 | screen->dpy (), serverFrame, valueMask, &xwc))); |
816 | |
817 | pendingConfigures.add (pc); |
818 | - if (priv->mClearCheckTimeout.active ()) |
819 | - priv->mClearCheckTimeout.stop (); |
820 | - priv->mClearCheckTimeout.start (boost::bind (&PrivateWindow::checkClear, priv), |
821 | - 2000, 2500); |
822 | XConfigureWindow (screen->dpy (), serverFrame, valueMask, &xwc); |
823 | } |
824 | |
825 | @@ -1031,10 +1023,6 @@ |
826 | screen->dpy (), serverFrame, valueMask, &xwc))); |
827 | |
828 | pendingConfigures.add (pc); |
829 | - if (priv->mClearCheckTimeout.active ()) |
830 | - priv->mClearCheckTimeout.stop (); |
831 | - priv->mClearCheckTimeout.start (boost::bind (&PrivateWindow::checkClear, priv), |
832 | - 2000, 2500); |
833 | |
834 | XSendEvent (screen->dpy (), screen->root (), false, |
835 | SubstructureNotifyMask, (XEvent *) &xev); |
836 | @@ -1050,10 +1038,6 @@ |
837 | screen->dpy (), serverFrame, valueMask, &xwc))); |
838 | |
839 | pendingConfigures.add (pc); |
840 | - if (priv->mClearCheckTimeout.active ()) |
841 | - priv->mClearCheckTimeout.stop (); |
842 | - priv->mClearCheckTimeout.start (boost::bind (&PrivateWindow::checkClear, priv), |
843 | - 2000, 2500); |
844 | |
845 | XConfigureWindow (screen->dpy (), serverFrame, valueMask, &xwc); |
846 | } |
847 | @@ -2173,10 +2157,6 @@ |
848 | { |
849 | if (dx || dy) |
850 | { |
851 | - gettimeofday (&priv->lastGeometryUpdate, NULL); |
852 | - |
853 | - |
854 | - |
855 | window->moveNotify (dx, dy, immediate); |
856 | } |
857 | } |
858 | @@ -2187,22 +2167,6 @@ |
859 | return !mEvents.empty (); |
860 | } |
861 | |
862 | -bool |
863 | -PrivateWindow::checkClear () |
864 | -{ |
865 | - if (pendingConfigures.pending ()) |
866 | - { |
867 | - /* FIXME: This is a hack to avoid performance regressions |
868 | - * and must be removed in 0.9.6 */ |
869 | - compLogMessage ("core", CompLogLevelWarn, "failed to receive ConfigureNotify event on 0x%x\n", |
870 | - id); |
871 | - pendingConfigures.dump (); |
872 | - pendingConfigures.clear (); |
873 | - } |
874 | - |
875 | - return false; |
876 | -} |
877 | - |
878 | void |
879 | compiz::X11::PendingEventQueue::add (PendingEvent::Ptr p) |
880 | { |
881 | @@ -2274,12 +2238,6 @@ |
882 | |
883 | compiz::X11::PendingEventQueue::PendingEventQueue (Display *d) |
884 | { |
885 | - /* mClearCheckTimeout.setTimes (0, 0) |
886 | - * |
887 | - * XXX: For whatever reason, calling setTimes (0, 0) here causes |
888 | - * the destructor of the timer object to be called twice later on |
889 | - * in execution and the stack gets smashed. This could be a |
890 | - * compiler bug, but requires further investigation */ |
891 | } |
892 | |
893 | compiz::X11::PendingEventQueue::~PendingEventQueue () |
894 | @@ -3530,8 +3488,6 @@ |
895 | |
896 | if (serverFrame) |
897 | { |
898 | - gettimeofday (&lastConfigureRequest, NULL); |
899 | - |
900 | if (frameValueMask) |
901 | { |
902 | XWindowChanges wc = *xwc; |
903 | @@ -3547,11 +3503,6 @@ |
904 | screen->dpy (), priv->serverFrame, frameValueMask, &wc))); |
905 | |
906 | pendingConfigures.add (pc); |
907 | - if (priv->mClearCheckTimeout.active ()) |
908 | - priv->mClearCheckTimeout.stop (); |
909 | - priv->mClearCheckTimeout.start (boost::bind (&PrivateWindow::checkClear, priv), |
910 | - 2000, 2500); |
911 | - |
912 | XConfigureWindow (screen->dpy (), serverFrame, frameValueMask, &wc); |
913 | } |
914 | valueMask &= ~(CWSibling | CWStackMode); |
915 | @@ -4343,10 +4294,6 @@ |
916 | screen->dpy (), serverFrame, valueMask, &lxwc))); |
917 | |
918 | pendingConfigures.add (pc); |
919 | - if (priv->mClearCheckTimeout.active ()) |
920 | - priv->mClearCheckTimeout.stop (); |
921 | - priv->mClearCheckTimeout.start (boost::bind (&PrivateWindow::checkClear, priv), |
922 | - 2000, 2500); |
923 | } |
924 | |
925 | /* Below with no sibling puts the window at the bottom |
926 | @@ -6619,8 +6566,9 @@ |
927 | } |
928 | } |
929 | |
930 | - /* TODO: bailout properly when objectInitPlugins fails */ |
931 | - assert (CompPlugin::windowInitPlugins (this)); |
932 | + if (screen->priv->initialized) |
933 | + /* TODO: bailout properly when objectInitPlugins fails */ |
934 | + assert (CompPlugin::windowInitPlugins (this)); |
935 | |
936 | recalcActions (); |
937 | priv->updateIconGeometry (); |
938 | @@ -6790,7 +6738,6 @@ |
939 | pendingUnmaps (0), |
940 | pendingMaps (0), |
941 | pendingConfigures (screen->dpy ()), |
942 | - pendingPositionUpdates (false), |
943 | |
944 | startupId (0), |
945 | resName (0), |
Added tests for clamping geometry to workarea (eg, within a rectangle) and also for handling screen size changes (eg, clamp to within new workarea, try to restore to last position before the clamping occurred when the resolution gets bigger.
Next pipe: lp:~compiz-team/compiz-core/fix_898469