aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-02 23:07:52 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-03 15:12:00 +1000
commitb667298a0a1efead7949715a31ec86fe3b8b1cda (patch)
treebc658e3019d741f1f245350003b156d05cc354a2 /sway/desktop/output.c
parentMerge pull request #1893 from swaywm/touch (diff)
downloadsway-b667298a0a1efead7949715a31ec86fe3b8b1cda.tar.gz
sway-b667298a0a1efead7949715a31ec86fe3b8b1cda.tar.zst
sway-b667298a0a1efead7949715a31ec86fe3b8b1cda.zip
Render titles
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r--sway/desktop/output.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 4fff8cd3..03af4239 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -227,7 +227,8 @@ static void render_view(struct sway_view *view, struct sway_output *output) {
227 * Render decorations for a view with "border normal". 227 * Render decorations for a view with "border normal".
228 */ 228 */
229static void render_container_simple_border_normal(struct sway_output *output, 229static void render_container_simple_border_normal(struct sway_output *output,
230 struct sway_container *con, struct border_colors *colors) { 230 struct sway_container *con, struct border_colors *colors,
231 struct wlr_texture *title_texture) {
231 struct wlr_renderer *renderer = 232 struct wlr_renderer *renderer =
232 wlr_backend_get_renderer(output->wlr_output->backend); 233 wlr_backend_get_renderer(output->wlr_output->backend);
233 struct wlr_box box; 234 struct wlr_box box;
@@ -306,7 +307,14 @@ static void render_container_simple_border_normal(struct sway_output *output,
306 output->wlr_output->transform_matrix); 307 output->wlr_output->transform_matrix);
307 308
308 // Title text 309 // Title text
309 // TODO 310 if (title_texture) {
311 double x = (con->x + con->sway_view->border_thickness)
312 * output->wlr_output->scale;
313 double y = (con->y + con->sway_view->border_thickness)
314 * output->wlr_output->scale;
315 wlr_render_texture(renderer, title_texture,
316 output->wlr_output->transform_matrix, x, y, 1);
317 }
310} 318}
311 319
312/** 320/**
@@ -390,17 +398,21 @@ static void render_container_simple(struct sway_output *output,
390 if (child->type == C_VIEW) { 398 if (child->type == C_VIEW) {
391 if (child->sway_view->border != B_NONE) { 399 if (child->sway_view->border != B_NONE) {
392 struct border_colors *colors; 400 struct border_colors *colors;
401 struct wlr_texture *title_texture;
393 if (focus == child) { 402 if (focus == child) {
394 colors = &config->border_colors.focused; 403 colors = &config->border_colors.focused;
404 title_texture = child->title_focused;
395 } else if (seat_get_focus_inactive(seat, con) == child) { 405 } else if (seat_get_focus_inactive(seat, con) == child) {
396 colors = &config->border_colors.focused_inactive; 406 colors = &config->border_colors.focused_inactive;
407 title_texture = child->title_focused_inactive;
397 } else { 408 } else {
398 colors = &config->border_colors.unfocused; 409 colors = &config->border_colors.unfocused;
410 title_texture = child->title_unfocused;
399 } 411 }
400 412
401 if (child->sway_view->border == B_NORMAL) { 413 if (child->sway_view->border == B_NORMAL) {
402 render_container_simple_border_normal(output, child, 414 render_container_simple_border_normal(output, child,
403 colors); 415 colors, title_texture);
404 } else { 416 } else {
405 render_container_simple_border_pixel(output, child, colors); 417 render_container_simple_border_pixel(output, child, colors);
406 } 418 }