From unknown Sat Aug 16 10:44:47 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#6563 <6563@debbugs.gnu.org> To: bug#6563 <6563@debbugs.gnu.org> Subject: Status: [PATCH] 24.0.50; Set EWMH WM NAME properties Reply-To: bug#6563 <6563@debbugs.gnu.org> Date: Sat, 16 Aug 2025 17:44:47 +0000 retitle 6563 [PATCH] 24.0.50; Set EWMH WM NAME properties reassign 6563 emacs submitter 6563 James Cloos severity 6563 normal tag 6563 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 04 13:19:12 2010 Received: (at submit) by debbugs.gnu.org; 4 Jul 2010 17:19:12 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVSqV-0001uk-OQ for submit@debbugs.gnu.org; Sun, 04 Jul 2010 13:19:12 -0400 Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVSqU-0001uf-Gh for submit@debbugs.gnu.org; Sun, 04 Jul 2010 13:19:11 -0400 Received: from lists.gnu.org ([199.232.76.165]:36278) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OVSqP-0007yY-T3 for submit@debbugs.gnu.org; Sun, 04 Jul 2010 13:19:05 -0400 Received: from [140.186.70.92] (port=60759 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OVSqO-0006qV-7x for bug-gnu-emacs@gnu.org; Sun, 04 Jul 2010 13:19:05 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OVSqM-0006SX-21 for bug-gnu-emacs@gnu.org; Sun, 04 Jul 2010 13:19:04 -0400 Received: from eagle.jhcloos.com ([207.210.242.212]:44904) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVSqL-0006SE-Sl for bug-gnu-emacs@gnu.org; Sun, 04 Jul 2010 13:19:01 -0400 Received: by eagle.jhcloos.com (Postfix, from userid 10) id C9D53401EE; Sun, 4 Jul 2010 17:18:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jhcloos.com; s=eagle; t=1278263939; bh=NHbGCToI/GWoBGlOYhC1SRNslUYt2fhkHN3mPEzLjho=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=iG69xPt+fYJPZrS/77i7AE3Pua/MGXKF1T6359SnGCYCfeeozB+TDaIzQtSV09pJD ArXKxaLHYkz8230XWUEX8RZJT6tEFryIX7o0W8c6NKDxOQ465BYvKdVler4a1TmeDu 235af/WoN+105osrKm6e8PMBUM1gboNL6QMvwj0w= Received: from carbon.jhcloos.org (localhost [127.0.0.1]) by carbon.jhcloos.org (Postfix) with ESMTP id 724161C81FD for ; Sun, 4 Jul 2010 17:18:22 +0000 (UTC) From: James Cloos To: bug-gnu-emacs@gnu.org Subject: [PATCH] 24.0.50; Set EWMH WM NAME properties User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Face: iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAI1J REFUOE+lU9ESgCAIg64P1y+ngUdxhl5H8wFbbM0OmUiEhKkCYaZThXCo6KE5sCbA1DDX3genvO4d eBQgEMaM5qy6uWk4SfBYfdu9jvBN9nSVDOKRtwb+I3epboOsOX5pZbJNsBJFvmQQ05YMfieIBnYX FK2N6dOawd97r/e8RjkTLzmMsiVgrAoEugtviCM3v2WzjgAAAABJRU5ErkJggg== Copyright: Copyright 2009 James Cloos OpenPGP: ED7DAEA6; url=http://jhcloos.com/public_key/0xED7DAEA6.asc OpenPGP-Fingerprint: E9E9 F828 61A4 6EA9 0F2B 63E7 997A 9F17 ED7D AEA6 Date: Sun, 04 Jul 2010 13:18:22 -0400 Message-ID: Lines: 123 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.3 (----) When compiled with gtk+, by calling gtk_window_set_title(), Emacs sets both the WM_NAME, WM_ICON_NAME and the _NET_WM_NAME, _NET_WM_ICON_NAME properties. Many current window managers prefer the _NET properties, which are defined to always be UTF8_STRING. Some may even lack support for COMPOUND_TEXT. Like the _NET_* properties which Emacs already supports, _NET_WM_NAME and _NET_WM_ICON_NAME are specified at: http://specs.freedesktop.org/wm-spec/wm-spec-latest.html The patch adds support for the _NET_WM_NAME and _NET_WM_ICON_NAME properties to the non-gtk+ builds. === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-03 14:35:54 +0000 +++ src/ChangeLog 2010-07-04 17:09:04 +0000 @@ -1,3 +1,12 @@ +2010-07-04 James Cloos * msdos.c (IT_set_frame_parameters): Fix setting of colors in === modified file 'src/xfns.c' --- src/xfns.c 2010-07-02 12:19:29 +0000 +++ src/xfns.c 2010-07-04 16:32:36 +0000 @@ -1613,8 +1613,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, @@ -1622,7 +1622,6 @@ GCPRO1 (name); encoded_name = ENCODE_UTF_8 (name); UNGCPRO; -#endif coding_system = Qcompound_text; /* Note: Encoding strategy @@ -1638,7 +1637,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 @@ -1649,6 +1653,7 @@ if (!STRINGP (f->icon_name)) { icon = text; + encoded_icon_name = encoded_name; } else { @@ -1659,6 +1664,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 @@ -1666,9 +1673,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' --- src/xterm.c 2010-07-02 12:19:29 +0000 +++ src/xterm.c 2010-07-04 16:32:36 +0000 @@ -10493,6 +10493,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; From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 06:31:43 2010 Received: (at 6563-done) by debbugs.gnu.org; 5 Jul 2010 10:31:43 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVixi-00014e-N7 for submit@debbugs.gnu.org; Mon, 05 Jul 2010 06:31:43 -0400 Received: from smtprelay-h32.telenor.se ([213.150.131.5]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVixf-00014Y-JX for 6563-done@debbugs.gnu.org; Mon, 05 Jul 2010 06:31:40 -0400 Received: from ipb3.telenor.se (ipb3.telenor.se [195.54.127.166]) by smtprelay-h32.telenor.se (Postfix) with ESMTP id 82F1EEA2EE for <6563-done@debbugs.gnu.org>; Mon, 5 Jul 2010 12:31:33 +0200 (CEST) X-SENDER-IP: [85.225.45.35] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai4wAAdRMUxV4S0jPGdsb2JhbACfbQwBAQEBNS29P4UlBA X-IronPort-AV: E=Sophos;i="4.53,539,1272837600"; d="scan'208";a="542516746" Received: from c-232de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.35]) by ipb3.telenor.se with ESMTP; 05 Jul 2010 12:31:33 +0200 Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 127A57FA05A; Mon, 5 Jul 2010 12:31:32 +0200 (CEST) Message-ID: <4C31B483.8050806@swipnet.se> Date: Mon, 05 Jul 2010 12:31:31 +0200 From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.4) Gecko/20100608 Thunderbird/3.1 MIME-Version: 1.0 To: James Cloos Subject: Re: bug#6563: [PATCH] 24.0.50; Set EWMH WM NAME properties References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 6563-done Cc: 6563-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) Applied, thanks. Jan D. James Cloos skrev 2010-07-04 19.18: > When compiled with gtk+, by calling gtk_window_set_title(), Emacs sets > both the WM_NAME, WM_ICON_NAME and the _NET_WM_NAME, _NET_WM_ICON_NAME > properties. > > Many current window managers prefer the _NET properties, which are > defined to always be UTF8_STRING. Some may even lack support for > COMPOUND_TEXT. > > Like the _NET_* properties which Emacs already supports, _NET_WM_NAME > and _NET_WM_ICON_NAME are specified at: > > http://specs.freedesktop.org/wm-spec/wm-spec-latest.html > > The patch adds support for the _NET_WM_NAME and _NET_WM_ICON_NAME > properties to the non-gtk+ builds. > > === modified file 'src/ChangeLog' > --- src/ChangeLog 2010-07-03 14:35:54 +0000 > +++ src/ChangeLog 2010-07-04 17:09:04 +0000 > @@ -1,3 +1,12 @@ > +2010-07-04 James Cloos + > + * 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-03 Eli Zaretskii > > * msdos.c (IT_set_frame_parameters): Fix setting of colors in > > === modified file 'src/xfns.c' > --- src/xfns.c 2010-07-02 12:19:29 +0000 > +++ src/xfns.c 2010-07-04 16:32:36 +0000 > @@ -1613,8 +1613,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, > @@ -1622,7 +1622,6 @@ > GCPRO1 (name); > encoded_name = ENCODE_UTF_8 (name); > UNGCPRO; > -#endif > > coding_system = Qcompound_text; > /* Note: Encoding strategy > @@ -1638,7 +1637,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 > @@ -1649,6 +1653,7 @@ > if (!STRINGP (f->icon_name)) > { > icon = text; > + encoded_icon_name = encoded_name; > } > else > { > @@ -1659,6 +1664,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 > @@ -1666,9 +1673,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' > --- src/xterm.c 2010-07-02 12:19:29 +0000 > +++ src/xterm.c 2010-07-04 16:32:36 +0000 > @@ -10493,6 +10493,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; > > > > From unknown Sat Aug 16 10:44:47 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 02 Aug 2010 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator