「xfwm4のタイトルにホスト名が表示される」の編集履歴(バックアップ)一覧はこちら
追加された行は緑色になります。
削除された行は赤色になります。
*xfwm4のタイトルにホスト名が表示される@Xfce4.4
wfwm4でhostnameを変更してから新規ウィンドウを開くと
>xterm ( ホスト newhost )
と変更したホスト名が表示されるようになる(通常名xxxのみ)
shellはbashだったので、以下の方法でタイトルを編集してみたが
>echo -e "\033]2; Test Title. \007"
やはりホスト名が表示される
>Test Title. ( ホスト newhost )
xfwm4をdebugモードでビルドして動かした時のログを見ると
>client.c clientFrame(): client "xterm (on newhost)" (0x60000e) is not managed
こんなログが出ていた
client.cで上のログを出力している個所を検索すると
>Client *
>clientFrame (DisplayInfo *display_info, Window w, >gboolean recapture)
>{
> :
> DBG ("client \"%s\" (0x%lx) is now managed", c->name, c->window);
> DBG ("client_count=%d", screen_info->client_count);
>
> return c;
>}
この関数でそれっぽい所(名前を入れてそうな所)を探すと
> getWindowName (display_info, c->window, &c->name);
こんな関数が
>~hints.c~
>gboolean
>getWindowName (DisplayInfo *display_info, Window w, gchar **title)
>{
> :
> if (getUTF8StringData (display_info, w, NET_WM_NAME, &str, &len) ||
> (str = get_text_property (display_info, w, XA_WM_NAME)))
> {
> name = internal_utf8_strndup (str, MAX_STR_LENGTH);
> *title = create_name_with_host (display_info, name, machine);
> g_free (name);
> XFree (str);
> status = TRUE;
> }
> else
> {
> *title = g_strdup ("");
> }
> :
>static gchar*
>create_name_with_host (DisplayInfo *display_info, const gchar *name, const gchar *hostname)
>{
> gchar *title;
>
> if (strlen (hostname) && (display_info->hostname) && (g_strcasecmp (display_info->hostname, hostname)))
> {
> /* TRANSLATORS: "(on %s)" is like "running on" the name of the other host */
> title = g_strdup_printf (_("%s (on %s)"), name, hostname);
> }
> else
> {
> title = g_strdup (name);
> }
>
> return title;
>}
この処理でhostnameを追加しているっぽい
>title = g_strdup_printf (_("%s (on %s)"), name, hostname);
ここを
>title = g_strdup (name);
こうしてやることでhostnameを変更してもタイトルに表示されなくなった