942
* [Re]set a window's name. This is called after we've received a new
943
* WM_NAME (or other name-setting) property, to update our titlebars,
944
* icon managers, etc.
942
* [Re]set a window's name. This should rarely be called directly;
943
* apply_window_name() should be used instead. It's split out because we
944
* need to do this step individually in AddWindow().
946
946
* Note that we never need to worry about freeing win->name; it always
947
947
* points to one of the win->names.something's (which are free'd by the
948
948
* event handler when they change) or NoName (which is static). So we
949
949
* can just casually flip it around at will.
952
apply_window_name(TwmWindow *win)
952
set_window_name(TwmWindow *win)
954
/* Figure what the name should be, and change if necessary */
956
char *newname = NULL;
954
char *newname = NULL;
957
955
#define TRY(fld) { \
958
956
if(newname == NULL && win->names.fld != NULL) { \
959
957
newname = win->names.fld; \
968
if(newname == NULL) {
971
if(win->name == newname) {
972
return; // Nothing to do
976
win->nameChanged = true;
966
if(newname == NULL) {
969
if(win->name == newname) {
970
return false; // Nothing to do
979
* [Re]set and apply changes to a window's name. This is called after
980
* we've received a new WM_NAME (or other name-setting) property, to
981
* update our titlebars, icon managers, etc.
984
apply_window_name(TwmWindow *win)
987
if(set_window_name(win) == false) {
991
win->nameChanged = true;
979
994
/* Update the active name */