App Switcher (Alt+Tab) doesn't display the full title of apps in Chinese

Bug #830801 reported by Ding Zhou
98
This bug affects 20 people
Affects Status Importance Assigned to Milestone
Unity
Fix Released
Medium
Andrea Azzarone
unity (Ubuntu)
Fix Released
Medium
Andrea Azzarone
Precise
Fix Released
Medium
Andrea Azzarone

Bug Description

SRU case

TO BE TESTED BY REPORTER(dev)

System is Ubuntu 11.10 with latest update.

As the screenshot attached, the title of GNOME Terminal in Chinese should be "终端", but only "终" is showed. Other title is ok, such as "Firefox网络浏览".

I think there's something wrong while dealing with the text ellipsis.

Related branches

Revision history for this message
Ding Zhou (tualatrix) wrote :
Revision history for this message
Paul Sladen (sladen) wrote :

I tried to see if there was an easy way to replicate this in a non-CJK environment with eg:

  echo -n -e "\033]2;终端\007" ; sleep 10

but that didn't work as the New Alt-Tab Switcher is showing the Application title and not the window title.

Revision history for this message
Ding Zhou (tualatrix) wrote :

Thanks for your comment.

So I create a script to show a GTK App named "终端" to help test, please have a try :)

Revision history for this message
Ding Zhou (tualatrix) wrote :

Oh, it is more convenient to use zenity like this:

    zenity --entry --title=终端

Omer Akram (om26er)
Changed in unity:
status: New → Confirmed
Changed in unity (Ubuntu):
status: New → Confirmed
Revision history for this message
Ding Zhou (tualatrix) wrote :

This bug is still exist.

In Ubuntu 12.04, the "终" just becomes "终...", not the right "终端".

Revision history for this message
Elsa Wang (elsawang) wrote :

It's really ugly to display 显示桌面 as 显示桌...

summary: - App Switcher (New Alt+Tab) doesn't display the full title of apps in
- Chinese
+ App Switcher (Alt+Tab) doesn't display the full title of apps in Chinese
Revision history for this message
Anthony Wong (anthonywong) wrote :

I traced the code and suspect it is related to how DrawText in StaticCairoText.cpp uses a smaller width than expected.

In function GetTextExtents, for the case of a gnome-terminal window, logRect.width returns from pango_layout_get_extents is 28800. As PANGO_SCALE is 1024, variable width (logRect.width/PANGO_SCALE) is 28 as it's an int.

Later on in function DrawText, the value of variable width is used for pango_layout_set_width for the same text, which I think is not enough and thus ellipsis shows.

I am not familiar with pango but hopes this gives a direction to where the problem lies.

Omer Akram (om26er)
Changed in unity:
importance: Undecided → Low
Changed in unity (Ubuntu):
importance: Undecided → Low
Revision history for this message
Anthony Wong (anthonywong) wrote :

IHMO, this is a severe usability bug which affects all users who has Chinese as the UI language, so I think it should deserve High -- "a bug that has a severe impact on a small portion of Ubuntu users (estimated) or has a moderate impact on a large portion of Ubuntu users (estimated) ", could you re-evaluate the Importance? Anyway, I or Tualatrix will try to come up with a patch.

Revision history for this message
Ding Zhou (tualatrix) wrote :

I just tested with another example with long *English* title: seems the bug is not only happened in Chinese locale:

Please open your terminal then try this one line code:

python -c 'from gi.repository import Gtk;win=Gtk.Window(title="Hello World! I come from the earth, where are you come from?");win.connect("destroy", Gtk.main_quit);win.show_all();Gtk.main();'

Omer Akram (om26er)
Changed in unity:
importance: Low → Medium
Changed in unity (Ubuntu):
importance: Low → Medium
Revision history for this message
David Barth (dbarth) wrote :

Thanks for the code review. Sounds like something for Mirco'san.

Mirco Müller (macslow)
Changed in unity:
assignee: nobody → Mirco Müller (macslow)
milestone: none → backlog
Revision history for this message
Anthony Wong (anthonywong) wrote :

This patch can fix this bug.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "830801.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Anthony Wong (anthonywong) wrote :
Revision history for this message
Omer Akram (om26er) wrote :

@Anthony, I think a bzr branch to lp:unity would have a far more chance for more eyes to view your work.

