diff options
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/output.c | 18 | ||||
-rw-r--r-- | sway/desktop/xdg_shell_v6.c | 2 | ||||
-rw-r--r-- | sway/desktop/xwayland.c | 1 |
3 files changed, 18 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); } diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index 94556231..5880e9a9 100644 --- a/sway/desktop/xdg_shell_v6.c +++ b/sway/desktop/xdg_shell_v6.c @@ -176,6 +176,8 @@ static void handle_commit(struct wl_listener *listener, void *data) { // TODO: Let floating views do whatever view_update_size(view, xdg_shell_v6_view->pending_width, xdg_shell_v6_view->pending_height); + container_update_title(view->swayc, + view->wlr_xdg_surface_v6->toplevel->title); view_damage(view, false); } diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 28f93d6e..a1e672ce 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c @@ -223,6 +223,7 @@ static void handle_commit(struct wl_listener *listener, void *data) { view_update_size(view, xwayland_view->pending_width, xwayland_view->pending_height); view_damage(view, false); + container_update_title(view->swayc, view->wlr_xwayland_surface->title); } static void handle_unmap(struct wl_listener *listener, void *data) { |