3 #include "extensions.h"
4 #include "framerender.h"
5 #include "render/theme.h"
7 #define PLATE_EVENTMASK (SubstructureRedirectMask | ButtonPressMask)
8 #define FRAME_EVENTMASK (EnterWindowMask | LeaveWindowMask | \
9 ButtonPressMask | ButtonReleaseMask)
10 #define ELEMENT_EVENTMASK (ButtonPressMask | ButtonReleaseMask | \
11 ButtonMotionMask | ExposureMask)
13 static void layout_title(Frame
*self
);
23 static Window
createWindow(Window parent
, unsigned long mask
,
24 XSetWindowAttributes
*attrib
)
26 return XCreateWindow(ob_display
, parent
, 0, 0, 1, 1, 0,
27 RrDepth(ob_rr_inst
), InputOutput
,
28 RrVisual(ob_rr_inst
), mask
, attrib
);
34 XSetWindowAttributes attrib
;
38 self
= g_new(Frame
, 1);
40 self
->visible
= FALSE
;
41 self
->decorations
= 0;
43 /* create all of the decor windows */
44 mask
= CWOverrideRedirect
| CWEventMask
;
45 attrib
.event_mask
= FRAME_EVENTMASK
;
46 attrib
.override_redirect
= TRUE
;
47 self
->window
= createWindow(ob_root
, mask
, &attrib
);
50 self
->plate
= createWindow(self
->window
, mask
, &attrib
);
53 attrib
.event_mask
= ELEMENT_EVENTMASK
;
54 self
->title
= createWindow(self
->window
, mask
, &attrib
);
55 self
->label
= createWindow(self
->title
, mask
, &attrib
);
56 self
->max
= createWindow(self
->title
, mask
, &attrib
);
57 self
->close
= createWindow(self
->title
, mask
, &attrib
);
58 self
->desk
= createWindow(self
->title
, mask
, &attrib
);
59 self
->shade
= createWindow(self
->title
, mask
, &attrib
);
60 self
->icon
= createWindow(self
->title
, mask
, &attrib
);
61 self
->iconify
= createWindow(self
->title
, mask
, &attrib
);
62 self
->handle
= createWindow(self
->window
, mask
, &attrib
);
64 attrib
.cursor
= ob_cursors
.bl
;
65 self
->lgrip
= createWindow(self
->handle
, mask
, &attrib
);
66 attrib
.cursor
= ob_cursors
.br
;
67 self
->rgrip
= createWindow(self
->handle
, mask
, &attrib
);
69 self
->focused
= FALSE
;
71 /* the other stuff is shown based on decor settings */
72 XMapWindow(ob_display
, self
->plate
);
73 XMapWindow(ob_display
, self
->lgrip
);
74 XMapWindow(ob_display
, self
->rgrip
);
75 XMapWindow(ob_display
, self
->label
);
77 /* set colors/appearance/sizes for stuff that doesn't change */
78 XSetWindowBorder(ob_display
, self
->window
, ob_rr_theme
->b_color
->pixel
);
79 XSetWindowBorder(ob_display
, self
->label
, ob_rr_theme
->b_color
->pixel
);
80 XSetWindowBorder(ob_display
, self
->rgrip
, ob_rr_theme
->b_color
->pixel
);
81 XSetWindowBorder(ob_display
, self
->lgrip
, ob_rr_theme
->b_color
->pixel
);
83 XResizeWindow(ob_display
, self
->max
,
84 ob_rr_theme
->button_size
, ob_rr_theme
->button_size
);
85 XResizeWindow(ob_display
, self
->iconify
,
86 ob_rr_theme
->button_size
, ob_rr_theme
->button_size
);
87 XResizeWindow(ob_display
, self
->icon
,
88 ob_rr_theme
->button_size
+ 2, ob_rr_theme
->button_size
+ 2);
89 XResizeWindow(ob_display
, self
->close
,
90 ob_rr_theme
->button_size
, ob_rr_theme
->button_size
);
91 XResizeWindow(ob_display
, self
->desk
,
92 ob_rr_theme
->button_size
, ob_rr_theme
->button_size
);
93 XResizeWindow(ob_display
, self
->shade
,
94 ob_rr_theme
->button_size
, ob_rr_theme
->button_size
);
95 XResizeWindow(ob_display
, self
->lgrip
,
96 ob_rr_theme
->grip_width
, ob_rr_theme
->handle_height
);
97 XResizeWindow(ob_display
, self
->rgrip
,
98 ob_rr_theme
->grip_width
, ob_rr_theme
->handle_height
);
100 /* set up the dynamic appearances */
101 self
->a_unfocused_title
= RrAppearanceCopy(ob_rr_theme
->a_unfocused_title
);
102 self
->a_focused_title
= RrAppearanceCopy(ob_rr_theme
->a_focused_title
);
103 self
->a_unfocused_label
= RrAppearanceCopy(ob_rr_theme
->a_unfocused_label
);
104 self
->a_focused_label
= RrAppearanceCopy(ob_rr_theme
->a_focused_label
);
105 self
->a_unfocused_handle
=
106 RrAppearanceCopy(ob_rr_theme
->a_unfocused_handle
);
107 self
->a_focused_handle
= RrAppearanceCopy(ob_rr_theme
->a_focused_handle
);
108 self
->a_icon
= RrAppearanceCopy(ob_rr_theme
->a_icon
);
110 self
->max_press
= self
->close_press
= self
->desk_press
=
111 self
->iconify_press
= self
->shade_press
= FALSE
;
116 static void frame_free(Frame
*self
)
118 RrAppearanceFree(self
->a_unfocused_title
);
119 RrAppearanceFree(self
->a_focused_title
);
120 RrAppearanceFree(self
->a_unfocused_label
);
121 RrAppearanceFree(self
->a_focused_label
);
122 RrAppearanceFree(self
->a_unfocused_handle
);
123 RrAppearanceFree(self
->a_focused_handle
);
124 RrAppearanceFree(self
->a_icon
);
126 XDestroyWindow(ob_display
, self
->window
);
131 void frame_show(Frame
*self
)
133 if (!self
->visible
) {
134 self
->visible
= TRUE
;
135 XMapWindow(ob_display
, self
->window
);
139 void frame_hide(Frame
*self
)
142 self
->visible
= FALSE
;
143 self
->client
->ignore_unmaps
++;
144 XUnmapWindow(ob_display
, self
->window
);
148 void frame_adjust_shape(Frame
*self
)
154 if (!self
->client
->shaped
) {
155 /* clear the shape on the frame window */
156 XShapeCombineMask(ob_display
, self
->window
, ShapeBounding
,
157 self
->innersize
.left
,
161 /* make the frame's shape match the clients */
162 XShapeCombineShape(ob_display
, self
->window
, ShapeBounding
,
163 self
->innersize
.left
,
165 self
->client
->window
,
166 ShapeBounding
, ShapeSet
);
169 if (self
->decorations
& Decor_Titlebar
) {
170 xrect
[0].x
= -ob_rr_theme
->bevel
;
171 xrect
[0].y
= -ob_rr_theme
->bevel
;
172 xrect
[0].width
= self
->width
+ self
->bwidth
* 2;
173 xrect
[0].height
= ob_rr_theme
->title_height
+
178 if (self
->decorations
& Decor_Handle
) {
179 xrect
[1].x
= -ob_rr_theme
->bevel
;
180 xrect
[1].y
= FRAME_HANDLE_Y(self
);
181 xrect
[1].width
= self
->width
+ self
->bwidth
* 2;
182 xrect
[1].height
= ob_rr_theme
->handle_height
+
187 XShapeCombineRectangles(ob_display
, self
->window
,
188 ShapeBounding
, 0, 0, xrect
, num
,
189 ShapeUnion
, Unsorted
);
194 void frame_adjust_area(Frame
*self
, gboolean moved
, gboolean resized
)
197 self
->decorations
= self
->client
->decorations
;
198 if (self
->decorations
& Decor_Border
) {
199 self
->bwidth
= ob_rr_theme
->bwidth
;
200 self
->cbwidth
= ob_rr_theme
->cbwidth
;
202 self
->bwidth
= self
->cbwidth
= 0;
204 STRUT_SET(self
->innersize
, self
->cbwidth
, self
->cbwidth
,
205 self
->cbwidth
, self
->cbwidth
);
206 self
->width
= self
->client
->area
.width
+ self
->cbwidth
* 2;
207 g_assert(self
->width
> 0);
209 /* set border widths */
210 XSetWindowBorderWidth(ob_display
, self
->plate
, self
->cbwidth
);
211 XSetWindowBorderWidth(ob_display
, self
->window
, self
->bwidth
);
212 XSetWindowBorderWidth(ob_display
, self
->title
, self
->bwidth
);
213 XSetWindowBorderWidth(ob_display
, self
->handle
, self
->bwidth
);
214 XSetWindowBorderWidth(ob_display
, self
->lgrip
, self
->bwidth
);
215 XSetWindowBorderWidth(ob_display
, self
->rgrip
, self
->bwidth
);
217 /* position/size and map/unmap all the windows */
219 /* they all default off, they're turned on in layout_title */
223 self
->iconify_x
= -1;
228 if (self
->decorations
& Decor_Titlebar
) {
229 XMoveResizeWindow(ob_display
, self
->title
,
230 -self
->bwidth
, -self
->bwidth
,
231 self
->width
, ob_rr_theme
->title_height
);
232 self
->innersize
.top
+= ob_rr_theme
->title_height
+ self
->bwidth
;
233 XMapWindow(ob_display
, self
->title
);
235 /* layout the title bar elements */
238 XUnmapWindow(ob_display
, self
->title
);
240 if (self
->decorations
& Decor_Handle
) {
241 XMoveResizeWindow(ob_display
, self
->handle
,
242 -self
->bwidth
, FRAME_HANDLE_Y(self
),
243 self
->width
, ob_rr_theme
->handle_height
);
244 XMoveWindow(ob_display
, self
->lgrip
,
245 -self
->bwidth
, -self
->bwidth
);
246 XMoveWindow(ob_display
, self
->rgrip
,
247 -self
->bwidth
+ self
->width
-
248 ob_rr_theme
->grip_width
, -self
->bwidth
);
249 self
->innersize
.bottom
+= ob_rr_theme
->handle_height
+
251 XMapWindow(ob_display
, self
->handle
);
253 /* XXX make a subwindow with these dimentions?
254 ob_rr_theme->grip_width + self->bwidth, 0,
255 self->width - (ob_rr_theme->grip_width + self->bwidth) * 2,
256 ob_rr_theme->handle_height);
259 XUnmapWindow(ob_display
, self
->handle
);
263 /* move and resize the plate */
264 XMoveResizeWindow(ob_display
, self
->plate
,
265 self
->innersize
.left
- self
->cbwidth
,
266 self
->innersize
.top
- self
->cbwidth
,
267 self
->client
->area
.width
,
268 self
->client
->area
.height
);
269 /* when the client has StaticGravity, it likes to move around. */
270 XMoveWindow(ob_display
, self
->client
->window
, 0, 0);
274 STRUT_SET(self
->size
,
275 self
->innersize
.left
+ self
->bwidth
,
276 self
->innersize
.top
+ self
->bwidth
,
277 self
->innersize
.right
+ self
->bwidth
,
278 self
->innersize
.bottom
+ self
->bwidth
);
281 /* shading can change without being moved or resized */
282 RECT_SET_SIZE(self
->area
,
283 self
->client
->area
.width
+
284 self
->size
.left
+ self
->size
.right
,
285 (self
->client
->shaded
? ob_rr_theme
->title_height
+ self
->bwidth
*2:
286 self
->client
->area
.height
+
287 self
->size
.top
+ self
->size
.bottom
));
290 /* find the new coordinates, done after setting the frame.size, for
291 frame_client_gravity. */
292 self
->area
.x
= self
->client
->area
.x
;
293 self
->area
.y
= self
->client
->area
.y
;
294 frame_client_gravity((Frame
*)self
,
295 &self
->area
.x
, &self
->area
.y
);
298 /* move and resize the top level frame.
299 shading can change without being moved or resized */
300 XMoveResizeWindow(ob_display
, self
->window
,
301 self
->area
.x
, self
->area
.y
,
303 self
->area
.height
- self
->bwidth
* 2);
306 framerender_frame(self
);
308 frame_adjust_shape(self
);
312 void frame_adjust_state(Frame
*self
)
314 framerender_frame(self
);
317 void frame_adjust_focus(Frame
*self
, gboolean hilite
)
319 self
->focused
= hilite
;
320 framerender_frame(self
);
323 void frame_adjust_title(Frame
*self
)
325 framerender_frame(self
);
328 void frame_adjust_icon(Frame
*self
)
330 framerender_frame(self
);
333 void frame_grab_client(Frame
*self
, Client
*client
)
335 self
->client
= client
;
337 /* reparent the client to the frame */
338 XReparentWindow(ob_display
, client
->window
, self
->plate
, 0, 0);
340 When reparenting the client window, it is usually not mapped yet, since
341 this occurs from a MapRequest. However, in the case where Openbox is
342 starting up, the window is already mapped, so we'll see unmap events for
343 it. There are 2 unmap events generated that we see, one with the 'event'
344 member set the root window, and one set to the client, but both get
345 handled and need to be ignored.
347 if (ob_state
== State_Starting
)
348 client
->ignore_unmaps
+= 2;
350 /* select the event mask on the client's parent (to receive config/map
351 req's) the ButtonPress is to catch clicks on the client border */
352 XSelectInput(ob_display
, self
->plate
, PLATE_EVENTMASK
);
354 /* map the client so it maps when the frame does */
355 XMapWindow(ob_display
, client
->window
);
357 frame_adjust_area(self
, TRUE
, TRUE
);
359 /* set all the windows for the frame in the window_map */
360 g_hash_table_insert(window_map
, &self
->window
, client
);
361 g_hash_table_insert(window_map
, &self
->plate
, client
);
362 g_hash_table_insert(window_map
, &self
->title
, client
);
363 g_hash_table_insert(window_map
, &self
->label
, client
);
364 g_hash_table_insert(window_map
, &self
->max
, client
);
365 g_hash_table_insert(window_map
, &self
->close
, client
);
366 g_hash_table_insert(window_map
, &self
->desk
, client
);
367 g_hash_table_insert(window_map
, &self
->shade
, client
);
368 g_hash_table_insert(window_map
, &self
->icon
, client
);
369 g_hash_table_insert(window_map
, &self
->iconify
, client
);
370 g_hash_table_insert(window_map
, &self
->handle
, client
);
371 g_hash_table_insert(window_map
, &self
->lgrip
, client
);
372 g_hash_table_insert(window_map
, &self
->rgrip
, client
);
375 void frame_release_client(Frame
*self
, Client
*client
)
379 g_assert(self
->client
== client
);
381 /* check if the app has already reparented its window away */
382 if (XCheckTypedWindowEvent(ob_display
, client
->window
,
383 ReparentNotify
, &ev
)) {
384 XPutBackEvent(ob_display
, &ev
);
386 /* re-map the window since the unmanaging process unmaps it */
388 /* XXX ... um no it doesnt it unmaps its parent, the window itself
389 retains its mapped state, no?! XXX
390 XMapWindow(ob_display, client->window); */
392 /* according to the ICCCM - if the client doesn't reparent itself,
393 then we will reparent the window to root for them */
394 XReparentWindow(ob_display
, client
->window
, ob_root
,
399 /* remove all the windows for the frame from the window_map */
400 g_hash_table_remove(window_map
, &self
->window
);
401 g_hash_table_remove(window_map
, &self
->plate
);
402 g_hash_table_remove(window_map
, &self
->title
);
403 g_hash_table_remove(window_map
, &self
->label
);
404 g_hash_table_remove(window_map
, &self
->max
);
405 g_hash_table_remove(window_map
, &self
->close
);
406 g_hash_table_remove(window_map
, &self
->desk
);
407 g_hash_table_remove(window_map
, &self
->shade
);
408 g_hash_table_remove(window_map
, &self
->icon
);
409 g_hash_table_remove(window_map
, &self
->iconify
);
410 g_hash_table_remove(window_map
, &self
->handle
);
411 g_hash_table_remove(window_map
, &self
->lgrip
);
412 g_hash_table_remove(window_map
, &self
->rgrip
);
417 static void layout_title(Frame
*self
)
421 gboolean n
, d
, i
, l
, m
, c
, s
;
423 n
= d
= i
= l
= m
= c
= s
= FALSE
;
425 /* figure out whats being shown, and the width of the label */
426 self
->label_width
= self
->width
- (ob_rr_theme
->bevel
+ 1) * 2;
427 for (lc
= ob_rr_theme
->title_layout
; *lc
!= '\0'; ++lc
) {
430 if (!(self
->decorations
& Decor_Icon
)) break;
431 if (n
) { *lc
= ' '; break; } /* rm duplicates */
433 self
->label_width
-= (ob_rr_theme
->button_size
+ 2 +
434 ob_rr_theme
->bevel
+ 1);
437 if (!(self
->decorations
& Decor_AllDesktops
)) break;
438 if (d
) { *lc
= ' '; break; } /* rm duplicates */
440 self
->label_width
-= (ob_rr_theme
->button_size
+
441 ob_rr_theme
->bevel
+ 1);
444 if (!(self
->decorations
& Decor_Shade
)) break;
445 if (s
) { *lc
= ' '; break; } /* rm duplicates */
447 self
->label_width
-= (ob_rr_theme
->button_size
+
448 ob_rr_theme
->bevel
+ 1);
451 if (!(self
->decorations
& Decor_Iconify
)) break;
452 if (i
) { *lc
= ' '; break; } /* rm duplicates */
454 self
->label_width
-= (ob_rr_theme
->button_size
+
455 ob_rr_theme
->bevel
+ 1);
458 if (l
) { *lc
= ' '; break; } /* rm duplicates */
462 if (!(self
->decorations
& Decor_Maximize
)) break;
463 if (m
) { *lc
= ' '; break; } /* rm duplicates */
465 self
->label_width
-= (ob_rr_theme
->button_size
+
466 ob_rr_theme
->bevel
+ 1);
469 if (!(self
->decorations
& Decor_Close
)) break;
470 if (c
) { *lc
= ' '; break; } /* rm duplicates */
472 self
->label_width
-= (ob_rr_theme
->button_size
+
473 ob_rr_theme
->bevel
+ 1);
477 if (self
->label_width
< 1) self
->label_width
= 1;
479 XResizeWindow(ob_display
, self
->label
, self
->label_width
,
480 ob_rr_theme
->label_height
);
482 if (!n
) XUnmapWindow(ob_display
, self
->icon
);
483 if (!d
) XUnmapWindow(ob_display
, self
->desk
);
484 if (!s
) XUnmapWindow(ob_display
, self
->shade
);
485 if (!i
) XUnmapWindow(ob_display
, self
->iconify
);
486 if (!l
) XUnmapWindow(ob_display
, self
->label
);
487 if (!m
) XUnmapWindow(ob_display
, self
->max
);
488 if (!c
) XUnmapWindow(ob_display
, self
->close
);
490 x
= ob_rr_theme
->bevel
+ 1;
491 for (lc
= ob_rr_theme
->title_layout
; *lc
!= '\0'; ++lc
) {
496 XMapWindow(ob_display
, self
->icon
);
497 XMoveWindow(ob_display
, self
->icon
, x
, ob_rr_theme
->bevel
);
498 x
+= ob_rr_theme
->button_size
+ 2 + ob_rr_theme
->bevel
+ 1;
503 XMapWindow(ob_display
, self
->desk
);
504 XMoveWindow(ob_display
, self
->desk
, x
, ob_rr_theme
->bevel
+ 1);
505 x
+= ob_rr_theme
->button_size
+ ob_rr_theme
->bevel
+ 1;
510 XMapWindow(ob_display
, self
->shade
);
511 XMoveWindow(ob_display
, self
->shade
, x
, ob_rr_theme
->bevel
+ 1);
512 x
+= ob_rr_theme
->button_size
+ ob_rr_theme
->bevel
+ 1;
517 XMapWindow(ob_display
, self
->iconify
);
518 XMoveWindow(ob_display
, self
->iconify
, x
, ob_rr_theme
->bevel
+ 1);
519 x
+= ob_rr_theme
->button_size
+ ob_rr_theme
->bevel
+ 1;
524 XMapWindow(ob_display
, self
->label
);
525 XMoveWindow(ob_display
, self
->label
, x
, ob_rr_theme
->bevel
);
526 x
+= self
->label_width
+ ob_rr_theme
->bevel
+ 1;
531 XMapWindow(ob_display
, self
->max
);
532 XMoveWindow(ob_display
, self
->max
, x
, ob_rr_theme
->bevel
+ 1);
533 x
+= ob_rr_theme
->button_size
+ ob_rr_theme
->bevel
+ 1;
538 XMapWindow(ob_display
, self
->close
);
539 XMoveWindow(ob_display
, self
->close
, x
, ob_rr_theme
->bevel
+ 1);
540 x
+= ob_rr_theme
->button_size
+ ob_rr_theme
->bevel
+ 1;
546 Context
frame_context_from_string(char *name
)
548 if (!g_ascii_strcasecmp("root", name
))
550 else if (!g_ascii_strcasecmp("client", name
))
551 return Context_Client
;
552 else if (!g_ascii_strcasecmp("titlebar", name
))
553 return Context_Titlebar
;
554 else if (!g_ascii_strcasecmp("handle", name
))
555 return Context_Handle
;
556 else if (!g_ascii_strcasecmp("frame", name
))
557 return Context_Frame
;
558 else if (!g_ascii_strcasecmp("blcorner", name
))
559 return Context_BLCorner
;
560 else if (!g_ascii_strcasecmp("tlcorner", name
))
561 return Context_TLCorner
;
562 else if (!g_ascii_strcasecmp("brcorner", name
))
563 return Context_BRCorner
;
564 else if (!g_ascii_strcasecmp("trcorner", name
))
565 return Context_TRCorner
;
566 else if (!g_ascii_strcasecmp("maximize", name
))
567 return Context_Maximize
;
568 else if (!g_ascii_strcasecmp("alldesktops", name
))
569 return Context_AllDesktops
;
570 else if (!g_ascii_strcasecmp("shade", name
))
571 return Context_Shade
;
572 else if (!g_ascii_strcasecmp("iconify", name
))
573 return Context_Iconify
;
574 else if (!g_ascii_strcasecmp("icon", name
))
576 else if (!g_ascii_strcasecmp("close", name
))
577 return Context_Close
;
581 Context
frame_context(Client
*client
, Window win
)
585 if (win
== ob_root
) return Context_Root
;
586 if (client
== NULL
) return Context_None
;
587 if (win
== client
->window
) return Context_Client
;
589 self
= client
->frame
;
590 if (win
== self
->window
) return Context_Frame
;
591 if (win
== self
->plate
) return Context_Client
;
592 if (win
== self
->title
) return Context_Titlebar
;
593 if (win
== self
->label
) return Context_Titlebar
;
594 if (win
== self
->handle
) return Context_Handle
;
595 if (win
== self
->lgrip
) return Context_BLCorner
;
596 if (win
== self
->rgrip
) return Context_BRCorner
;
597 if (win
== self
->max
) return Context_Maximize
;
598 if (win
== self
->iconify
)return Context_Iconify
;
599 if (win
== self
->close
) return Context_Close
;
600 if (win
== self
->icon
) return Context_Icon
;
601 if (win
== self
->desk
) return Context_AllDesktops
;
602 if (win
== self
->shade
) return Context_Shade
;
607 void frame_client_gravity(Frame
*self
, int *x
, int *y
)
610 switch (self
->client
->gravity
) {
612 case NorthWestGravity
:
613 case SouthWestGravity
:
620 *x
-= (self
->size
.left
+ self
->size
.right
) / 2;
623 case NorthEastGravity
:
624 case SouthEastGravity
:
626 *x
-= self
->size
.left
+ self
->size
.right
;
631 *x
-= self
->size
.left
;
636 switch (self
->client
->gravity
) {
638 case NorthWestGravity
:
639 case NorthEastGravity
:
646 *y
-= (self
->size
.top
+ self
->size
.bottom
) / 2;
649 case SouthWestGravity
:
650 case SouthEastGravity
:
652 *y
-= self
->size
.top
+ self
->size
.bottom
;
657 *y
-= self
->size
.top
;
662 void frame_frame_gravity(Frame
*self
, int *x
, int *y
)
665 switch (self
->client
->gravity
) {
667 case NorthWestGravity
:
669 case SouthWestGravity
:
674 *x
+= (self
->size
.left
+ self
->size
.right
) / 2;
676 case NorthEastGravity
:
678 case SouthEastGravity
:
679 *x
+= self
->size
.left
+ self
->size
.right
;
683 *x
+= self
->size
.left
;
688 switch (self
->client
->gravity
) {
690 case NorthWestGravity
:
692 case SouthWestGravity
:
697 *y
+= (self
->size
.top
+ self
->size
.bottom
) / 2;
699 case NorthEastGravity
:
701 case SouthEastGravity
:
702 *y
+= self
->size
.top
+ self
->size
.bottom
;
706 *y
+= self
->size
.top
;