Skip to content

Commit

Permalink
Revert of After chromium stop using gtk+ for Linux/X11 all not ASCII …
Browse files Browse the repository at this point in the history
…character in window title start looks li… (https://codereview.chromium.org/414413002/)

Reason for revert:
Speculative revert to fix "_XTextListToTextProperty" leaking on Linux ASan LSan bots:
http://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Tests%20%281%29/builds/4397
http://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Tests%20%282%29/builds/5466
http://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Tests%20%283%29/builds/5797

Original issue's description:
> After chromium stop using gtk+ for Linux/X11 all not ASCII character in window title start looks like garbage. This patch fixes this issue, by using algorithm similar to gtk+/Qt's way of setting window titles.
> 
> BUG=378096
> R=erg@chromium.org
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=286058

TBR=erg@chromium.org,dushistov@gmail.com
NOTREECHECKS=true
NOTRY=true
BUG=378096

Review URL: https://codereview.chromium.org/428823003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286101 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
hashimoto@chromium.org committed Jul 29, 2014
1 parent 230dfb6 commit 20e37e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
1 change: 0 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ Etienne Laurin <etienne@atnnn.com>
Evan Peterson <evan.peterson.ep@gmail.com>
Evan Wallace <evan.exe@gmail.com>
Evangelos Foutras <evangelos@foutrelis.com>
Evgeniy Dushistov <dushistov@gmail.com>
Fabien Tassin <fta@sofaraway.org>
Felix H. Dahlke <fhd@ubercode.de>
Fernando Jiménez Moreno <ferjmoreno@gmail.com>
Expand Down
21 changes: 5 additions & 16 deletions ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -627,22 +627,11 @@ bool DesktopWindowTreeHostX11::SetWindowTitle(const base::string16& title) {
PropModeReplace,
reinterpret_cast<const unsigned char*>(utf8str.c_str()),
utf8str.size());
XTextProperty xtp;
char *c_utf8_str = const_cast<char *>(utf8str.c_str());
const int err =
Xutf8TextListToTextProperty(xdisplay_, &c_utf8_str, 1,
XCompoundTextStyle, &xtp);
if (err != Success) {
const std::string ascii_str = base::UTF16ToASCII(title);
xtp.encoding = XA_STRING;
xtp.format = 8;
xtp.value = reinterpret_cast<unsigned char *>
(const_cast<char *>(ascii_str.c_str()));
xtp.nitems = ascii_str.size();
XSetWMName(xdisplay_, xwindow_, &xtp);
} else {
XSetWMName(xdisplay_, xwindow_, &xtp);
}
// TODO(erg): This is technically wrong. So XStoreName and friends expect
// this in Host Portable Character Encoding instead of UTF-8, which I believe
// is Compound Text. This shouldn't matter 90% of the time since this is the
// fallback to the UTF8 property above.
XStoreName(xdisplay_, xwindow_, utf8str.c_str());
return true;
}

Expand Down

0 comments on commit 20e37e8

Please sign in to comment.