Gentoo Archives: gentoo-commits

From: "Romain Perier (mrpouet)" <mrpouet@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in x11-plugins/compiz-plugins-main/files: compiz-plugins-main-0.8.4-put-plugin.patch
Date: Sun, 31 Jan 2010 17:00:49
Message-Id: E1NbdAE-0008NL-QQ@stork.gentoo.org
1 mrpouet 10/01/31 17:00:46
2
3 Added: compiz-plugins-main-0.8.4-put-plugin.patch
4 Log:
5 Handle windows that have server border set properly (put plugin), per bug #302308. Many thanks to Denilson.
6 (Portage version: 2.2_rc62/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 x11-plugins/compiz-plugins-main/files/compiz-plugins-main-0.8.4-put-plugin.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-plugins/compiz-plugins-main/files/compiz-plugins-main-0.8.4-put-plugin.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-plugins/compiz-plugins-main/files/compiz-plugins-main-0.8.4-put-plugin.patch?rev=1.1&content-type=text/plain
13
14 Index: compiz-plugins-main-0.8.4-put-plugin.patch
15 ===================================================================
16 From dc097d85952f82b101ea897d33958582db2fa010 Mon Sep 17 00:00:00 2001
17 From: Danny Baumann <dannybaumann@×××.de>
18 Date: Sun, 31 Jan 2010 13:11:44 +0000
19 Subject: Handle windows that have server border set properly.
20
21 ---
22 diff --git a/put.c b/put.c
23 index daf268f..9870cd3 100644
24 --- a/src/put/put.c
25 +++ b/src/put/put.c
26 @@ -43,6 +43,14 @@
27 GET_PUT_SCREEN (w->screen, \
28 GET_PUT_DISPLAY (w->screen->display)))
29
30 +#define TOP_BORDER(w) ((w)->input.top)
31 +#define LEFT_BORDER(w) ((w)->input.left)
32 +#define RIGHT_BORDER(w) ((w)->input.right + 2 * (w)->serverBorderWidth)
33 +#define BOTTOM_BORDER(w) ((w)->input.bottom + 2 * (w)->serverBorderWidth)
34 +
35 +#define HALF_WIDTH(w) ((w)->serverWidth / 2 + (w)->serverBorderWidth)
36 +#define HALF_HEIGHT(w) ((w)->serverHeight / 2 + (w)->serverBorderWidth)
37 +
38 static int displayPrivateIndex;
39
40 typedef enum
41 @@ -395,54 +403,56 @@ putGetDistance (CompWindow *w,
42 switch (type) {
43 case PutCenter:
44 /* center of the screen */
45 - dx = (workArea.width / 2) - (w->serverWidth / 2) - (x - workArea.x);
46 - dy = (workArea.height / 2) - (w->serverHeight / 2) - (y - workArea.y);
47 + dx = (workArea.width / 2) - (w->serverWidth / 2) -
48 + w->serverBorderWidth - (x - workArea.x);
49 + dy = (workArea.height / 2) - (w->serverHeight / 2) -
50 + w->serverBorderWidth - (y - workArea.y);
51 break;
52 case PutLeft:
53 /* center of the left edge */
54 - dx = -(x - workArea.x) + w->input.left + putGetPadLeft (s);
55 - dy = (workArea.height / 2) - (w->serverHeight / 2) - (y - workArea.y);
56 + dx = -(x - workArea.x) + LEFT_BORDER (w) + putGetPadLeft (s);
57 + dy = (workArea.height / 2) - HALF_HEIGHT (w) - (y - workArea.y);
58 break;
59 case PutTopLeft:
60 /* top left corner */
61 - dx = -(x - workArea.x) + w->input.left + putGetPadLeft (s);
62 - dy = -(y - workArea.y) + w->input.top + putGetPadTop (s);
63 + dx = -(x - workArea.x) + LEFT_BORDER (w) + putGetPadLeft (s);
64 + dy = -(y - workArea.y) + TOP_BORDER (w) + putGetPadTop (s);
65 break;
66 case PutTop:
67 /* center of top edge */
68 - dx = (workArea.width / 2) - (w->serverWidth / 2) - (x - workArea.x);
69 - dy = -(y - workArea.y) + w->input.top + putGetPadTop (s);
70 + dx = (workArea.width / 2) - HALF_WIDTH (w) - (x - workArea.x);
71 + dy = -(y - workArea.y) + TOP_BORDER (w) + putGetPadTop (s);
72 break;
73 case PutTopRight:
74 /* top right corner */
75 dx = workArea.width - w->serverWidth - (x - workArea.x) -
76 - w->input.right - putGetPadRight (s);
77 - dy = -(y - workArea.y) + w->input.top + putGetPadTop (s);
78 + RIGHT_BORDER (w) - putGetPadRight (s);
79 + dy = -(y - workArea.y) + TOP_BORDER (w) + putGetPadTop (s);
80 break;
81 case PutRight:
82 /* center of right edge */
83 dx = workArea.width - w->serverWidth - (x - workArea.x) -
84 - w->input.right - putGetPadRight (s);
85 - dy = (workArea.height / 2) - (w->serverHeight / 2) - (y - workArea.y);
86 + RIGHT_BORDER (w) - putGetPadRight (s);
87 + dy = (workArea.height / 2) - HALF_HEIGHT (w) - (y - workArea.y);
88 break;
89 case PutBottomRight:
90 /* bottom right corner */
91 dx = workArea.width - w->serverWidth - (x - workArea.x) -
92 - w->input.right - putGetPadRight (s);
93 + RIGHT_BORDER (w) - putGetPadRight (s);
94 dy = workArea.height - w->serverHeight - (y - workArea.y) -
95 - w->input.bottom - putGetPadBottom (s);
96 + BOTTOM_BORDER (w) - putGetPadBottom (s);
97 break;
98 case PutBottom:
99 /* center of bottom edge */
100 - dx = (workArea.width / 2) - (w->serverWidth / 2) - (x - workArea.x);
101 + dx = (workArea.width / 2) - HALF_WIDTH (w) - (x - workArea.x);
102 dy = workArea.height - w->serverHeight - (y - workArea.y) -
103 - w->input.bottom - putGetPadBottom (s);
104 + BOTTOM_BORDER (w) - putGetPadBottom (s);
105 break;
106 case PutBottomLeft:
107 /* bottom left corner */
108 - dx = -(x - workArea.x) + w->input.left + putGetPadLeft (s);
109 + dx = -(x - workArea.x) + LEFT_BORDER (w) + putGetPadLeft (s);
110 dy = workArea.height - w->serverHeight - (y - workArea.y) -
111 - w->input.bottom - putGetPadBottom (s);
112 + BOTTOM_BORDER (w) - putGetPadBottom (s);
113 break;
114 case PutRestore:
115 /* back to last position */
116 @@ -538,16 +548,16 @@ putGetDistance (CompWindow *w,
117 if (posX < 0)
118 /* account for a specified negative position,
119 like geometry without (-0) */
120 - dx = posX + s->width - w->serverWidth - x - w->input.right;
121 + dx = posX + s->width - w->serverWidth - x - RIGHT_BORDER (w);
122 else
123 - dx = posX - x + w->input.left;
124 + dx = posX - x + LEFT_BORDER (w);
125
126 if (posY < 0)
127 /* account for a specified negative position,
128 like geometry without (-0) */
129 - dy = posY + s->height - w->height - y - w->input.bottom;
130 + dy = posY + s->height - w->serverHeight - y - BOTTOM_BORDER (w);
131 else
132 - dy = posY - y + w->input.top;
133 + dy = posY - y + TOP_BORDER (w);
134 break;
135 case PutRelative:
136 /* move window by offset */
137 @@ -572,35 +582,35 @@ putGetDistance (CompWindow *w,
138 if (putGetWindowCenter (s))
139 {
140 /* window center */
141 - dx = rx - (w->serverWidth / 2) - x;
142 - dy = ry - (w->serverHeight / 2) - y;
143 + dx = rx - HALF_WIDTH (w) - x;
144 + dy = ry - HALF_HEIGHT (w) - y;
145 }
146 else if (rx < s->workArea.width / 2 &&
147 ry < s->workArea.height / 2)
148 {
149 /* top left quad */
150 - dx = rx - x + w->input.left;
151 - dy = ry - y + w->input.top;
152 + dx = rx - x + LEFT_BORDER (w);
153 + dy = ry - y + TOP_BORDER (w);
154 }
155 else if (rx < s->workArea.width / 2 &&
156 ry >= s->workArea.height / 2)
157 {
158 /* bottom left quad */
159 - dx = rx - x + w->input.left;
160 - dy = ry - w->height - y - w->input.bottom;
161 + dx = rx - x + LEFT_BORDER (w);
162 + dy = ry - w->serverHeight - y - BOTTOM_BORDER (w);
163 }
164 else if (rx >= s->workArea.width / 2 &&
165 ry < s->workArea.height / 2)
166 {
167 /* top right quad */
168 - dx = rx - w->width - x - w->input.right;
169 - dy = ry - y + w->input.top;
170 + dx = rx - w->serverWidth - x - RIGHT_BORDER (w);
171 + dy = ry - y + TOP_BORDER (w);
172 }
173 else
174 {
175 /* bottom right quad */
176 - dx = rx - w->width - x - w->input.right;
177 - dy = ry - w->height - y - w->input.bottom;
178 + dx = rx - w->serverWidth - x - RIGHT_BORDER (w);
179 + dy = ry - w->serverHeight - y - BOTTOM_BORDER (w);
180 }
181 }
182 else
183 @@ -627,10 +637,10 @@ putGetDistance (CompWindow *w,
184 inDx = dxBefore = dx % s->width;
185 inDy = dyBefore = dy % s->height;
186
187 - extents.left = x + inDx - w->input.left;
188 - extents.top = y + inDy - w->input.top;
189 - extents.right = x + inDx + w->serverWidth + w->input.right;
190 - extents.bottom = y + inDy + w->serverHeight + w->input.bottom;
191 + extents.left = x + inDx - LEFT_BORDER (w);
192 + extents.top = y + inDy - TOP_BORDER (w);
193 + extents.right = x + inDx + w->serverWidth + RIGHT_BORDER (w);
194 + extents.bottom = y + inDy + w->serverHeight + BOTTOM_BORDER (w);
195
196 area.left = workArea.x + putGetPadLeft (s);
197 area.top = workArea.y + putGetPadTop (s);
198 --
199 cgit v0.8.2