Andrea Azzarone (azzar1)
Changed in unity:
assignee: Mirco Müller (macslow) → Andrea Azzarone (andyrock)
Changed in unity (Ubuntu):
assignee: nobody → Andrea Azzarone (andyrock)
Changed in unity:
milestone: backlog → 5.12.0
status: Confirmed → In Progress
Changed in unity (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Andrea Azzarone (azzar1) wrote :

@Anthony Thank you for the patch but we can use std::ceil. Look here: https://code.launchpad.net/~andyrock/unity/fix-830801

Andrea Azzarone (azzar1)
Changed in unity:
status: In Progress → Fix Committed
Changed in unity (Ubuntu):
status: In Progress → Fix Committed
Omer Akram (om26er)
description: updated
Changed in unity:
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Ding, or anyone else affected,

Accepted unity into precise-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
Anthony Wong (anthonywong) wrote :

The 5.12-0ubuntu1 unity in -proposed does fix the issue, thanks.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Ding Zhou (tualatrix) wrote :

I can confirm the Unity 5.12 has already fixed this issue. Thanks.

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (6.0 KiB)

This bug was fixed in the package unity - 5.12-0ubuntu1

---------------
unity (5.12-0ubuntu1) precise-proposed; urgency=low

  * New upstream release.
    - Launcher, Alt-Tab - clicking on launcher item or selecting a app in Alt-
      Tab raises all app windows, not just most recently focused (LP: #959339)
    - [heap corruption?] compiz crashed with SIGSEGV in _int_malloc() from
      g_realloc() from ... from g_dbus_connection_send_message_with_reply()
      from g_object_unref() from unity::dash::HomeLens::Impl::~Impl() from
      unity::dash::HomeLens::~HomeLens() (LP: #931201)
    - compiz crashed with SIGSEGV in _int_malloc() from __libc_calloc() from
      XOpenDisplay() from nux::WindowThread::ThreadCtor() (LP: #947844)
    - Regression: Installing apps causes a terrible visual glitch-- have to
      restart X.org. (LP: #981168)
    - Window management - unity doesn't realise when applications bring their
      windows to the front (LP: #802816)
    - Dash - Clicking on the desktop dash border should do nothing, *NOT*
      close the dash (LP: #839472)
    - [FFe, UIFe] HUD - The HUD does not respect launcher icon size settings
      in autohide mode (LP: #921506)
    - compiz crashed with SIGSEGV in g_volume_get_mount() (LP: #918548)
    - multiple instances or double icons of application detected on bamfdaemon
      respawn (LP: #928912)
    - Panel is transparent when Dash is open; no blur no average BG color
      (LP: #965323)
    - Unity crashes with SIGSEGV when hitting debug DBus interface hard
      (LP: #979429)
    - compiz crashed with SIGSEGV in _int_malloc() from g_object_unref() from
      unity::dash::Model<unity::dash::FilterAdaptor>::~Model() (LP: #941750)
    - indicators menu are sometimes cut off at screen edge (LP: #883317)
    - the shortcut keys in workspace section of the shortcut overlay aren't
      translated (LP: #980828)
    - [regression] Dash keeps repainting unnecessarily (LP: #980924)
    - compiz crashed with SIGSEGV in nux::NTextureData::ClearData() from
      nux::NTextureData::~NTextureData() from nux::Texture2D::~Texture2D()
      (LP: #952378)
    - compiz crashed with SIGSEGV in g_object_unref() from
      unity::dash::Settings::~Settings() from
      unity::UnityScreen::~UnityScreen() (LP: #981764)
    - compiz crashed with SIGSEGV in unity::dash::ResultView::~ResultView()
      from unity::dash::ResultViewGrid::~ResultViewGrid() from
      nux::Object::Destroy() from nux::Object::UnReference() (LP: #942286)
    - compiz crashed with SIGSEGV in
      ends_with_iter_select<__gnu_cxx::__normal_iterator<char const*,
      std::basic_string<char> >, char const*, boost::algorithm::is_iequal>()
      from unity::ui::PointerBarrierWrapper::EmitCurrentData() (LP: #983268)
    - Chinese can't be shown completely in dash filter (LP: #984583)
    - [Unity 5.10] compiz crashed with SIGSEGV in
      unity::hud::HudIconTextureSource::ColorForIcon() from
      unity::hud::Icon::Icon() from emit from unity::IconTexture::IconLoaded
      (LP: #983646)
    - [regression] Close button does not close the dash/HUD (LP: #986264)
    - compiz crashed with SIGSEGV in g_volume_eject_with_operation_finish()
      fro...

Read more...

Changed in unity (Ubuntu):
status: Fix Committed → Fix Released
Changed in unity (Ubuntu Precise):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.