diff options
author | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-04-03 13:48:39 +0200 |
---|---|---|
committer | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-04-25 00:00:49 +0200 |
commit | 969f76a1a44b5da92a03d9ac3c865109b0ef9f39 (patch) | |
tree | 80a3e4041e70c23ce47f302c4093d18e2ea60bda /sway/border.c | |
parent | e226b20bd8d2ce98077aee35b2a33b73943db247 (diff) |
Make floating border fixes work with tabbed/stacked code
Diffstat (limited to 'sway/border.c')
-rw-r--r-- | sway/border.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/sway/border.c b/sway/border.c index 061c1427..80e51580 100644 --- a/sway/border.c +++ b/sway/border.c @@ -141,34 +141,22 @@ static void render_borders(swayc_t *view, cairo_t *cr, struct border_colors *col static void render_title_bar(swayc_t *view, cairo_t *cr, struct border_colors *colors) { struct wlc_geometry *tb = &view->title_bar_geometry; struct wlc_geometry *b = &view->border_geometry; - int title_y = MIN(view->actual_geometry.origin.y - (int)tb->size.h, 0); + int x = MIN(tb->origin.x, tb->origin.x - b->origin.x); + int y = MIN(tb->origin.y, tb->origin.y - b->origin.y); - // borders - /* render_borders(view, cr, colors); */ - - int x = tb->origin.x - b->origin.x; - int y = tb->origin.y - b->origin.y; - - /* // title bar background */ - /* cairo_set_source_u32(cr, colors->child_border); */ - /* cairo_rectangle(cr, x, y, tb->size.w, tb->size.h); */ - /* cairo_fill(cr); */ // title bar background cairo_set_source_u32(cr, colors->background); - cairo_rectangle(cr, 0, title_y, tb->size.w, tb->size.h); + cairo_rectangle(cr, x, y, tb->size.w, tb->size.h); cairo_fill(cr); // header top line - /* render_sharp_line(cr, colors->border, x, y, tb->size.w, 1); */ - render_sharp_line(cr, colors->border, 0, title_y, tb->size.w, 1); + render_sharp_line(cr, colors->border, x, y, tb->size.w, 1); // text if (view->name) { int width, height; get_text_size(cr, config->font, &width, &height, false, "%s", view->name); - int x_text = MIN(view->actual_geometry.origin.x, view->border_thickness); - int y_text = MIN(view->actual_geometry.origin.y - height - 2, 2); - cairo_move_to(cr, x_text, y_text); + cairo_move_to(cr, x + 2, y + 2); cairo_set_source_u32(cr, colors->text); pango_printf(cr, config->font, false, "%s", view->name); } @@ -192,13 +180,13 @@ static void render_title_bar(swayc_t *view, cairo_t *cr, struct border_colors *c if ((uint32_t)(view->actual_geometry.origin.y - tb->origin.y) == tb->size.h) { // header bottom line render_sharp_line(cr, colors->border, - x + view->actual_geometry.origin.x - b->origin.x, + x + view->actual_geometry.origin.x - tb->origin.x, y + tb->size.h - 1, view->actual_geometry.size.w, 1); } else { // header bottom line render_sharp_line(cr, colors->border, x, - title_y + tb->size.h - 1, + y + tb->size.h - 1, tb->size.w, 1); } } |