Ubuntu

Merge lp:~timo-jyrinki/ubuntu/precise/compiz-plugins-main/fix_755842 into lp:ubuntu/precise/compiz-plugins-main

Proposed by Timo Jyrinki on 2013-05-08
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: lp:~timo-jyrinki/ubuntu/precise/compiz-plugins-main/fix_755842
Merge into: lp:ubuntu/precise/compiz-plugins-main
Diff against target: 348 lines (+323/-0) 4 files modified
To merge this branch: bzr merge lp:~timo-jyrinki/ubuntu/precise/compiz-plugins-main/fix_755842
Reviewer Review Type Date Requested Status
Didier Roche Approve on 2013-06-12
Ubuntu branches 2013-05-08 Pending
Review via email: mp+162934@code.launchpad.net

Commit Message

* debian/patches/fix_755842.patch:
  Fix non-maximized windows which sit on the border of a workspace move
  when called (LP: #755842)
* debian/patches/fix_1015151.patch:
  Fix a crash related to the above fix (LP: #1015151)

Description of the Change

For didrocks.

To post a comment you must log in.
Didier Roche (didrocks) wrote :
review: Approve

Preview Diff

1=== modified file 'debian/changelog'
2--- debian/changelog 2012-04-12 09:19:07 +0000
3+++ debian/changelog 2013-05-08 06:47:25 +0000
4@@ -1,3 +1,13 @@
5+compiz-plugins-main (1:0.9.7.0~bzr19-0ubuntu10.1) UNRELEASED; urgency=low
6+
7+ * debian/patches/fix_755842.patch:
8+ Fix non-maximized windows which sit on the border of a workspace move
9+ when called (LP: #755842)
10+ * debian/patches/fix_1015151.patch:
11+ Fix a crash related to the above fix (LP: #1015151)
12+
13+ -- Timo Jyrinki <timo-jyrinki@ubuntu.com> Mon, 25 Feb 2013 10:56:33 +0200
14+
15 compiz-plugins-main (1:0.9.7.0~bzr19-0ubuntu10) precise; urgency=low
16
17 [ Sam Spilsbury ]
18
19=== added file 'debian/patches/fix_1015151.patch'
20--- debian/patches/fix_1015151.patch 1970-01-01 00:00:00 +0000
21+++ debian/patches/fix_1015151.patch 2013-05-08 06:47:25 +0000
22@@ -0,0 +1,26 @@
23+=== modified file 'wall/src/offset_movement/src/offset-movement.cpp'
24+--- a/wall/src/offset_movement/src/offset-movement.cpp 2012-05-09 01:57:02 +0000
25++++ b/wall/src/offset_movement/src/offset-movement.cpp 2012-11-29 03:30:20 +0000
26+@@ -28,7 +28,7 @@
27+ compiz::wall::movementWindowOnScreen (const CompRect &serverBorderRect,
28+ const CompRegion &screenRegion)
29+ {
30+- CompRegion sbrRegion (static_cast <const CompRect &> (serverBorderRect));
31++ CompRegion sbrRegion (serverBorderRect);
32+
33+ /* If the window would be partially offscreen
34+ * after it was moved then we should move it back
35+@@ -41,8 +41,10 @@
36+ int dx = 0;
37+ int dy = 0;
38+
39+- for (std::vector <CompRect>::const_iterator it = rem.rects ().begin ();
40+- it != rem.rects ().end ();
41++ const CompRect::vector &rects (rem.rects ());
42++
43++ for (std::vector <CompRect>::const_iterator it = rects.begin ();
44++ it != rects.end ();
45+ it++)
46+ {
47+ const CompRect &r = *it;
48+
49
50=== added file 'debian/patches/fix_755842.patch'
51--- debian/patches/fix_755842.patch 1970-01-01 00:00:00 +0000
52+++ debian/patches/fix_755842.patch 2013-05-08 06:47:25 +0000
53@@ -0,0 +1,285 @@
54+=== modified file 'wall/CMakeLists.txt'
55+--- a/wall/CMakeLists.txt 2012-04-24 10:17:49 +0000
56++++ b/wall/CMakeLists.txt 2012-05-09 01:57:02 +0000
57+@@ -2,4 +2,7 @@
58+
59+ include (CompizPlugin)
60+
61+-compiz_plugin (wall PLUGINDEPS composite opengl mousepoll PKGDEPS cairo cairo-xlib-xrender)
62++add_subdirectory (src/offset_movement)
63++include_directories (src/offset_movement/include)
64++
65++compiz_plugin (wall PLUGINDEPS composite opengl mousepoll PKGDEPS cairo cairo-xlib-xrender LIBRARIES compiz_wall_offset_movement dl)
66+
67+=== added directory 'wall/src/offset_movement'
68+=== added file 'wall/src/offset_movement/CMakeLists.txt'
69+--- a/wall/src/offset_movement/CMakeLists.txt 1970-01-01 00:00:00 +0000
70++++ b/wall/src/offset_movement/CMakeLists.txt 2012-05-09 01:57:02 +0000
71+@@ -0,0 +1,53 @@
72++pkg_check_modules (
73++ GLIBMM
74++ REQUIRED
75++ glibmm-2.4 glib-2.0 compiz
76++)
77++
78++INCLUDE_DIRECTORIES (
79++ ${CMAKE_CURRENT_SOURCE_DIR}/include
80++ ${CMAKE_CURRENT_SOURCE_DIR}/src
81++
82++ ${CMAKE_SOURCE_DIR}/include
83++
84++ ${Boost_INCLUDE_DIRS}
85++
86++ ${GLIBMM_INCLUDE_DIRS}
87++)
88++
89++LINK_DIRECTORIES (${GLIBMM_LIBRARY_DIRS})
90++
91++SET (
92++ PUBLIC_HEADERS
93++)
94++
95++SET (
96++ PRIVATE_HEADERS
97++ ${CMAKE_CURRENT_SOURCE_DIR}/include/offset-movement.h
98++)
99++
100++SET(
101++ SRCS
102++ ${CMAKE_CURRENT_SOURCE_DIR}/src/offset-movement.cpp
103++)
104++
105++ADD_LIBRARY(
106++ compiz_wall_offset_movement STATIC
107++
108++ ${SRCS}
109++
110++ ${PUBLIC_HEADERS}
111++ ${PRIVATE_HEADERS}
112++)
113++
114++SET_TARGET_PROPERTIES(
115++ compiz_wall_offset_movement PROPERTIES
116++ PUBLIC_HEADER "${PUBLIC_HEADERS}"
117++)
118++
119++TARGET_LINK_LIBRARIES(
120++ compiz_wall_offset_movement
121++
122++ compiz_core
123++ ${GLIBMM_LIBRARIES}
124++)
125+
126+=== added directory 'wall/src/offset_movement/include'
127+=== added file 'wall/src/offset_movement/include/offset-movement.h'
128+--- a/wall/src/offset_movement/include/offset-movement.h 1970-01-01 00:00:00 +0000
129++++ b/wall/src/offset_movement/include/offset-movement.h 2012-05-09 01:57:02 +0000
130+@@ -0,0 +1,41 @@
131++/**
132++ *
133++ * Compiz wall plugin
134++ *
135++ * offset-movement.h
136++ *
137++ * Copyright (c) 2006 Robert Carr <racarr@beryl-project.org>
138++ *
139++ * Authors:
140++ * Robert Carr <racarr@beryl-project.org>
141++ * Dennis Kasprzyk <onestone@opencompositing.org>
142++ *
143++ * This program is free software; you can redistribute it and/or
144++ * modify it under the terms of the GNU General Public License
145++ * as published by the Free Software Foundation; either version 2
146++ * of the License, or (at your option) any later version.
147++ *
148++ * This program is distributed in the hope that it will be useful,
149++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
150++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
151++ * GNU General Public License for more details.
152++ *
153++ **/
154++
155++#ifndef _COMPIZ_WALL_OFFSET_MOVEMENT_H
156++#define _COMPIZ_WALL_OFFSET_MOVEMENT_H
157++
158++#include <core/region.h>
159++#include <core/rect.h>
160++#include <core/point.h>
161++
162++namespace compiz
163++{
164++ namespace wall
165++ {
166++ CompPoint movementWindowOnScreen (const CompRect &serverBorderRect,
167++ const CompRegion &screenRegion);
168++ }
169++}
170++
171++#endif
172+
173+=== added directory 'wall/src/offset_movement/src'
174+=== added file 'wall/src/offset_movement/src/offset-movement.cpp'
175+--- a/wall/src/offset_movement/src/offset-movement.cpp 1970-01-01 00:00:00 +0000
176++++ b/wall/src/offset_movement/src/offset-movement.cpp 2012-05-09 01:57:02 +0000
177+@@ -0,0 +1,62 @@
178++/**
179++ *
180++ * Compiz wall plugin
181++ *
182++ * offset-movement.c
183++ *
184++ * Copyright (c) 2006 Robert Carr <racarr@beryl-project.org>
185++ *
186++ * Authors:
187++ * Robert Carr <racarr@beryl-project.org>
188++ * Dennis Kasprzyk <onestone@opencompositing.org>
189++ *
190++ * This program is free software; you can redistribute it and/or
191++ * modify it under the terms of the GNU General Public License
192++ * as published by the Free Software Foundation; either version 2
193++ * of the License, or (at your option) any later version.
194++ *
195++ * This program is distributed in the hope that it will be useful,
196++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
197++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
198++ * GNU General Public License for more details.
199++ *
200++ **/
201++
202++#include "offset-movement.h"
203++
204++CompPoint
205++compiz::wall::movementWindowOnScreen (const CompRect &serverBorderRect,
206++ const CompRegion &screenRegion)
207++{
208++ CompRegion sbrRegion (static_cast <const CompRect &> (serverBorderRect));
209++
210++ /* If the window would be partially offscreen
211++ * after it was moved then we should move it back
212++ * so that it is completely onscreen, since we moved
213++ * from mostly offscreen on B to mostly onscreen on A,
214++ * the user should be able to see their selected window */
215++ CompRegion inter = sbrRegion.intersected (screenRegion);
216++ CompRegion rem = sbrRegion - screenRegion;
217++
218++ int dx = 0;
219++ int dy = 0;
220++
221++ for (std::vector <CompRect>::const_iterator it = rem.rects ().begin ();
222++ it != rem.rects ().end ();
223++ it++)
224++ {
225++ const CompRect &r = *it;
226++
227++ if (r.x1 () >= inter.boundingRect ().x2 ())
228++ dx -= r.width ();
229++ else if (r.x2 () <= inter.boundingRect ().x1 ())
230++ dx += r.width ();
231++
232++ if (r.y1 () >= inter.boundingRect ().y2 ())
233++ dy -= r.height ();
234++ else if (r.y2 () <= inter.boundingRect ().y1 ())
235++ dy += r.height ();
236++ }
237++
238++ return CompPoint (dx, dy);
239++}
240+
241+=== modified file 'wall/src/wall.cpp'
242+--- a/wall/src/wall.cpp 2012-01-23 10:29:36 +0000
243++++ b/wall/src/wall.cpp 2012-05-09 01:57:02 +0000
244+@@ -620,50 +620,29 @@
245+ XWindowChanges xwc;
246+ unsigned int mask = 0;
247+
248+- ws->moveViewport (-dx, -dy, false);
249++ /* If changing viewports fails we should not
250++ * move the client window */
251++ if (!ws->moveViewport (-dx, -dy, false))
252++ {
253++ window->activate ();
254++ return;
255++ }
256++
257+ ws->focusDefault = false;
258+
259+- CompWindow::Geometry sbr (window->serverBorderRect ().x (),
260+- window->serverBorderRect ().y (),
261+- window->serverBorderRect ().width (),
262+- window->serverBorderRect ().height (),
263+- 0);
264+- CompRegion sbrRegion (sbr);
265+- int output = screen->outputDeviceForGeometry (sbr);
266+- CompRegion outputRegion (screen->outputDevs ()[output].workArea ());
267+-
268+- /* If the window would be partially offscreen
269+- * after it was moved then we should move it back
270+- * so that it is completely onscreen, since we moved
271+- * from mostly offscreen on B to mostly onscreen on A,
272+- * the user should be able to see their selected window */
273+- CompRegion inter = sbrRegion.intersected (outputRegion);
274+- CompRegion rem = sbrRegion - outputRegion;
275+-
276+- foreach (const CompRect &r, rem.rects ())
277+- {
278+- if (r.x1 () >= inter.boundingRect ().x2 ())
279+- {
280+- xwc.x = window->serverGeometry ().x () - r.width ();
281+- mask |= CWX;
282+- }
283+- else if (r.x2 () <= inter.boundingRect ().x1 ())
284+- {
285+- xwc.x = window->serverGeometry ().x () + r.width ();
286+- mask |= CWX;
287+- }
288+-
289+- if (r.y1 () >= inter.boundingRect ().y2 ())
290+- {
291+- xwc.y = window->serverGeometry ().y () - r.height ();
292+- mask |= CWY;
293+- }
294+- else if (r.y2 () <= inter.boundingRect ().y1 ())
295+- {
296+- xwc.y = window->serverGeometry ().y () + r.height ();
297+- mask |= CWY;
298+- }
299+- }
300++ CompRegion screenRegion;
301++
302++ foreach (const CompOutput &o, screen->outputDevs ())
303++ screenRegion += o.workArea ();
304++
305++ CompPoint d = compiz::wall::movementWindowOnScreen (window->serverBorderRect (),
306++ screenRegion);
307++
308++ mask |= d.x () !=0 ? CWX : 0;
309++ mask |= d.y () !=0 ? CWY : 0;
310++
311++ xwc.x = window->serverGeometry ().x () + dx;
312++ xwc.y = window->serverGeometry ().y () + dy;
313+
314+ window->configureXWindow (mask, &xwc);
315+ }
316+@@ -1515,7 +1494,7 @@
317+
318+ if (!moving && !showPreview && grabIndex)
319+ {
320+- screen->removeGrab (grabIndex, NULL);
321++ screen->removeGrab (static_cast <CompScreen::GrabHandle> (grabIndex), NULL);
322+ grabIndex = 0;
323+ }
324+
325+
326+=== modified file 'wall/src/wall.h'
327+--- a/wall/src/wall.h 2012-03-09 10:11:24 +0000
328++++ b/wall/src/wall.h 2012-05-09 01:57:02 +0000
329+@@ -31,6 +31,8 @@
330+ #include <cairo-xlib-xrender.h>
331+ #include <cairo.h>
332+
333++#include "offset-movement.h"
334++
335+ #include "wall_options.h"
336+
337+
338+
339
340=== modified file 'debian/patches/series'
341--- debian/patches/series 2012-04-12 09:19:07 +0000
342+++ debian/patches/series 2013-05-08 06:47:25 +0000
343@@ -11,3 +11,5 @@
344 fix_963767.patch
345 fix_976469.patch
346 fix_940603.patch
347+fix_755842.patch
348+fix_1015151.patch

Subscribers

People subscribed via source and target branches

to all changes: