Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(927)

Unified Diff: ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc

Issue 68523019: linux_aura: Set the UTF-8 version of the window title. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc
diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc
index bd0223923f4ae730f5f7dc836d99dd9984a98549..22e73935bb388d036de204c3e2afa6b4e2a5136d 100644
--- a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc
@@ -72,10 +72,12 @@ const int k_NET_WM_STATE_ADD = 1;
const int k_NET_WM_STATE_REMOVE = 0;
const char* kAtomsToCache[] = {
+ "UTF8_STRING",
"WM_DELETE_WINDOW",
"WM_PROTOCOLS",
"WM_S0",
"_NET_WM_ICON",
+ "_NET_WM_NAME",
"_NET_WM_PID",
"_NET_WM_PING",
"_NET_WM_STATE",
@@ -512,7 +514,22 @@ bool DesktopRootWindowHostX11::IsAlwaysOnTop() const {
}
void DesktopRootWindowHostX11::SetWindowTitle(const string16& title) {
- XStoreName(xdisplay_, xwindow_, UTF16ToUTF8(title).c_str());
+ std::string utf8str = UTF16ToUTF8(title);
+
+ XChangeProperty(xdisplay_,
+ xwindow_,
+ atom_cache_.GetAtom("_NET_WM_NAME"),
+ atom_cache_.GetAtom("UTF8_STRING"),
+ 8,
+ PropModeReplace,
+ reinterpret_cast<const unsigned char*>(utf8str.c_str()),
+ utf8str.size());
+
+ // 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());
}
void DesktopRootWindowHostX11::ClearNativeFocus() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698