summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren gmail com>2006-05-05 01:10:20 +0000
committerElijah Newren <newren@src.gnome.org>2006-05-05 01:10:20 +0000
commitb62dd8d130231b3b05114334a83837e006ea4afa (patch)
tree5dc5dcb99a0c3e1fd31b1183547293c5f349a610
parente9c8fd852738d4f28ad61f116682c7a888e4b85d (diff)
downloadmetacity-b62dd8d130231b3b05114334a83837e006ea4afa.tar.gz
Clear _NET_WM_VISIBLE_NAME (and the ICON_ equivalent) when no longer being
2006-04-25 Elijah Newren <newren gmail com> Clear _NET_WM_VISIBLE_NAME (and the ICON_ equivalent) when no longer being used. Fixes #330671. * src/window.[ch] (struct MetaWindow): new using_net_wm_visible_name and using_net_wm_visible_icon_name bits, (meta_window_new_with_attrs): initialize these new bits to false * src/window-props.c (set_title_text, set_window_title, set_icon_title): if the _NET_WM_VISIBLE_(ICON_)NAME property was previously set but doesn't need to be this time, make sure to clear it
-rw-r--r--ChangeLog13
-rw-r--r--src/window-props.c38
-rw-r--r--src/window.c6
-rw-r--r--src/window.h6
4 files changed, 50 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 026c0f3e..c4c74819 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2006-04-25 Elijah Newren <newren gmail com>
+ Clear _NET_WM_VISIBLE_NAME (and the ICON_ equivalent) when no
+ longer being used. Fixes #330671.
+
+ * src/window.[ch] (struct MetaWindow): new
+ using_net_wm_visible_name and using_net_wm_visible_icon_name bits,
+ (meta_window_new_with_attrs): initialize these new bits to false
+
+ * src/window-props.c (set_title_text, set_window_title, set_icon_title):
+ if the _NET_WM_VISIBLE_(ICON_)NAME property was previously set but
+ doesn't need to be this time, make sure to clear it
+
+2006-04-25 Elijah Newren <newren gmail com>
+
* rationales.txt: add three new tracker bugs
Thu May 4 13:30:04 2006 Søren Sandmann <sandmann@redhat.com>
diff --git a/src/window-props.c b/src/window-props.c
index a1348279..a84e25fc 100644
--- a/src/window-props.c
+++ b/src/window-props.c
@@ -207,7 +207,11 @@ reload_net_wm_user_time (MetaWindow *window,
* Returns TRUE if a new title was set.
*/
static gboolean
-set_title_text (MetaWindow *window, const char *title, Atom atom, char **target)
+set_title_text (MetaWindow *window,
+ gboolean previous_was_modified,
+ const char *title,
+ Atom atom,
+ char **target)
{
char hostname[HOST_NAME_MAX + 1];
gboolean modified = FALSE;
@@ -239,8 +243,14 @@ set_title_text (MetaWindow *window, const char *title, Atom atom, char **target)
if (modified && atom != None)
meta_prop_set_utf8_string_hint (window->display,
- window->xwindow,
- atom, *target);
+ window->xwindow,
+ atom, *target);
+
+ /* Bug 330671 -- Don't forget to clear _NET_WM_VISIBLE_(ICON_)NAME */
+ if (!modified && previous_was_modified)
+ XDeleteProperty (window->display->xdisplay,
+ window->xwindow,
+ atom);
return modified;
}
@@ -251,8 +261,13 @@ set_window_title (MetaWindow *window,
{
char *str;
- set_title_text (window, title, window->display->atom_net_wm_visible_name,
- &window->title);
+ gboolean modified =
+ set_title_text (window,
+ window->using_net_wm_visible_name,
+ title,
+ window->display->atom_net_wm_visible_name,
+ &window->title);
+ window->using_net_wm_visible_name = modified;
/* strndup is a hack since GNU libc has broken %.10s */
str = g_strndup (window->title, 10);
@@ -297,8 +312,8 @@ reload_net_wm_name (MetaWindow *window,
static void
init_wm_name (MetaDisplay *display,
- Atom property,
- MetaPropValue *value)
+ Atom property,
+ MetaPropValue *value)
{
value->type = META_PROP_VALUE_TEXT_PROPERTY;
value->atom = XA_WM_NAME;
@@ -332,8 +347,13 @@ static void
set_icon_title (MetaWindow *window,
const char *title)
{
- set_title_text (window, title, window->display->atom_net_wm_visible_icon_name,
- &window->icon_name);
+ gboolean modified =
+ set_title_text (window,
+ window->using_net_wm_visible_icon_name,
+ title,
+ window->display->atom_net_wm_visible_icon_name,
+ &window->icon_name);
+ window->using_net_wm_visible_icon_name = modified;
}
static void
diff --git a/src/window.c b/src/window.c
index 16bdf09e..368734ca 100644
--- a/src/window.c
+++ b/src/window.c
@@ -528,8 +528,10 @@ meta_window_new_with_attrs (MetaDisplay *display,
window->struts = NULL;
- window->using_net_wm_name = FALSE;
- window->using_net_wm_icon_name = FALSE;
+ window->using_net_wm_name = FALSE;
+ window->using_net_wm_visible_name = FALSE;
+ window->using_net_wm_icon_name = FALSE;
+ window->using_net_wm_visible_icon_name = FALSE;
window->need_reread_icon = TRUE;
window->update_icon_queued = FALSE;
diff --git a/src/window.h b/src/window.h
index f3eb4d38..6c648978 100644
--- a/src/window.h
+++ b/src/window.h
@@ -273,8 +273,10 @@ struct _MetaWindow
guint transient_parent_is_root_window : 1;
/* Info on which props we got our attributes from */
- guint using_net_wm_name : 1; /* vs. plain wm_name */
- guint using_net_wm_icon_name : 1; /* vs. plain wm_icon_name */
+ guint using_net_wm_name : 1; /* vs. plain wm_name */
+ guint using_net_wm_visible_name : 1; /* tracked so we can clear it */
+ guint using_net_wm_icon_name : 1; /* vs. plain wm_icon_name */
+ guint using_net_wm_visible_icon_name : 1; /* tracked so we can clear it */
/* has a shape mask */
guint has_shape : 1;