From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Newsgroups: gmane.emacs.bugs Subject: bug#6563: [PATCH] 24.0.50; Set EWMH WM NAME properties Date: Mon, 05 Jul 2010 12:31:31 +0200 Message-ID: <4C31B483.8050806@swipnet.se> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1278327600 7560 80.91.229.12 (5 Jul 2010 11:00:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 5 Jul 2010 11:00:00 +0000 (UTC) Cc: 6563-done@debbugs.gnu.org To: James Cloos Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 05 12:59:58 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OVjP4-0001Cg-A0 for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Jul 2010 12:59:58 +0200 Original-Received: from localhost ([127.0.0.1]:58185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OVjP3-0002U8-IM for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Jul 2010 06:59:57 -0400 Original-Received: from [140.186.70.92] (port=59469 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OVjOw-0002Tb-LB for bug-gnu-emacs@gnu.org; Mon, 05 Jul 2010 06:59:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OVjOu-0002zx-Px for bug-gnu-emacs@gnu.org; Mon, 05 Jul 2010 06:59:50 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51268) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVjOu-0002zo-O5 for bug-gnu-emacs@gnu.org; Mon, 05 Jul 2010 06:59:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OViy2-00014s-MK for bug-gnu-emacs@gnu.org; Mon, 05 Jul 2010 06:32:02 -0400 Resent-From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Jul 2010 10:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 6563 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 6563@debbugs.gnu.org, jan.h.d@swipnet.se Original-Received: via spool by 6563-done@debbugs.gnu.org id=D6563.12783259034135 (code D ref 6563); Mon, 05 Jul 2010 10:32:02 +0000 Original-Received: (at 6563-done) by debbugs.gnu.org; 5 Jul 2010 10:31:43 +0000 Original-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 Original-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 Original-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" Original-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 Original-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) 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 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 05 Jul 2010 06:32:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:38232 Archived-At: 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; > > > >