wok-next view openbox/stuff/patches/14_pi_corners.patch @ rev 20616
xrdp: up 0.9.3.1; zopfli: fix build; gcc61: attempt to fix; add gcc6 (latest among 6.x.x).
gcc61 and gcc6 are broken now.
gcc61 and gcc6 are broken now.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sat Apr 21 05:15:11 2018 +0300 (2018-04-21) |
parents | |
children |
line source
1 diff --git a/openbox/config.c b/openbox/config.c
2 index 76f4856..64822ac 100644
3 --- a/openbox/config.c
4 +++ b/openbox/config.c
5 @@ -48,6 +48,8 @@ StrutPartial config_margins;
6 gchar *config_theme;
7 gboolean config_theme_keepborder;
8 guint config_theme_window_list_icon_size;
9 +gboolean config_theme_roundcorners;
10 +gboolean config_theme_invhandles;
12 gchar *config_title_layout;
14 @@ -719,6 +721,10 @@ static void parse_theme(xmlNodePtr node, gpointer d)
15 else if (config_theme_window_list_icon_size > 96)
16 config_theme_window_list_icon_size = 96;
17 }
18 + if ((n = obt_xml_find_node(node, "roundCorners")))
19 + config_theme_roundcorners = obt_xml_node_bool(n);
20 + if ((n = obt_xml_find_node(node, "invisibleHandles")))
21 + config_theme_invhandles = obt_xml_node_bool(n);
23 for (n = obt_xml_find_node(node, "font");
24 n;
25 @@ -1078,6 +1084,8 @@ void config_startup(ObtXmlInst *i)
26 config_title_layout = g_strdup("NLIMC");
27 config_theme_keepborder = TRUE;
28 config_theme_window_list_icon_size = 36;
29 + config_theme_roundcorners = FALSE;
30 + config_theme_invhandles = FALSE;
32 config_font_activewindow = NULL;
33 config_font_inactivewindow = NULL;
34 diff --git a/openbox/config.h b/openbox/config.h
35 index fc1d217..6bff777 100644
36 --- a/openbox/config.h
37 +++ b/openbox/config.h
38 @@ -152,6 +152,10 @@ extern gchar *config_title_layout;
39 extern gboolean config_animate_iconify;
40 /*! Size of icons in focus switching dialogs */
41 extern guint config_theme_window_list_icon_size;
42 +/*! Display rounded corners for decorated windows */
43 +extern gboolean config_theme_roundcorners;
44 +/*! Extend drag handles outside window borders */
45 +extern gboolean config_theme_invhandles;
47 /*! The font for the active window's title */
48 extern RrFont *config_font_activewindow;
49 diff --git a/openbox/frame.c b/openbox/frame.c
50 index 3dbcf12..cf50c56 100644
51 --- a/openbox/frame.c
52 +++ b/openbox/frame.c
53 @@ -45,6 +45,8 @@
55 #define FRAME_HANDLE_Y(f) (f->size.top + f->client->area.height + f->cbwidth_b)
57 +#define INV_WIDTH 10
58 +
59 static void flash_done(gpointer data);
60 static gboolean flash_timeout(gpointer data);
62 @@ -54,6 +56,8 @@ static void free_theme_statics(ObFrame *self);
63 static gboolean frame_animate_iconify(gpointer self);
64 static void frame_adjust_cursors(ObFrame *self);
66 +static gboolean moving = FALSE;
67 +
68 static Window createWindow(Window parent, Visual *visual,
69 gulong mask, XSetWindowAttributes *attrib)
70 {
71 @@ -64,6 +68,14 @@ static Window createWindow(Window parent, Visual *visual,
73 }
75 +static Window createInputWindow (Window parent, gulong mask, XSetWindowAttributes *attrib)
76 +{
77 + return XCreateWindow(obt_display, parent, 0, 0, 1, 1, 0,
78 + CopyFromParent, InputOnly,
79 + CopyFromParent,
80 + mask, attrib);
81 +}
82 +
83 static Visual *check_32bit_client(ObClient *c)
84 {
85 XWindowAttributes wattrib;
86 @@ -125,6 +137,7 @@ ObFrame *frame_new(ObClient *client)
88 mask |= CWEventMask;
89 attrib.event_mask = ELEMENT_EVENTMASK;
90 +
91 self->innerleft = createWindow(self->window, NULL, mask, &attrib);
92 self->innertop = createWindow(self->window, NULL, mask, &attrib);
93 self->innerright = createWindow(self->window, NULL, mask, &attrib);
94 @@ -176,6 +189,52 @@ ObFrame *frame_new(ObClient *client)
95 self->rgriptop = createWindow(self->window, NULL, mask, &attrib);
96 self->rgripbottom = createWindow(self->window, NULL, mask, &attrib);
98 + self->outerleft = createWindow(self->window, NULL, mask, &attrib);
99 + self->outerright = createWindow(self->window, NULL, mask, &attrib);
100 + self->outertop = createWindow(self->window, NULL, mask, &attrib);
101 + self->outerbottom = createWindow(self->window, NULL, mask, &attrib);
102 + self->outerlefttop = createWindow(self->window, NULL, mask, &attrib);
103 + self->outerrighttop = createWindow(self->window, NULL, mask, &attrib);
104 + self->outerleftbottom = createWindow(self->window, NULL, mask, &attrib);
105 + self->outerrightbottom = createWindow(self->window, NULL, mask, &attrib);
106 + self->outertopleft = createWindow(self->window, NULL, mask, &attrib);
107 + self->outertopright = createWindow(self->window, NULL, mask, &attrib);
108 + self->outerbottomleft = createWindow(self->window, NULL, mask, &attrib);
109 + self->outerbottomright = createWindow(self->window, NULL, mask, &attrib);
110 +
111 + self->edgeleft = createWindow(self->window, NULL, mask, &attrib);
112 + self->edgeright = createWindow(self->window, NULL, mask, &attrib);
113 + self->edgetop = createWindow(self->window, NULL, mask, &attrib);
114 + self->edgebottom = createWindow(self->window, NULL, mask, &attrib);
115 + self->edgelefttop = createWindow(self->window, NULL, mask, &attrib);
116 + self->edgerighttop = createWindow(self->window, NULL, mask, &attrib);
117 + self->edgeleftbottom = createWindow(self->window, NULL, mask, &attrib);
118 + self->edgerightbottom = createWindow(self->window, NULL, mask, &attrib);
119 + self->edgetopleft = createWindow(self->window, NULL, mask, &attrib);
120 + self->edgetopright = createWindow(self->window, NULL, mask, &attrib);
121 + self->edgebottomleft = createWindow(self->window, NULL, mask, &attrib);
122 + self->edgebottomright = createWindow(self->window, NULL, mask, &attrib);
123 + self->ce_tl_t = createWindow(self->window, NULL, mask, &attrib);
124 + self->ce_tl_l = createWindow(self->window, NULL, mask, &attrib);
125 + self->ce_tr_t = createWindow(self->window, NULL, mask, &attrib);
126 + self->ce_tr_r = createWindow(self->window, NULL, mask, &attrib);
127 + self->ce_bl_b = createWindow(self->window, NULL, mask, &attrib);
128 + self->ce_bl_l = createWindow(self->window, NULL, mask, &attrib);
129 + self->ce_br_b = createWindow(self->window, NULL, mask, &attrib);
130 + self->ce_br_r = createWindow(self->window, NULL, mask, &attrib);
131 +
132 + if (config_theme_invhandles)
133 + {
134 + self->invleft = createInputWindow (obt_root (ob_screen), mask, &attrib);
135 + self->invright = createInputWindow (obt_root (ob_screen), mask, &attrib);
136 + self->invtop = createInputWindow (obt_root (ob_screen), mask, &attrib);
137 + self->invbottom = createInputWindow (obt_root (ob_screen), mask, &attrib);
138 + self->invtl = createInputWindow (obt_root (ob_screen), mask, &attrib);
139 + self->invtr = createInputWindow (obt_root (ob_screen), mask, &attrib);
140 + self->invbl = createInputWindow (obt_root (ob_screen), mask, &attrib);
141 + self->invbr = createInputWindow (obt_root (ob_screen), mask, &attrib);
142 + }
143 +
144 self->focused = FALSE;
146 /* the other stuff is shown based on decor settings */
147 @@ -231,12 +290,145 @@ void frame_free(ObFrame *self)
148 free_theme_statics(self);
150 XDestroyWindow(obt_display, self->window);
151 + if (config_theme_invhandles)
152 + {
153 + XDestroyWindow(obt_display, self->invleft);
154 + XDestroyWindow(obt_display, self->invright);
155 + XDestroyWindow(obt_display, self->invtop);
156 + XDestroyWindow(obt_display, self->invbottom);
157 + XDestroyWindow(obt_display, self->invtr);
158 + XDestroyWindow(obt_display, self->invtl);
159 + XDestroyWindow(obt_display, self->invbl);
160 + XDestroyWindow(obt_display, self->invbr);
161 + }
162 if (self->colormap)
163 XFreeColormap(obt_display, self->colormap);
165 g_slice_free(ObFrame, self);
166 }
168 +void frame_remove_handles (ObClient *client)
169 +{
170 + ObFrame *self = client->frame;
171 + moving = TRUE;
172 + if (config_theme_invhandles)
173 + {
174 + window_remove(self->invleft);
175 + window_remove(self->invright);
176 + window_remove(self->invtop);
177 + window_remove(self->invbottom);
178 + window_remove(self->invtl);
179 + window_remove(self->invtr);
180 + window_remove(self->invbl);
181 + window_remove(self->invbr);
182 + XDestroyWindow(obt_display, self->invleft);
183 + XDestroyWindow(obt_display, self->invright);
184 + XDestroyWindow(obt_display, self->invtop);
185 + XDestroyWindow(obt_display, self->invbottom);
186 + XDestroyWindow(obt_display, self->invtr);
187 + XDestroyWindow(obt_display, self->invtl);
188 + XDestroyWindow(obt_display, self->invbl);
189 + XDestroyWindow(obt_display, self->invbr);
190 + }
191 +}
192 +
193 +void frame_restore_handles (ObClient *client)
194 +{
195 + ObFrame *self = client->frame;
196 + XSetWindowAttributes attrib;
197 + gulong mask = 0;
198 + Visual *visual = check_32bit_client (client);
199 + gboolean topbot = !self->client->max_vert;
200 + gboolean sh = self->client->shaded;
201 + XSetWindowAttributes a;
202 + gboolean r = (self->client->functions & OB_CLIENT_FUNC_RESIZE) &&
203 + !(self->client->max_horz && self->client->max_vert);
204 +
205 + moving = FALSE;
206 + if (config_theme_invhandles)
207 + {
208 + if (visual)
209 + {
210 + /* client has a 32-bit visual */
211 + mask = CWColormap | CWBackPixel | CWBorderPixel;
212 + attrib.background_pixel = BlackPixel(obt_display, ob_screen);
213 + attrib.border_pixel = BlackPixel(obt_display, ob_screen);
214 + attrib.colormap = RrColormap(ob_rr_inst);
215 + }
216 +
217 + mask |= CWEventMask;
218 + attrib.event_mask = ELEMENT_EVENTMASK;
219 +
220 + self->invleft = XCreateWindow (obt_display, obt_root(ob_screen),
221 + self->area.x - INV_WIDTH, self->area.y, INV_WIDTH, self->area.height, 0,
222 + CopyFromParent, InputOnly, CopyFromParent, mask, &attrib);
223 +
224 + self->invright = XCreateWindow (obt_display, obt_root(ob_screen),
225 + self->area.x + self->area.width, self->area.y, INV_WIDTH, self->area.height, 0,
226 + CopyFromParent, InputOnly, CopyFromParent, mask, &attrib);
227 +
228 + self->invtop = XCreateWindow (obt_display, obt_root(ob_screen),
229 + self->area.x, self->area.y - INV_WIDTH, self->area.width, INV_WIDTH, 0,
230 + CopyFromParent, InputOnly, CopyFromParent, mask, &attrib);
231 +
232 + self->invbottom = XCreateWindow (obt_display, obt_root(ob_screen),
233 + self->area.x, self->area.y + self->area.height, self->area.width, INV_WIDTH, 0,
234 + CopyFromParent, InputOnly, CopyFromParent, mask, &attrib);
235 +
236 + self->invtl = XCreateWindow (obt_display, obt_root(ob_screen),
237 + self->area.x - INV_WIDTH, self->area.y - INV_WIDTH, INV_WIDTH, INV_WIDTH, 0,
238 + CopyFromParent, InputOnly, CopyFromParent, mask, &attrib);
239 +
240 + self->invtr = XCreateWindow (obt_display, obt_root(ob_screen),
241 + self->area.x + self->area.width, self->area.y - INV_WIDTH, INV_WIDTH, INV_WIDTH, 0,
242 + CopyFromParent, InputOnly, CopyFromParent, mask, &attrib);
243 +
244 + self->invbl = XCreateWindow (obt_display, obt_root(ob_screen),
245 + self->area.x - INV_WIDTH, self->area.y + self->area.height, INV_WIDTH, INV_WIDTH, 0,
246 + CopyFromParent, InputOnly, CopyFromParent, mask, &attrib);
247 +
248 + self->invbr = XCreateWindow (obt_display, obt_root(ob_screen),
249 + self->area.x + self->area.width, self->area.y + self->area.height, INV_WIDTH, INV_WIDTH, 0,
250 + CopyFromParent, InputOnly, CopyFromParent, mask, &attrib);
251 +
252 + window_add(&self->invleft, CLIENT_AS_WINDOW(self->client));
253 + window_add(&self->invright, CLIENT_AS_WINDOW(self->client));
254 + window_add(&self->invtop, CLIENT_AS_WINDOW(self->client));
255 + window_add(&self->invbottom, CLIENT_AS_WINDOW(self->client));
256 + window_add(&self->invtl, CLIENT_AS_WINDOW(self->client));
257 + window_add(&self->invtr, CLIENT_AS_WINDOW(self->client));
258 + window_add(&self->invbl, CLIENT_AS_WINDOW(self->client));
259 + window_add(&self->invbr, CLIENT_AS_WINDOW(self->client));
260 +
261 + XMapWindow (obt_display, self->invleft);
262 + XMapWindow (obt_display, self->invright);
263 + XMapWindow (obt_display, self->invtop);
264 + XMapWindow (obt_display, self->invbottom);
265 + XMapWindow (obt_display, self->invtl);
266 + XMapWindow (obt_display, self->invtr);
267 + XMapWindow (obt_display, self->invbl);
268 + XMapWindow (obt_display, self->invbr);
269 +
270 + a.cursor = ob_cursor (r && topbot && !sh ? OB_CURSOR_NORTH : OB_CURSOR_NONE);
271 + XChangeWindowAttributes(obt_display, self->invtop, CWCursor, &a);
272 + a.cursor = ob_cursor (r && topbot ? OB_CURSOR_SOUTH : OB_CURSOR_NONE);
273 + XChangeWindowAttributes(obt_display, self->invbottom, CWCursor, &a);
274 + a.cursor = ob_cursor (r ? (sh ? OB_CURSOR_WEST : OB_CURSOR_NORTHWEST) : OB_CURSOR_NONE);
275 + XChangeWindowAttributes(obt_display, self->invtl, CWCursor, &a);
276 + a.cursor = ob_cursor (r ? (sh ? OB_CURSOR_EAST : OB_CURSOR_NORTHEAST) : OB_CURSOR_NONE);
277 + XChangeWindowAttributes(obt_display, self->invtr, CWCursor, &a);
278 + a.cursor = ob_cursor (r ? OB_CURSOR_WEST : OB_CURSOR_NONE);
279 + XChangeWindowAttributes(obt_display, self->invleft, CWCursor, &a);
280 + a.cursor = ob_cursor (r ? OB_CURSOR_EAST : OB_CURSOR_NONE);
281 + XChangeWindowAttributes(obt_display, self->invright, CWCursor, &a);
282 + a.cursor = ob_cursor (r ? OB_CURSOR_SOUTHWEST : OB_CURSOR_NONE);
283 + XChangeWindowAttributes(obt_display, self->invbl, CWCursor, &a);
284 + a.cursor = ob_cursor (r ? OB_CURSOR_SOUTHEAST : OB_CURSOR_NONE);
285 + XChangeWindowAttributes(obt_display, self->invbr, CWCursor, &a);
286 + }
287 +}
288 +
289 +
290 void frame_show(ObFrame *self)
291 {
292 if (!self->visible) {
293 @@ -376,10 +568,17 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
294 self->width = MAX(self->width,
295 (ob_rr_theme->grip_width + self->bwidth) * 2 + 1);
297 + if (self->decorations & OB_FRAME_DECOR_TITLEBAR && config_theme_roundcorners)
298 + self->outer = 2;
299 + else
300 + self->outer = 0;
301 +
302 + if (self->max_horz || self->max_vert) self->outer = 0;
303 +
304 STRUT_SET(self->size,
305 - self->cbwidth_l + (!self->max_horz ? self->bwidth : 0),
306 + self->cbwidth_l + (!self->max_horz ? self->bwidth : 0) + self->outer,
307 self->cbwidth_t +
308 - (!self->max_horz || !self->max_vert ? self->bwidth : 0),
309 + (!self->max_horz || !self->max_vert ? self->bwidth : 0) + self->outer,
310 self->cbwidth_r + (!self->max_horz ? self->bwidth : 0),
311 self->cbwidth_b +
312 (!self->max_horz || !self->max_vert ? self->bwidth : 0));
313 @@ -499,32 +698,32 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
314 titlesides = (!self->max_horz ? ob_rr_theme->grip_width : 0);
316 XMoveResizeWindow(obt_display, self->titletop,
317 - ob_rr_theme->grip_width + self->bwidth, 0,
318 + ob_rr_theme->grip_width + self->bwidth + self->outer, self->outer,
319 /* width + bwidth*2 - bwidth*2 - grips*2 */
320 self->width - ob_rr_theme->grip_width * 2,
321 self->bwidth);
322 XMoveResizeWindow(obt_display, self->titletopleft,
323 - 0, 0,
324 + self->outer, self->outer,
325 ob_rr_theme->grip_width + self->bwidth,
326 self->bwidth);
327 XMoveResizeWindow(obt_display, self->titletopright,
328 self->client->area.width +
329 self->size.left + self->size.right -
330 ob_rr_theme->grip_width - self->bwidth,
331 - 0,
332 + self->outer,
333 ob_rr_theme->grip_width + self->bwidth,
334 self->bwidth);
336 if (titlesides > 0) {
337 XMoveResizeWindow(obt_display, self->titleleft,
338 - 0, self->bwidth,
339 + self->outer, self->bwidth + self->outer,
340 self->bwidth,
341 titlesides);
342 XMoveResizeWindow(obt_display, self->titleright,
343 self->client->area.width +
344 self->size.left + self->size.right -
345 self->bwidth,
346 - self->bwidth,
347 + self->bwidth + self->outer,
348 self->bwidth,
349 titlesides);
351 @@ -541,8 +740,8 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
353 if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
354 XMoveResizeWindow(obt_display, self->titlebottom,
355 - (self->max_horz ? 0 : self->bwidth),
356 - ob_rr_theme->title_height + self->bwidth,
357 + (self->max_horz ? 0 : self->bwidth) + self->outer,
358 + ob_rr_theme->title_height + self->bwidth + self->outer,
359 self->width,
360 self->bwidth);
362 @@ -561,8 +760,8 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
364 if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
365 XMoveResizeWindow(obt_display, self->title,
366 - (self->max_horz ? 0 : self->bwidth),
367 - self->bwidth,
368 + (self->max_horz ? 0 : self->bwidth) + self->outer,
369 + self->bwidth + self->outer,
370 self->width, ob_rr_theme->title_height);
372 XMapWindow(obt_display, self->title);
373 @@ -607,7 +806,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
374 if (self->bwidth && self->size.bottom) {
375 XMoveResizeWindow(obt_display, self->handlebottom,
376 ob_rr_theme->grip_width +
377 - self->bwidth + sidebwidth,
378 + self->bwidth + sidebwidth + self->outer,
379 self->size.top + self->client->area.height +
380 self->size.bottom - self->bwidth,
381 self->width - (ob_rr_theme->grip_width +
382 @@ -617,7 +816,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
384 if (sidebwidth) {
385 XMoveResizeWindow(obt_display, self->lgripleft,
386 - 0,
387 + self->outer,
388 self->size.top +
389 self->client->area.height +
390 self->size.bottom -
391 @@ -651,7 +850,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
392 }
394 XMoveResizeWindow(obt_display, self->lgripbottom,
395 - sidebwidth,
396 + sidebwidth + self->outer,
397 self->size.top + self->client->area.height +
398 self->size.bottom - self->bwidth,
399 ob_rr_theme->grip_width + self->bwidth,
400 @@ -674,7 +873,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
401 {
402 XMoveResizeWindow(obt_display, self->handletop,
403 ob_rr_theme->grip_width +
404 - self->bwidth + sidebwidth,
405 + self->bwidth + sidebwidth + self->outer,
406 FRAME_HANDLE_Y(self),
407 self->width - (ob_rr_theme->grip_width +
408 sidebwidth) * 2,
409 @@ -696,7 +895,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
410 ob_rr_theme->handle_height);
412 XMoveResizeWindow(obt_display, self->lgriptop,
413 - sidebwidth,
414 + sidebwidth + self->outer,
415 FRAME_HANDLE_Y(self),
416 ob_rr_theme->grip_width +
417 self->bwidth,
418 @@ -748,7 +947,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
419 ob_rr_theme->handle_height > 0)
420 {
421 XMoveResizeWindow(obt_display, self->handle,
422 - sidebwidth,
423 + sidebwidth + self->outer,
424 FRAME_HANDLE_Y(self) + self->bwidth,
425 self->width, ob_rr_theme->handle_height);
426 XMapWindow(obt_display, self->handle);
427 @@ -782,7 +981,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
428 self->size.bottom) > ob_rr_theme->grip_width * 2)
429 {
430 XMoveResizeWindow(obt_display, self->left,
431 - 0,
432 + self->outer,
433 self->bwidth + ob_rr_theme->grip_width,
434 self->bwidth,
435 self->client->area.height +
436 @@ -799,7 +998,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
437 {
438 XMoveResizeWindow(obt_display, self->right,
439 self->client->area.width + self->cbwidth_l +
440 - self->cbwidth_r + self->bwidth,
441 + self->cbwidth_r + self->bwidth + self->outer,
442 self->bwidth + ob_rr_theme->grip_width,
443 self->bwidth,
444 self->client->area.height +
445 @@ -810,6 +1009,274 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
446 } else
447 XUnmapWindow(obt_display, self->right);
449 + if (self->decorations & OB_FRAME_DECOR_TITLEBAR && self->outer)
450 + {
451 + int ww = self->width + self->outer * 2;
452 + int th = ob_rr_theme->title_height + self->bwidth * 2;
453 + int eh = self->client->area.height + self->cbwidth_t + self->cbwidth_b + self->bwidth;
454 + int wh = th + eh + self->outer * 2;
455 +
456 + XMoveResizeWindow (obt_display, self->edgetop,
457 + th,
458 + 0,
459 + ww - (th * 2),
460 + 1);
461 + XMapWindow (obt_display, self->edgetop);
462 +
463 + XMoveResizeWindow (obt_display, self->edgetopleft,
464 + 0,
465 + 0,
466 + th,
467 + 1);
468 + XMapWindow (obt_display, self->edgetopleft);
469 +
470 + XMoveResizeWindow (obt_display, self->edgetopright,
471 + ww - th,
472 + 0,
473 + th,
474 + 1);
475 + XMapWindow (obt_display, self->edgetopright);
476 +
477 + XMoveResizeWindow (obt_display, self->outertop,
478 + th,
479 + 1,
480 + ww - (th * 2),
481 + self->outer - 1);
482 + XMapWindow (obt_display, self->outertop);
483 +
484 + XMoveResizeWindow (obt_display, self->outertopleft,
485 + 0,
486 + 1,
487 + th,
488 + self->outer - 1);
489 + XMapWindow (obt_display, self->outertopleft);
490 +
491 + XMoveResizeWindow (obt_display, self->outertopright,
492 + ww - th,
493 + 1,
494 + th,
495 + self->outer - 1);
496 + XMapWindow (obt_display, self->outertopright);
497 +
498 + XMoveResizeWindow (obt_display, self->edgelefttop,
499 + 0,
500 + self->outer,
501 + 1,
502 + th);
503 + XMapWindow (obt_display, self->edgelefttop);
504 +
505 + XMoveResizeWindow (obt_display, self->outerlefttop,
506 + 1,
507 + self->outer,
508 + self->outer - 1,
509 + th);
510 + XMapWindow (obt_display, self->outerlefttop);
511 +
512 + XMoveResizeWindow (obt_display, self->edgerighttop,
513 + ww - 1,
514 + self->outer,
515 + 1,
516 + th);
517 + XMapWindow (obt_display, self->edgerighttop);
518 +
519 + XMoveResizeWindow (obt_display, self->outerrighttop,
520 + ww - self->outer,
521 + self->outer,
522 + self->outer - 1,
523 + th);
524 + XMapWindow (obt_display, self->outerrighttop);
525 +
526 + XMoveResizeWindow (obt_display, self->edgeleft,
527 + 0,
528 + th + self->outer,
529 + 1,
530 + eh - th);
531 + XMapWindow (obt_display, self->edgeleft);
532 +
533 + XMoveResizeWindow (obt_display, self->edgeleftbottom,
534 + 0,
535 + eh + self->outer,
536 + 1,
537 + th);
538 + XMapWindow (obt_display, self->edgeleftbottom);
539 +
540 + XMoveResizeWindow (obt_display, self->outerleft,
541 + 1,
542 + th + self->outer,
543 + self->outer - 1,
544 + eh - th);
545 + XMapWindow (obt_display, self->outerleft);
546 +
547 + XMoveResizeWindow (obt_display, self->outerleftbottom,
548 + 1,
549 + eh + self->outer,
550 + self->outer - 1,
551 + th);
552 + XMapWindow (obt_display, self->outerleftbottom);
553 +
554 + XMoveResizeWindow (obt_display, self->edgeright,
555 + ww - 1,
556 + th + self->outer,
557 + 1,
558 + eh - th);
559 + XMapWindow (obt_display, self->edgeright);
560 +
561 + XMoveResizeWindow (obt_display, self->edgerightbottom,
562 + ww - 1,
563 + eh + self->outer,
564 + 1,
565 + th);
566 + XMapWindow (obt_display, self->edgerightbottom);
567 +
568 + XMoveResizeWindow (obt_display, self->outerright,
569 + ww - self->outer,
570 + th + self->outer,
571 + self->outer - 1,
572 + eh - th);
573 + XMapWindow (obt_display, self->outerright);
574 +
575 + XMoveResizeWindow (obt_display, self->outerrightbottom,
576 + ww - self->outer,
577 + eh + self->outer,
578 + self->outer - 1,
579 + th);
580 + XMapWindow (obt_display, self->outerrightbottom);
581 +
582 + XMoveResizeWindow (obt_display, self->edgebottom,
583 + th,
584 + wh - 1,
585 + ww - (th * 2),
586 + 1);
587 + XMapWindow (obt_display, self->edgebottom);
588 +
589 + XMoveResizeWindow (obt_display, self->edgebottomleft,
590 + 0,
591 + wh - 1,
592 + th,
593 + 1);
594 + XMapWindow (obt_display, self->edgebottomleft);
595 +
596 + XMoveResizeWindow (obt_display, self->edgebottomright,
597 + ww - th,
598 + wh - 1,
599 + th,
600 + 1);
601 + XMapWindow (obt_display, self->edgebottomright);
602 +
603 + XMoveResizeWindow (obt_display, self->outerbottom,
604 + th,
605 + wh - self->outer,
606 + ww - (th * 2),
607 + self->outer - 1);
608 + XMapWindow (obt_display, self->outerbottom);
609 +
610 + XMoveResizeWindow (obt_display, self->outerbottomleft,
611 + 0,
612 + wh - self->outer,
613 + th,
614 + self->outer - 1);
615 + XMapWindow (obt_display, self->outerbottomleft);
616 +
617 + XMoveResizeWindow (obt_display, self->outerbottomright,
618 + ww - th,
619 + wh - self->outer,
620 + th,
621 + self->outer - 1);
622 + XMapWindow (obt_display, self->outerbottomright);
623 +
624 + XMoveResizeWindow (obt_display, self->ce_tl_t,
625 + 2,
626 + 1,
627 + 2,
628 + 1);
629 + XMapWindow (obt_display, self->ce_tl_t);
630 +
631 + XMoveResizeWindow (obt_display, self->ce_tl_l,
632 + 1,
633 + 2,
634 + 1,
635 + 2);
636 + XMapWindow (obt_display, self->ce_tl_l);
637 +
638 + XMoveResizeWindow (obt_display, self->ce_tr_t,
639 + ww - 4,
640 + 1,
641 + 2,
642 + 1);
643 + XMapWindow (obt_display, self->ce_tr_t);
644 +
645 + XMoveResizeWindow (obt_display, self->ce_tr_r,
646 + ww - 2,
647 + 2,
648 + 1,
649 + 2);
650 + XMapWindow (obt_display, self->ce_tr_r);
651 +
652 + XMoveResizeWindow (obt_display, self->ce_bl_b,
653 + 2,
654 + wh - 2,
655 + 2,
656 + 1);
657 + XMapWindow (obt_display, self->ce_bl_b);
658 +
659 + XMoveResizeWindow (obt_display, self->ce_bl_l,
660 + 1,
661 + wh - 4,
662 + 1,
663 + 2);
664 + XMapWindow (obt_display, self->ce_bl_l);
665 +
666 + XMoveResizeWindow (obt_display, self->ce_br_b,
667 + ww - 4,
668 + wh - 2,
669 + 2,
670 + 1);
671 + XMapWindow (obt_display, self->ce_br_b);
672 +
673 + XMoveResizeWindow (obt_display, self->ce_br_r,
674 + ww - 2,
675 + wh - 4,
676 + 1,
677 + 2);
678 + XMapWindow (obt_display, self->ce_br_r);
679 +
680 + }
681 + else
682 + {
683 + XUnmapWindow (obt_display, self->outertop);
684 + XUnmapWindow (obt_display, self->outerlefttop);
685 + XUnmapWindow (obt_display, self->outerrighttop);
686 + XUnmapWindow (obt_display, self->outerleftbottom);
687 + XUnmapWindow (obt_display, self->outerrightbottom);
688 + XUnmapWindow (obt_display, self->outertopleft);
689 + XUnmapWindow (obt_display, self->outertopright);
690 + XUnmapWindow (obt_display, self->outerbottomleft);
691 + XUnmapWindow (obt_display, self->outerbottomright);
692 + XUnmapWindow (obt_display, self->outerleft);
693 + XUnmapWindow (obt_display, self->outerright);
694 + XUnmapWindow (obt_display, self->outerbottom);
695 + XUnmapWindow (obt_display, self->edgetop);
696 + XUnmapWindow (obt_display, self->edgelefttop);
697 + XUnmapWindow (obt_display, self->edgerighttop);
698 + XUnmapWindow (obt_display, self->edgeleftbottom);
699 + XUnmapWindow (obt_display, self->edgerightbottom);
700 + XUnmapWindow (obt_display, self->edgetopleft);
701 + XUnmapWindow (obt_display, self->edgetopright);
702 + XUnmapWindow (obt_display, self->edgebottomleft);
703 + XUnmapWindow (obt_display, self->edgebottomright);
704 + XUnmapWindow (obt_display, self->edgeleft);
705 + XUnmapWindow (obt_display, self->edgeright);
706 + XUnmapWindow (obt_display, self->edgebottom);
707 + XUnmapWindow (obt_display, self->ce_tl_t);
708 + XUnmapWindow (obt_display, self->ce_tl_l);
709 + XUnmapWindow (obt_display, self->ce_tr_t);
710 + XUnmapWindow (obt_display, self->ce_tr_r);
711 + XUnmapWindow (obt_display, self->ce_bl_b);
712 + XUnmapWindow (obt_display, self->ce_bl_l);
713 + XUnmapWindow (obt_display, self->ce_br_b);
714 + XUnmapWindow (obt_display, self->ce_br_r);
715 + }
716 +
717 XMoveResizeWindow(obt_display, self->backback,
718 self->size.left, self->size.top,
719 self->client->area.width,
720 @@ -834,6 +1301,66 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
721 frame_client_gravity(self, &self->area.x, &self->area.y);
722 }
724 + /* the invisible handles - can only set after applying gravity */
725 + if (config_theme_invhandles && !moving)
726 + {
727 + XMoveResizeWindow(obt_display, self->invleft,
728 + self->area.x - INV_WIDTH,
729 + self->area.y,
730 + INV_WIDTH,
731 + self->area.height);
732 + XMapWindow (obt_display, self->invleft);
733 +
734 + XMoveResizeWindow(obt_display, self->invright,
735 + self->area.x + self->area.width,
736 + self->area.y,
737 + INV_WIDTH,
738 + self->area.height);
739 + XMapWindow (obt_display, self->invright);
740 +
741 + XMoveResizeWindow(obt_display, self->invtop,
742 + self->area.x,
743 + self->area.y - INV_WIDTH,
744 + self->area.width,
745 + INV_WIDTH);
746 + XMapWindow (obt_display, self->invtop);
747 +
748 + XMoveResizeWindow(obt_display, self->invbottom,
749 + self->area.x,
750 + self->area.y + self->area.height,
751 + self->area.width,
752 + INV_WIDTH);
753 + XMapWindow (obt_display, self->invbottom);
754 +
755 + XMoveResizeWindow(obt_display, self->invtl,
756 + self->area.x - INV_WIDTH,
757 + self->area.y - INV_WIDTH,
758 + INV_WIDTH,
759 + INV_WIDTH);
760 + XMapWindow (obt_display, self->invtl);
761 +
762 + XMoveResizeWindow(obt_display, self->invtr,
763 + self->area.x + self->area.width,
764 + self->area.y - INV_WIDTH,
765 + INV_WIDTH,
766 + INV_WIDTH);
767 + XMapWindow (obt_display, self->invtr);
768 +
769 + XMoveResizeWindow(obt_display, self->invbl,
770 + self->area.x - INV_WIDTH,
771 + self->area.y + self->area.height,
772 + INV_WIDTH,
773 + INV_WIDTH);
774 + XMapWindow (obt_display, self->invbl);
775 +
776 + XMoveResizeWindow(obt_display, self->invbr,
777 + self->area.x + self->area.width,
778 + self->area.y + self->area.height,
779 + INV_WIDTH,
780 + INV_WIDTH);
781 + XMapWindow (obt_display, self->invbr);
782 + }
783 +
784 if (!fake) {
785 if (!frame_iconify_animating(self))
786 /* move and resize the top level frame.
787 @@ -845,8 +1372,8 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
788 XMoveResizeWindow(obt_display, self->window,
789 self->area.x,
790 self->area.y,
791 - self->area.width,
792 - self->area.height);
793 + self->area.width + self->outer,
794 + self->area.height + self->outer);
796 /* when the client has StaticGravity, it likes to move around.
797 also this correctly positions the client when it maps.
798 @@ -906,11 +1433,17 @@ static void frame_adjust_cursors(ObFrame *self)
799 OB_CURSOR_NORTH : OB_CURSOR_NONE);
800 XChangeWindowAttributes(obt_display, self->topresize, CWCursor, &a);
801 XChangeWindowAttributes(obt_display, self->titletop, CWCursor, &a);
802 + XChangeWindowAttributes(obt_display, self->outertop, CWCursor, &a);
803 + XChangeWindowAttributes(obt_display, self->edgetop, CWCursor, &a);
804 + XChangeWindowAttributes(obt_display, self->invtop, CWCursor, &a);
805 a.cursor = ob_cursor(r && topbot ? OB_CURSOR_SOUTH : OB_CURSOR_NONE);
806 XChangeWindowAttributes(obt_display, self->handle, CWCursor, &a);
807 XChangeWindowAttributes(obt_display, self->handletop, CWCursor, &a);
808 XChangeWindowAttributes(obt_display, self->handlebottom, CWCursor, &a);
809 XChangeWindowAttributes(obt_display, self->innerbottom, CWCursor, &a);
810 + XChangeWindowAttributes(obt_display, self->outerbottom, CWCursor, &a);
811 + XChangeWindowAttributes(obt_display, self->edgebottom, CWCursor, &a);
812 + XChangeWindowAttributes(obt_display, self->invbottom, CWCursor, &a);
814 /* these ones change when shaded */
815 a.cursor = ob_cursor(r ? (sh ? OB_CURSOR_WEST : OB_CURSOR_NORTHWEST) :
816 @@ -919,18 +1452,38 @@ static void frame_adjust_cursors(ObFrame *self)
817 XChangeWindowAttributes(obt_display, self->tltresize, CWCursor, &a);
818 XChangeWindowAttributes(obt_display, self->tllresize, CWCursor, &a);
819 XChangeWindowAttributes(obt_display, self->titletopleft, CWCursor, &a);
820 + XChangeWindowAttributes(obt_display, self->edgelefttop, CWCursor, &a);
821 + XChangeWindowAttributes(obt_display, self->edgetopleft, CWCursor, &a);
822 + XChangeWindowAttributes(obt_display, self->outerlefttop, CWCursor, &a);
823 + XChangeWindowAttributes(obt_display, self->outertopleft, CWCursor, &a);
824 + XChangeWindowAttributes(obt_display, self->invtl, CWCursor, &a);
825 + XChangeWindowAttributes(obt_display, self->ce_tl_t, CWCursor, &a);
826 + XChangeWindowAttributes(obt_display, self->ce_tl_l, CWCursor, &a);
827 a.cursor = ob_cursor(r ? (sh ? OB_CURSOR_EAST : OB_CURSOR_NORTHEAST) :
828 OB_CURSOR_NONE);
829 XChangeWindowAttributes(obt_display, self->titleright, CWCursor, &a);
830 XChangeWindowAttributes(obt_display, self->trtresize, CWCursor, &a);
831 XChangeWindowAttributes(obt_display, self->trrresize, CWCursor, &a);
832 XChangeWindowAttributes(obt_display, self->titletopright, CWCursor,&a);
833 + XChangeWindowAttributes(obt_display, self->edgerighttop, CWCursor, &a);
834 + XChangeWindowAttributes(obt_display, self->edgetopright, CWCursor, &a);
835 + XChangeWindowAttributes(obt_display, self->outerrighttop, CWCursor, &a);
836 + XChangeWindowAttributes(obt_display, self->outertopright, CWCursor, &a);
837 + XChangeWindowAttributes(obt_display, self->invtr, CWCursor, &a);
838 + XChangeWindowAttributes(obt_display, self->ce_tr_t, CWCursor, &a);
839 + XChangeWindowAttributes(obt_display, self->ce_tr_r, CWCursor, &a);
841 /* these ones are pretty static */
842 a.cursor = ob_cursor(r ? OB_CURSOR_WEST : OB_CURSOR_NONE);
843 + XChangeWindowAttributes(obt_display, self->outerleft, CWCursor, &a);
844 + XChangeWindowAttributes(obt_display, self->edgeleft, CWCursor, &a);
845 + XChangeWindowAttributes(obt_display, self->invleft, CWCursor, &a);
846 XChangeWindowAttributes(obt_display, self->left, CWCursor, &a);
847 XChangeWindowAttributes(obt_display, self->innerleft, CWCursor, &a);
848 a.cursor = ob_cursor(r ? OB_CURSOR_EAST : OB_CURSOR_NONE);
849 + XChangeWindowAttributes(obt_display, self->outerright, CWCursor, &a);
850 + XChangeWindowAttributes(obt_display, self->edgeright, CWCursor, &a);
851 + XChangeWindowAttributes(obt_display, self->invright, CWCursor, &a);
852 XChangeWindowAttributes(obt_display, self->right, CWCursor, &a);
853 XChangeWindowAttributes(obt_display, self->innerright, CWCursor, &a);
854 a.cursor = ob_cursor(r ? OB_CURSOR_SOUTHWEST : OB_CURSOR_NONE);
855 @@ -941,6 +1494,13 @@ static void frame_adjust_cursors(ObFrame *self)
856 XChangeWindowAttributes(obt_display, self->lgripbottom, CWCursor, &a);
857 XChangeWindowAttributes(obt_display, self->innerbll, CWCursor, &a);
858 XChangeWindowAttributes(obt_display, self->innerblb, CWCursor, &a);
859 + XChangeWindowAttributes(obt_display, self->ce_bl_b, CWCursor, &a);
860 + XChangeWindowAttributes(obt_display, self->ce_bl_l, CWCursor, &a);
861 + XChangeWindowAttributes(obt_display, self->edgeleftbottom, CWCursor, &a);
862 + XChangeWindowAttributes(obt_display, self->edgebottomleft, CWCursor, &a);
863 + XChangeWindowAttributes(obt_display, self->outerleftbottom, CWCursor, &a);
864 + XChangeWindowAttributes(obt_display, self->outerbottomleft, CWCursor, &a);
865 + XChangeWindowAttributes(obt_display, self->invbl, CWCursor, &a);
866 a.cursor = ob_cursor(r ? OB_CURSOR_SOUTHEAST : OB_CURSOR_NONE);
867 XChangeWindowAttributes(obt_display, self->rgrip, CWCursor, &a);
868 XChangeWindowAttributes(obt_display, self->handleright, CWCursor, &a);
869 @@ -949,6 +1509,13 @@ static void frame_adjust_cursors(ObFrame *self)
870 XChangeWindowAttributes(obt_display, self->rgripbottom, CWCursor, &a);
871 XChangeWindowAttributes(obt_display, self->innerbrr, CWCursor, &a);
872 XChangeWindowAttributes(obt_display, self->innerbrb, CWCursor, &a);
873 + XChangeWindowAttributes(obt_display, self->ce_br_b, CWCursor, &a);
874 + XChangeWindowAttributes(obt_display, self->ce_br_r, CWCursor, &a);
875 + XChangeWindowAttributes(obt_display, self->edgerightbottom, CWCursor, &a);
876 + XChangeWindowAttributes(obt_display, self->edgebottomright, CWCursor, &a);
877 + XChangeWindowAttributes(obt_display, self->outerrightbottom, CWCursor, &a);
878 + XChangeWindowAttributes(obt_display, self->outerbottomright, CWCursor, &a);
879 + XChangeWindowAttributes(obt_display, self->invbr, CWCursor, &a);
880 }
881 }
883 @@ -958,6 +1525,8 @@ void frame_adjust_client_area(ObFrame *self)
884 XMoveResizeWindow(obt_display, self->backfront, 0, 0,
885 self->client->area.width,
886 self->client->area.height);
887 + self->need_render = TRUE;
888 + framerender_frame(self);
889 }
891 void frame_adjust_state(ObFrame *self)
892 @@ -974,6 +1543,31 @@ void frame_adjust_focus(ObFrame *self, gboolean hilite)
893 self->focused = hilite;
894 self->need_render = TRUE;
895 framerender_frame(self);
896 + if (config_theme_invhandles)
897 + {
898 + if (self->focused)
899 + {
900 + XMapWindow (obt_display, self->invleft);
901 + XMapWindow (obt_display, self->invright);
902 + XMapWindow (obt_display, self->invtop);
903 + XMapWindow (obt_display, self->invbottom);
904 + XMapWindow (obt_display, self->invtl);
905 + XMapWindow (obt_display, self->invtr);
906 + XMapWindow (obt_display, self->invbl);
907 + XMapWindow (obt_display, self->invbr);
908 + }
909 + else
910 + {
911 + XUnmapWindow (obt_display, self->invleft);
912 + XUnmapWindow (obt_display, self->invright);
913 + XUnmapWindow (obt_display, self->invtop);
914 + XUnmapWindow (obt_display, self->invbottom);
915 + XUnmapWindow (obt_display, self->invtl);
916 + XUnmapWindow (obt_display, self->invtr);
917 + XUnmapWindow (obt_display, self->invbl);
918 + XUnmapWindow (obt_display, self->invbr);
919 + }
920 + }
921 XFlush(obt_display);
922 }
924 @@ -1058,6 +1652,49 @@ void frame_grab_client(ObFrame *self)
925 window_add(&self->rgripright, CLIENT_AS_WINDOW(self->client));
926 window_add(&self->rgriptop, CLIENT_AS_WINDOW(self->client));
927 window_add(&self->rgripbottom, CLIENT_AS_WINDOW(self->client));
928 + window_add(&self->outerleft, CLIENT_AS_WINDOW(self->client));
929 + window_add(&self->outerright, CLIENT_AS_WINDOW(self->client));
930 + window_add(&self->outertop, CLIENT_AS_WINDOW(self->client));
931 + window_add(&self->outerbottom, CLIENT_AS_WINDOW(self->client));
932 + window_add(&self->outerlefttop, CLIENT_AS_WINDOW(self->client));
933 + window_add(&self->outerrighttop, CLIENT_AS_WINDOW(self->client));
934 + window_add(&self->outerleftbottom, CLIENT_AS_WINDOW(self->client));
935 + window_add(&self->outerrightbottom, CLIENT_AS_WINDOW(self->client));
936 + window_add(&self->outertopleft, CLIENT_AS_WINDOW(self->client));
937 + window_add(&self->outertopright, CLIENT_AS_WINDOW(self->client));
938 + window_add(&self->outerbottomleft, CLIENT_AS_WINDOW(self->client));
939 + window_add(&self->outerbottomright, CLIENT_AS_WINDOW(self->client));
940 + window_add(&self->edgeleft, CLIENT_AS_WINDOW(self->client));
941 + window_add(&self->edgeright, CLIENT_AS_WINDOW(self->client));
942 + window_add(&self->edgetop, CLIENT_AS_WINDOW(self->client));
943 + window_add(&self->edgebottom, CLIENT_AS_WINDOW(self->client));
944 + window_add(&self->edgelefttop, CLIENT_AS_WINDOW(self->client));
945 + window_add(&self->edgerighttop, CLIENT_AS_WINDOW(self->client));
946 + window_add(&self->edgeleftbottom, CLIENT_AS_WINDOW(self->client));
947 + window_add(&self->edgerightbottom, CLIENT_AS_WINDOW(self->client));
948 + window_add(&self->edgetopleft, CLIENT_AS_WINDOW(self->client));
949 + window_add(&self->edgetopright, CLIENT_AS_WINDOW(self->client));
950 + window_add(&self->edgebottomleft, CLIENT_AS_WINDOW(self->client));
951 + window_add(&self->edgebottomright, CLIENT_AS_WINDOW(self->client));
952 + window_add(&self->ce_tl_t, CLIENT_AS_WINDOW(self->client));
953 + window_add(&self->ce_tl_l, CLIENT_AS_WINDOW(self->client));
954 + window_add(&self->ce_tr_t, CLIENT_AS_WINDOW(self->client));
955 + window_add(&self->ce_tr_r, CLIENT_AS_WINDOW(self->client));
956 + window_add(&self->ce_bl_b, CLIENT_AS_WINDOW(self->client));
957 + window_add(&self->ce_bl_l, CLIENT_AS_WINDOW(self->client));
958 + window_add(&self->ce_br_b, CLIENT_AS_WINDOW(self->client));
959 + window_add(&self->ce_br_r, CLIENT_AS_WINDOW(self->client));
960 + if (config_theme_invhandles)
961 + {
962 + window_add(&self->invleft, CLIENT_AS_WINDOW(self->client));
963 + window_add(&self->invright, CLIENT_AS_WINDOW(self->client));
964 + window_add(&self->invtop, CLIENT_AS_WINDOW(self->client));
965 + window_add(&self->invbottom, CLIENT_AS_WINDOW(self->client));
966 + window_add(&self->invtl, CLIENT_AS_WINDOW(self->client));
967 + window_add(&self->invtr, CLIENT_AS_WINDOW(self->client));
968 + window_add(&self->invbl, CLIENT_AS_WINDOW(self->client));
969 + window_add(&self->invbr, CLIENT_AS_WINDOW(self->client));
970 + }
971 }
973 static gboolean find_reparent(XEvent *e, gpointer data)
974 @@ -1130,6 +1767,49 @@ void frame_release_client(ObFrame *self)
975 window_remove(self->rgripright);
976 window_remove(self->rgriptop);
977 window_remove(self->rgripbottom);
978 + window_remove(self->outerleft);
979 + window_remove(self->outerright);
980 + window_remove(self->outertop);
981 + window_remove(self->outerbottom);
982 + window_remove(self->outerlefttop);
983 + window_remove(self->outerrighttop);
984 + window_remove(self->outerleftbottom);
985 + window_remove(self->outerrightbottom);
986 + window_remove(self->outertopleft);
987 + window_remove(self->outertopright);
988 + window_remove(self->outerbottomleft);
989 + window_remove(self->outerbottomright);
990 + window_remove(self->edgeleft);
991 + window_remove(self->edgeright);
992 + window_remove(self->edgetop);
993 + window_remove(self->edgebottom);
994 + window_remove(self->edgelefttop);
995 + window_remove(self->edgerighttop);
996 + window_remove(self->edgeleftbottom);
997 + window_remove(self->edgerightbottom);
998 + window_remove(self->edgetopleft);
999 + window_remove(self->edgetopright);
1000 + window_remove(self->edgebottomleft);
1001 + window_remove(self->edgebottomright);
1002 + window_remove(self->ce_tl_t);
1003 + window_remove(self->ce_tl_l);
1004 + window_remove(self->ce_tr_t);
1005 + window_remove(self->ce_tr_r);
1006 + window_remove(self->ce_bl_b);
1007 + window_remove(self->ce_bl_l);
1008 + window_remove(self->ce_br_b);
1009 + window_remove(self->ce_br_r);
1010 + if (config_theme_invhandles)
1011 + {
1012 + window_remove(self->invleft);
1013 + window_remove(self->invright);
1014 + window_remove(self->invtop);
1015 + window_remove(self->invbottom);
1016 + window_remove(self->invtl);
1017 + window_remove(self->invtr);
1018 + window_remove(self->invbl);
1019 + window_remove(self->invbr);
1020 + }
1022 if (self->flash_timer) g_source_remove(self->flash_timer);
1023 }
1024 @@ -1188,6 +1868,8 @@ static void layout_title(ObFrame *self)
1025 /* position of the rightmost button */
1026 const gint right = self->width;
1028 + int leftoff, rightoff;
1029 +
1030 /* turn them all off */
1031 self->icon_on = self->desk_on = self->shade_on = self->iconify_on =
1032 self->max_on = self->close_on = self->label_on = FALSE;
1033 @@ -1220,7 +1902,9 @@ static void layout_title(ObFrame *self)
1034 if (i > 0) {
1035 self->label_on = TRUE;
1036 self->label_x = x;
1037 + leftoff = x - left;
1038 }
1039 + else rightoff = right - x;
1040 break; /* break the for loop, do other side of label */
1041 } else if (*lc == 'N') {
1042 if (firstcon) *firstcon = OB_FRAME_CONTEXT_ICON;
1043 @@ -1247,6 +1931,20 @@ static void layout_title(ObFrame *self)
1044 }
1045 }
1047 + /* centre text... */
1048 + if (ob_rr_theme->a_focused_label->texture[0].data.text.justify == RR_JUSTIFY_CENTER)
1049 + {
1050 + if (leftoff > rightoff)
1051 + {
1052 + self->label_width -= (leftoff - rightoff);
1053 + }
1054 + else if (rightoff > leftoff)
1055 + {
1056 + self->label_x += (rightoff - leftoff);
1057 + self->label_width -= (rightoff - leftoff);
1058 + }
1059 + }
1060 +
1061 /* position and map the elements */
1062 if (self->icon_on) {
1063 XMapWindow(obt_display, self->icon);
1064 @@ -1484,16 +2182,30 @@ ObFrameContext frame_context(ObClient *client, Window win, gint x, gint y)
1065 if (win == self->handle) return OB_FRAME_CONTEXT_BOTTOM;
1066 if (win == self->handletop) return OB_FRAME_CONTEXT_BOTTOM;
1067 if (win == self->handlebottom) return OB_FRAME_CONTEXT_BOTTOM;
1068 + if (win == self->outerbottom) return OB_FRAME_CONTEXT_BOTTOM;
1069 + if (win == self->edgebottom) return OB_FRAME_CONTEXT_BOTTOM;
1070 if (win == self->handleleft) return OB_FRAME_CONTEXT_BLCORNER;
1071 if (win == self->lgrip) return OB_FRAME_CONTEXT_BLCORNER;
1072 if (win == self->lgripleft) return OB_FRAME_CONTEXT_BLCORNER;
1073 if (win == self->lgriptop) return OB_FRAME_CONTEXT_BLCORNER;
1074 if (win == self->lgripbottom) return OB_FRAME_CONTEXT_BLCORNER;
1075 + if (win == self->ce_bl_b) return OB_FRAME_CONTEXT_BLCORNER;
1076 + if (win == self->ce_bl_l) return OB_FRAME_CONTEXT_BLCORNER;
1077 + if (win == self->outerleftbottom) return OB_FRAME_CONTEXT_BLCORNER;
1078 + if (win == self->edgeleftbottom) return OB_FRAME_CONTEXT_BLCORNER;
1079 + if (win == self->outerbottomleft) return OB_FRAME_CONTEXT_BLCORNER;
1080 + if (win == self->edgebottomleft) return OB_FRAME_CONTEXT_BLCORNER;
1081 if (win == self->handleright) return OB_FRAME_CONTEXT_BRCORNER;
1082 if (win == self->rgrip) return OB_FRAME_CONTEXT_BRCORNER;
1083 if (win == self->rgripright) return OB_FRAME_CONTEXT_BRCORNER;
1084 if (win == self->rgriptop) return OB_FRAME_CONTEXT_BRCORNER;
1085 if (win == self->rgripbottom) return OB_FRAME_CONTEXT_BRCORNER;
1086 + if (win == self->ce_br_b) return OB_FRAME_CONTEXT_BRCORNER;
1087 + if (win == self->ce_br_r) return OB_FRAME_CONTEXT_BRCORNER;
1088 + if (win == self->outerrightbottom) return OB_FRAME_CONTEXT_BRCORNER;
1089 + if (win == self->edgerightbottom) return OB_FRAME_CONTEXT_BRCORNER;
1090 + if (win == self->outerbottomright) return OB_FRAME_CONTEXT_BRCORNER;
1091 + if (win == self->edgebottomright) return OB_FRAME_CONTEXT_BRCORNER;
1092 if (win == self->title) return OB_FRAME_CONTEXT_TITLEBAR;
1093 if (win == self->titlebottom) return OB_FRAME_CONTEXT_TITLEBAR;
1094 if (win == self->titleleft) return OB_FRAME_CONTEXT_TLCORNER;
1095 @@ -1502,26 +2214,56 @@ ObFrameContext frame_context(ObClient *client, Window win, gint x, gint y)
1096 if (win == self->titletopright) return OB_FRAME_CONTEXT_TRCORNER;
1097 if (win == self->titletop) return OB_FRAME_CONTEXT_TOP;
1098 if (win == self->topresize) return OB_FRAME_CONTEXT_TOP;
1099 + if (win == self->outertop) return OB_FRAME_CONTEXT_TOP;
1100 + if (win == self->edgetop) return OB_FRAME_CONTEXT_TOP;
1101 if (win == self->tltresize) return OB_FRAME_CONTEXT_TLCORNER;
1102 if (win == self->tllresize) return OB_FRAME_CONTEXT_TLCORNER;
1103 + if (win == self->ce_tl_t) return OB_FRAME_CONTEXT_TLCORNER;
1104 + if (win == self->ce_tl_l) return OB_FRAME_CONTEXT_TLCORNER;
1105 + if (win == self->outerlefttop) return OB_FRAME_CONTEXT_TLCORNER;
1106 + if (win == self->edgelefttop) return OB_FRAME_CONTEXT_TLCORNER;
1107 + if (win == self->outertopleft) return OB_FRAME_CONTEXT_TLCORNER;
1108 + if (win == self->edgetopleft) return OB_FRAME_CONTEXT_TLCORNER;
1109 if (win == self->trtresize) return OB_FRAME_CONTEXT_TRCORNER;
1110 if (win == self->trrresize) return OB_FRAME_CONTEXT_TRCORNER;
1111 + if (win == self->ce_tr_t) return OB_FRAME_CONTEXT_TRCORNER;
1112 + if (win == self->ce_tr_r) return OB_FRAME_CONTEXT_TRCORNER;
1113 + if (win == self->outerrighttop) return OB_FRAME_CONTEXT_TRCORNER;
1114 + if (win == self->edgerighttop) return OB_FRAME_CONTEXT_TRCORNER;
1115 + if (win == self->outertopright) return OB_FRAME_CONTEXT_TRCORNER;
1116 + if (win == self->edgetopright) return OB_FRAME_CONTEXT_TRCORNER;
1117 if (win == self->left) return OB_FRAME_CONTEXT_LEFT;
1118 + if (win == self->outerleft) return OB_FRAME_CONTEXT_LEFT;
1119 + if (win == self->edgeleft) return OB_FRAME_CONTEXT_LEFT;
1120 if (win == self->right) return OB_FRAME_CONTEXT_RIGHT;
1121 + if (win == self->outerright) return OB_FRAME_CONTEXT_RIGHT;
1122 + if (win == self->edgeright) return OB_FRAME_CONTEXT_RIGHT;
1123 if (win == self->innertop) return OB_FRAME_CONTEXT_TITLEBAR;
1124 if (win == self->innerleft) return OB_FRAME_CONTEXT_LEFT;
1125 if (win == self->innerbottom) return OB_FRAME_CONTEXT_BOTTOM;
1126 if (win == self->innerright) return OB_FRAME_CONTEXT_RIGHT;
1127 if (win == self->innerbll) return OB_FRAME_CONTEXT_BLCORNER;
1128 if (win == self->innerblb) return OB_FRAME_CONTEXT_BLCORNER;
1129 + if (win == self->ce_bl_b) return OB_FRAME_CONTEXT_BLCORNER;
1130 + if (win == self->ce_bl_l) return OB_FRAME_CONTEXT_BLCORNER;
1131 if (win == self->innerbrr) return OB_FRAME_CONTEXT_BRCORNER;
1132 if (win == self->innerbrb) return OB_FRAME_CONTEXT_BRCORNER;
1133 + if (win == self->ce_br_b) return OB_FRAME_CONTEXT_BRCORNER;
1134 + if (win == self->ce_br_r) return OB_FRAME_CONTEXT_BRCORNER;
1135 if (win == self->max) return OB_FRAME_CONTEXT_MAXIMIZE;
1136 if (win == self->iconify) return OB_FRAME_CONTEXT_ICONIFY;
1137 if (win == self->close) return OB_FRAME_CONTEXT_CLOSE;
1138 if (win == self->icon) return OB_FRAME_CONTEXT_ICON;
1139 if (win == self->desk) return OB_FRAME_CONTEXT_ALLDESKTOPS;
1140 if (win == self->shade) return OB_FRAME_CONTEXT_SHADE;
1141 + if (win == self->invleft) return OB_FRAME_CONTEXT_LEFT;
1142 + if (win == self->invright) return OB_FRAME_CONTEXT_RIGHT;
1143 + if (win == self->invtop) return OB_FRAME_CONTEXT_TOP;
1144 + if (win == self->invbottom) return OB_FRAME_CONTEXT_BOTTOM;
1145 + if (win == self->invtl) return OB_FRAME_CONTEXT_TLCORNER;
1146 + if (win == self->invtr) return OB_FRAME_CONTEXT_TRCORNER;
1147 + if (win == self->invbl) return OB_FRAME_CONTEXT_BLCORNER;
1148 + if (win == self->invbr) return OB_FRAME_CONTEXT_BRCORNER;
1150 return OB_FRAME_CONTEXT_NONE;
1151 }
1152 diff --git a/openbox/frame.h b/openbox/frame.h
1153 index 915c08d..2e11b53 100644
1154 --- a/openbox/frame.h
1155 +++ b/openbox/frame.h
1156 @@ -143,6 +143,50 @@ struct _ObFrame
1157 Window trtresize;
1158 Window trrresize;
1160 + Window outerleft;
1161 + Window outerright;
1162 + Window outertop;
1163 + Window outerbottom;
1164 + Window outerlefttop;
1165 + Window outerrighttop;
1166 + Window outerleftbottom;
1167 + Window outerrightbottom;
1168 + Window outertopleft;
1169 + Window outertopright;
1170 + Window outerbottomleft;
1171 + Window outerbottomright;
1172 +
1173 + Window edgeleft;
1174 + Window edgeright;
1175 + Window edgetop;
1176 + Window edgebottom;
1177 + Window edgelefttop;
1178 + Window edgerighttop;
1179 + Window edgeleftbottom;
1180 + Window edgerightbottom;
1181 + Window edgetopleft;
1182 + Window edgetopright;
1183 + Window edgebottomleft;
1184 + Window edgebottomright;
1185 +
1186 + Window ce_tl_t;
1187 + Window ce_tl_l;
1188 + Window ce_tr_t;
1189 + Window ce_tr_r;
1190 + Window ce_bl_b;
1191 + Window ce_bl_l;
1192 + Window ce_br_b;
1193 + Window ce_br_r;
1194 +
1195 + Window invleft;
1196 + Window invright;
1197 + Window invtop;
1198 + Window invbottom;
1199 + Window invtl;
1200 + Window invtr;
1201 + Window invbl;
1202 + Window invbr;
1203 +
1204 Colormap colormap;
1206 gint icon_on; /* if the window icon button is on */
1207 @@ -167,6 +211,7 @@ struct _ObFrame
1208 gint cbwidth_t; /* client border width */
1209 gint cbwidth_r; /* client border width */
1210 gint cbwidth_b; /* client border width */
1211 + gint outer; /* width of outer border used for rounded corners */
1212 gboolean max_horz; /* when maxed some decorations are hidden */
1213 gboolean max_vert; /* when maxed some decorations are hidden */
1214 gboolean shaded; /* decorations adjust when shaded */
1215 @@ -267,6 +312,9 @@ void frame_flash_stop(ObFrame *self);
1216 void frame_begin_iconify_animation(ObFrame *self, gboolean iconifying);
1217 void frame_end_iconify_animation(gpointer data);
1219 +void frame_remove_handles (struct _ObClient *self);
1220 +void frame_restore_handles (struct _ObClient *self);
1221 +
1222 #define frame_iconify_animating(f) (f->iconify_animation_going != 0)
1224 #endif
1225 diff --git a/openbox/framerender.c b/openbox/framerender.c
1226 index 041e6d1..5221431 100644
1227 --- a/openbox/framerender.c
1228 +++ b/openbox/framerender.c
1229 @@ -21,6 +21,7 @@
1230 #include "openbox.h"
1231 #include "screen.h"
1232 #include "client.h"
1233 +#include "config.h"
1234 #include "framerender.h"
1235 #include "obrender/theme.h"
1237 @@ -43,6 +44,37 @@ void framerender_frame(ObFrame *self)
1238 self->need_render = FALSE;
1240 {
1241 + if ((self->decorations & OB_FRAME_DECOR_TITLEBAR) && !self->max_horz && !self->max_vert && config_theme_roundcorners)
1242 + {
1243 + XGCValues xgcv;
1244 + XWindowAttributes wd_att;
1245 + XGetWindowAttributes (obt_display, self->window, &wd_att);
1246 + Pixmap mask = XCreatePixmap (obt_display, self->window, wd_att.width, wd_att.height, 1);
1247 + GC shape_gc = XCreateGC (obt_display, mask, 0, &xgcv);
1248 + XSetForeground (obt_display, shape_gc, 1);
1249 + XFillRectangle (obt_display, mask, shape_gc, 0, 0, wd_att.width, wd_att.height);
1250 + XSetForeground (obt_display, shape_gc, 0);
1251 +
1252 + XFillRectangle (obt_display, mask, shape_gc, 0, 0, 2, 2);
1253 + XFillRectangle (obt_display, mask, shape_gc, 2, 0, 2, 1);
1254 + XFillRectangle (obt_display, mask, shape_gc, 0, 2, 1, 2);
1255 +
1256 + XFillRectangle (obt_display, mask, shape_gc, 0, wd_att.height - 2, 2, 2);
1257 + XFillRectangle (obt_display, mask, shape_gc, 2, wd_att.height - 1, 2, 1);
1258 + XFillRectangle (obt_display, mask, shape_gc, 0, wd_att.height - 4, 1, 2);
1259 +
1260 + XFillRectangle (obt_display, mask, shape_gc, wd_att.width - 2, 0, 2, 2);
1261 + XFillRectangle (obt_display, mask, shape_gc, wd_att.width - 4, 0, 2, 1);
1262 + XFillRectangle (obt_display, mask, shape_gc, wd_att.width - 1, 2, 1, 2);
1263 +
1264 + XFillRectangle (obt_display, mask, shape_gc, wd_att.width - 2, wd_att.height - 2, 2, 2);
1265 + XFillRectangle (obt_display, mask, shape_gc, wd_att.width - 4, wd_att.height - 1, 2, 1);
1266 + XFillRectangle (obt_display, mask, shape_gc, wd_att.width - 1, wd_att.height - 4, 1, 2);
1267 +
1268 + XShapeCombineMask (obt_display, self->window, ShapeBounding, 0, 0, mask, ShapeSet);
1269 + XFreePixmap (obt_display, mask);
1270 + }
1271 +
1272 gulong px;
1274 px = (self->focused ?
1275 @@ -123,6 +155,88 @@ void framerender_frame(ObFrame *self)
1277 XSetWindowBackground(obt_display, self->titlebottom, px);
1278 XClearWindow(obt_display, self->titlebottom);
1279 +
1280 + px = (self->focused ?
1281 + RrColorPixel (ob_rr_theme->a_focused_title->surface.primary) :
1282 + RrColorPixel (ob_rr_theme->a_unfocused_title->surface.primary));
1283 +
1284 + XSetWindowBackground(obt_display, self->outertop, px);
1285 + XClearWindow(obt_display, self->outertop);
1286 + XSetWindowBackground(obt_display, self->outerlefttop, px);
1287 + XClearWindow(obt_display, self->outerlefttop);
1288 + XSetWindowBackground(obt_display, self->outerrighttop, px);
1289 + XClearWindow(obt_display, self->outerrighttop);
1290 + XSetWindowBackground(obt_display, self->outertopleft, px);
1291 + XClearWindow(obt_display, self->outertopleft);
1292 + XSetWindowBackground(obt_display, self->outertopright, px);
1293 + XClearWindow(obt_display, self->outertopright);
1294 +
1295 + px = (self->focused ?
1296 + RrColorPixel(ob_rr_theme->cb_focused_color) :
1297 + RrColorPixel(ob_rr_theme->cb_unfocused_color));
1298 +
1299 + XSetWindowBackground(obt_display, self->outerleft, px);
1300 + XClearWindow(obt_display, self->outerleft);
1301 + XSetWindowBackground(obt_display, self->outerright, px);
1302 + XClearWindow(obt_display, self->outerright);
1303 + XSetWindowBackground(obt_display, self->outerbottom, px);
1304 + XClearWindow(obt_display, self->outerbottom);
1305 + XSetWindowBackground(obt_display, self->outerleftbottom, px);
1306 + XClearWindow(obt_display, self->outerleftbottom);
1307 + XSetWindowBackground(obt_display, self->outerrightbottom, px);
1308 + XClearWindow(obt_display, self->outerrightbottom);
1309 + XSetWindowBackground(obt_display, self->outerbottomleft, px);
1310 + XClearWindow(obt_display, self->outerbottomleft);
1311 + XSetWindowBackground(obt_display, self->outerbottomright, px);
1312 + XClearWindow(obt_display, self->outerbottomright);
1313 +
1314 + px = RrColorPixel (ob_rr_theme->frame_focused_border_color);
1315 +
1316 + XSetWindowBackground(obt_display, self->edgeleft, px);
1317 + XClearWindow(obt_display, self->edgeleft);
1318 + XSetWindowBackground(obt_display, self->edgeright, px);
1319 + XClearWindow(obt_display, self->edgeright);
1320 + XSetWindowBackground(obt_display, self->edgebottom, px);
1321 + XClearWindow(obt_display, self->edgebottom);
1322 + XSetWindowBackground(obt_display, self->edgebottomleft, px);
1323 + XClearWindow(obt_display, self->edgebottomleft);
1324 + XSetWindowBackground(obt_display, self->edgebottomright, px);
1325 + XClearWindow(obt_display, self->edgebottomright);
1326 + XSetWindowBackground(obt_display, self->edgeleftbottom, px);
1327 + XClearWindow(obt_display, self->edgeleftbottom);
1328 + XSetWindowBackground(obt_display, self->edgerightbottom, px);
1329 + XClearWindow(obt_display, self->edgerightbottom);
1330 + XSetWindowBackground(obt_display, self->ce_bl_b, px);
1331 + XClearWindow(obt_display, self->ce_bl_b);
1332 + XSetWindowBackground(obt_display, self->ce_bl_l, px);
1333 + XClearWindow(obt_display, self->ce_bl_l);
1334 + XSetWindowBackground(obt_display, self->ce_br_b, px);
1335 + XClearWindow(obt_display, self->ce_br_b);
1336 + XSetWindowBackground(obt_display, self->ce_br_r, px);
1337 + XClearWindow(obt_display, self->ce_br_r);
1338 +
1339 + px = (self->focused ?
1340 + RrColorPixel (ob_rr_theme->a_focused_title->surface.primary) :
1341 + RrColorPixel(ob_rr_theme->frame_focused_border_color));
1342 +
1343 + XSetWindowBackground(obt_display, self->edgetop, px);
1344 + XClearWindow(obt_display, self->edgetop);
1345 + XSetWindowBackground(obt_display, self->edgelefttop, px);
1346 + XClearWindow(obt_display, self->edgelefttop);
1347 + XSetWindowBackground(obt_display, self->edgerighttop, px);
1348 + XClearWindow(obt_display, self->edgerighttop);
1349 + XSetWindowBackground(obt_display, self->edgetopleft, px);
1350 + XClearWindow(obt_display, self->edgetopleft);
1351 + XSetWindowBackground(obt_display, self->edgetopright, px);
1352 + XClearWindow(obt_display, self->edgetopright);
1353 + XSetWindowBackground(obt_display, self->ce_tl_t, px);
1354 + XClearWindow(obt_display, self->ce_tl_t);
1355 + XSetWindowBackground(obt_display, self->ce_tl_l, px);
1356 + XClearWindow(obt_display, self->ce_tl_l);
1357 + XSetWindowBackground(obt_display, self->ce_tr_t, px);
1358 + XClearWindow(obt_display, self->ce_tr_t);
1359 + XSetWindowBackground(obt_display, self->ce_tr_r, px);
1360 + XClearWindow(obt_display, self->ce_tr_r);
1361 }
1363 if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
1364 diff --git a/openbox/moveresize.c b/openbox/moveresize.c
1365 index 333a1be..a3d7627 100644
1366 --- a/openbox/moveresize.c
1367 +++ b/openbox/moveresize.c
1368 @@ -187,6 +187,7 @@ void moveresize_start(ObClient *c, gint x, gint y, guint b, guint32 cnr)
1369 (c->functions & OB_CLIENT_FUNC_MOVE) :
1370 (c->functions & OB_CLIENT_FUNC_RESIZE)))
1371 return;
1372 + frame_remove_handles (c);
1374 if (cnr == OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_TOPLEFT)) {
1375 cur = OB_CURSOR_NORTHWEST;
1376 @@ -366,6 +367,7 @@ void moveresize_end(gboolean cancel)
1377 /* dont edge warp after its ended */
1378 cancel_edge_warp();
1380 + frame_restore_handles (moveresize_client);
1381 moveresize_in_progress = FALSE;
1382 moveresize_client = NULL;
1383 }