xwm: move frame_set_title() into draw_decoration()
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Thu, 15 Dec 2016 13:37:24 +0000 (15:37 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Tue, 17 Jan 2017 14:35:35 +0000 (16:35 +0200)
commit9a330e1abb5a965e3cd48a228950ed00f4f68db1
treee375efc16bae49411c136b0df851ae26e801d06d
parent20111d5d530ce1a20b017a92a85f512ded65fed7
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 <pekka.paalanen@collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
xwayland/window-manager.c