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

Proposed by Timo Jyrinki
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
debian/changelog (+10/-0)
debian/patches/fix_1015151.patch (+26/-0)
debian/patches/fix_755842.patch (+285/-0)
debian/patches/series (+2/-0)
To merge this branch: bzr merge lp:~timo-jyrinki/ubuntu/precise/compiz-plugins-main/fix_755842
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Ubuntu branches 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.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :
review: Approve

Preview Diff

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

Subscribers

People subscribed via source and target branches

to all changes: