summaryrefslogtreecommitdiff
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2018-05-03 08:20:27 -0400
committerGitHub <[email protected]>2018-05-03 08:20:27 -0400
commit87e65e5c5b95e1b7c58bd1b722c97ebe0db8b477 (patch)
treee3ca897c922da50ec0fd68ed097acf1b7153f61f /sway/desktop/output.c
parentf3d0885524f4f1dc568baf21fcc8e387a316703f (diff)
parent58a033d8163c922eff8577b34523418c2c2ab432 (diff)
Merge pull request #1895 from RyanDwyer/show-titles
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) {
* Render decorations for a view with "border normal".
*/
static void render_container_simple_border_normal(struct sway_output *output,
- struct sway_container *con, struct border_colors *colors) {
+ struct sway_container *con, struct border_colors *colors,
+ struct wlr_texture *title_texture) {
struct wlr_renderer *renderer =
wlr_backend_get_renderer(output->wlr_output->backend);
struct wlr_box box;
@@ -306,7 +307,14 @@ static void render_container_simple_border_normal(struct sway_output *output,
output->wlr_output->transform_matrix);
// Title text
- // TODO
+ if (title_texture) {
+ double x = (con->x + con->sway_view->border_thickness)
+ * output->wlr_output->scale;
+ double y = (con->y + con->sway_view->border_thickness)
+ * output->wlr_output->scale;
+ wlr_render_texture(renderer, title_texture,
+ output->wlr_output->transform_matrix, x, y, 1);
+ }
}
/**
@@ -390,17 +398,21 @@ static void render_container_simple(struct sway_output *output,
if (child->type == C_VIEW) {
if (child->sway_view->border != B_NONE) {
struct border_colors *colors;
+ struct wlr_texture *title_texture;
if (focus == child) {
colors = &config->border_colors.focused;
+ title_texture = child->title_focused;
} else if (seat_get_focus_inactive(seat, con) == child) {
colors = &config->border_colors.focused_inactive;
+ title_texture = child->title_focused_inactive;
} else {
colors = &config->border_colors.unfocused;
+ title_texture = child->title_unfocused;
}
if (child->sway_view->border == B_NORMAL) {
render_container_simple_border_normal(output, child,
- colors);
+ colors, title_texture);
} else {
render_container_simple_border_pixel(output, child, colors);
}