emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r100725: Set _NET_WM(_ICON)_NAME as p


From: Jan D
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100725: Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
Date: Mon, 05 Jul 2010 12:28:27 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100725
committer: Jan D <address@hidden>
branch nick: trunk
timestamp: Mon 2010-07-05 12:28:27 +0200
message:
  Set _NET_WM(_ICON)_NAME as per Extended Window Manager Hints (Bug#6563).
  
  * xterm.h (Xatom_net_wm_name, Xatom_net_wm_icon_name): New.
  
  * xterm.c (x_term_init): Intern the _NET_WM_NAME and
  _NET_WM_ICON_NAME atoms.
  
  * xfns.c (x_set_name_internal): Set the EWMH _NET_WM_NAME
  and _NET_WM_ICON_NAME properties, too, matching what is
  done in the Gtk+ case.
modified:
  src/ChangeLog
  src/xfns.c
  src/xterm.c
  src/xterm.h
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-07-05 09:55:11 +0000
+++ b/src/ChangeLog     2010-07-05 10:28:27 +0000
@@ -1,3 +1,14 @@
+2010-07-05  James Cloos  <address@hidden>
+
+       * xterm.h (Xatom_net_wm_name, Xatom_net_wm_icon_name): New.
+
+       * xterm.c (x_term_init): Intern the _NET_WM_NAME and
+       _NET_WM_ICON_NAME atoms.
+
+       * xfns.c (x_set_name_internal): Set the EWMH _NET_WM_NAME
+       and _NET_WM_ICON_NAME properties, too, matching what is
+       done in the Gtk+ case.
+
 2010-07-05  Jan Djärv  <address@hidden>
 
        * xterm.c (XTring_bell, XTset_terminal_window): Fix wrong prototype.

=== modified file 'src/xfns.c'
--- a/src/xfns.c        2010-07-04 07:50:25 +0000
+++ b/src/xfns.c        2010-07-05 10:28:27 +0000
@@ -1553,8 +1553,8 @@
        int bytes, stringp;
         int do_free_icon_value = 0, do_free_text_value = 0;
        Lisp_Object coding_system;
-#ifdef USE_GTK
        Lisp_Object encoded_name;
+       Lisp_Object encoded_icon_name;
        struct gcpro gcpro1;
 
        /* As ENCODE_UTF_8 may cause GC and relocation of string data,
@@ -1562,7 +1562,6 @@
        GCPRO1 (name);
        encoded_name = ENCODE_UTF_8 (name);
        UNGCPRO;
-#endif
 
        coding_system = Qcompound_text;
        /* Note: Encoding strategy
@@ -1578,7 +1577,12 @@
           We may also be able to use "UTF8_STRING" in text.encoding
           in the future which can encode all Unicode characters.
           But, for the moment, there's no way to know that the
-          current window manager supports it or not.  */
+          current window manager supports it or not.
+
+          Either way, we also set the _NET_WM_NAME and _NET_WM_ICON_NAME
+          properties.  Per the EWMH specification, those two properties
+          are always UTF8_STRING.  This matches what gtk_window_set_title()
+          does in the USE_GTK case. */
        text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp,
                                    &do_free_text_value);
        text.encoding = (stringp ? XA_STRING
@@ -1589,6 +1593,7 @@
        if (!STRINGP (f->icon_name))
          {
            icon = text;
+           encoded_icon_name = encoded_name;
          }
        else
          {
@@ -1599,6 +1604,8 @@
                             : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
            icon.format = 8;
            icon.nitems = bytes;
+
+           encoded_icon_name = ENCODE_UTF_8 (f->icon_name);
          }
 
 #ifdef USE_GTK
@@ -1606,9 +1613,21 @@
                               (char *) SDATA (encoded_name));
 #else /* not USE_GTK */
        XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text);
+       XChangeProperty (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
+                        FRAME_X_DISPLAY_INFO (f)->Xatom_net_wm_name,
+                        FRAME_X_DISPLAY_INFO (f)->Xatom_UTF8_STRING,
+                        8, PropModeReplace,
+                        (char *) SDATA (encoded_name),
+                        SBYTES (encoded_name));
 #endif /* not USE_GTK */
 
        XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &icon);
+       XChangeProperty (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
+                        FRAME_X_DISPLAY_INFO (f)->Xatom_net_wm_icon_name,
+                        FRAME_X_DISPLAY_INFO (f)->Xatom_UTF8_STRING,
+                        8, PropModeReplace,
+                        (char *) SDATA (encoded_icon_name),
+                        SBYTES (encoded_icon_name));
 
        if (do_free_icon_value)
          xfree (icon.value);

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2010-07-05 09:55:11 +0000
+++ b/src/xterm.c       2010-07-05 10:28:27 +0000
@@ -10207,6 +10207,10 @@
     = XInternAtom (dpyinfo->display, "_NET_WM_WINDOW_TYPE", False);
   dpyinfo->Xatom_net_window_type_tooltip
     = XInternAtom (dpyinfo->display, "_NET_WM_WINDOW_TYPE_TOOLTIP", False);
+  dpyinfo->Xatom_net_wm_icon_name
+    = XInternAtom (dpyinfo->display, "_NET_WM_ICON_NAME", False);
+  dpyinfo->Xatom_net_wm_name
+    = XInternAtom (dpyinfo->display, "_NET_WM_NAME", False);
   
   dpyinfo->cut_buffers_initialized = 0;
 

=== modified file 'src/xterm.h'
--- a/src/xterm.h       2010-07-02 09:26:33 +0000
+++ b/src/xterm.h       2010-07-05 10:28:27 +0000
@@ -370,6 +370,9 @@
   /* XSettings atoms and windows.  */
   Atom Xatom_xsettings_sel, Xatom_xsettings_prop, Xatom_xsettings_mgr;
   Window xsettings_window;
+
+  /* Frame name and icon name */
+  Atom Xatom_net_wm_name, Xatom_net_wm_icon_name;
 };
 
 #ifdef HAVE_X_I18N


reply via email to

[Prev in Thread] Current Thread [Next in Thread]