From 9a330e1abb5a965e3cd48a228950ed00f4f68db1 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 15 Dec 2016 15:37:24 +0200 Subject: [PATCH] xwm: move frame_set_title() into draw_decoration() The only thing using the frame title is frame_repaint(). Move the call to frame_set_title() from weston_wm_window_read_properties() into weston_wm_window_draw_decoration() where the only call to frame_repaint() is. Do not check for window->name == NULL, because frame_set_title() handles NULL just fine. Also, once window->name becomes set, it cannot become NULL again unless strndup() fails. The name string can be reset to the empty string in any case. This change is prompted by future refactoring where at weston_wm_window_read_properties() time the frame might not have been created yet. Signed-off-by: Pekka Paalanen Reviewed-by: Quentin Glidic --- xwayland/window-manager.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index 139aea1a..ef003a38 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -598,8 +598,6 @@ weston_wm_window_read_properties(struct weston_wm_window *window) if (window->shsurf && window->name) xwayland_interface->set_title(window->shsurf, window->name); - if (window->frame && window->name) - frame_set_title(window->frame, window->name); if (window->shsurf && window->pid > 0) xwayland_interface->set_pid(window->shsurf, window->pid); } @@ -1136,6 +1134,7 @@ weston_wm_window_draw_decoration(void *data) if (wm->focus_window == window) flags |= THEME_FRAME_ACTIVE; + frame_set_title(window->frame, window->name); frame_repaint(window->frame, cr); } else { cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);