From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: James Cloos Newsgroups: gmane.emacs.bugs Subject: bug#6563: [PATCH] 24.0.50; Set EWMH WM NAME properties Date: Sun, 04 Jul 2010 13:18:22 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1278264597 30918 80.91.229.12 (4 Jul 2010 17:29:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 4 Jul 2010 17:29:57 +0000 (UTC) To: 6563@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 04 19:29:56 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 1OVT0q-0004Wq-Qz for geb-bug-gnu-emacs@m.gmane.org; Sun, 04 Jul 2010 19:29:53 +0200 Original-Received: from localhost ([127.0.0.1]:48001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OVT0q-0000Ah-96 for geb-bug-gnu-emacs@m.gmane.org; Sun, 04 Jul 2010 13:29:52 -0400 Original-Received: from [140.186.70.92] (port=34689 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OVT0l-0000AT-5O for bug-gnu-emacs@gnu.org; Sun, 04 Jul 2010 13:29:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OVT0j-0007sv-LF for bug-gnu-emacs@gnu.org; Sun, 04 Jul 2010 13:29:47 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36686) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVT0j-0007sp-Jl for bug-gnu-emacs@gnu.org; Sun, 04 Jul 2010 13:29:45 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OVSrL-0001v5-Cw; Sun, 04 Jul 2010 13:20:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: James Cloos Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Jul 2010 17:20:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6563 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.12782639527365 (code B ref -1); Sun, 04 Jul 2010 17:20:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Jul 2010 17:19:12 +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 1OVSqV-0001uk-OQ for submit@debbugs.gnu.org; Sun, 04 Jul 2010 13:19:12 -0400 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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= Original-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) 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 Original-Lines: 123 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 04 Jul 2010 13:20:03 -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:38223 Archived-At: 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;