summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-29 04:59:13 +0000
committerhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-29 04:59:13 +0000
commit20e37e874b2a1415609b5c1cf58ba2d18b516262 (patch)
tree9004e6f474dfdef11db827ed1965b9b3ee171cc2
parent230dfb6cbbe2dae26ddf6e88d9f3c804d20b1a01 (diff)
downloadchromium_src-20e37e874b2a1415609b5c1cf58ba2d18b516262.zip
chromium_src-20e37e874b2a1415609b5c1cf58ba2d18b516262.tar.gz
chromium_src-20e37e874b2a1415609b5c1cf58ba2d18b516262.tar.bz2
Revert of After chromium stop using gtk+ for Linux/X11 all not ASCII 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
-rw-r--r--AUTHORS1
-rw-r--r--ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc21
2 files changed, 5 insertions, 17 deletions
diff --git a/AUTHORS b/AUTHORS
index 495f296..901f307 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -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>
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
index 852fa2d..cae42de 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -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;
}