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

Unified Diff: ui/aura/window_tree_host_x11.cc

Issue 2501763005: set WM_CLASS in X11 window host. (Closed)
Patch Set: Created 4 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/aura/window_tree_host_x11.cc
diff --git a/ui/aura/window_tree_host_x11.cc b/ui/aura/window_tree_host_x11.cc
index 37efdf4b65b98773ed5e6c2d276d375c6a7f76bc..a9a23d441163d9e057d9f189e2152e949fb5feb7 100644
--- a/ui/aura/window_tree_host_x11.cc
+++ b/ui/aura/window_tree_host_x11.cc
@@ -157,9 +157,14 @@ WindowTreeHostX11::WindowTreeHostX11(const gfx::Rect& bounds)
protocols[1] = atom_cache_.GetAtom("_NET_WM_PING");
XSetWMProtocols(xdisplay_, xwindow_, protocols, 2);
+ XClassHint* class_hint = XAllocClassHint();
+ class_hint->res_name = const_cast<char*>("chromiumos");
+ class_hint->res_class = const_cast<char*>("ChromiumOS");
// We need a WM_CLIENT_MACHINE and WM_LOCALE_NAME value so we integrate with
// the desktop environment.
- XSetWMProperties(xdisplay_, xwindow_, NULL, NULL, NULL, 0, NULL, NULL, NULL);
+ XSetWMProperties(xdisplay_, xwindow_, NULL, NULL, NULL, 0, NULL, NULL,
+ class_hint);
+ XFree(class_hint);
sadrul 2016/11/16 00:29:44 Can you use ui::SetWindowClassHint() instead?
Muyuan 2016/11/16 00:51:43 Done.
// Likewise, the X server needs to know this window's pid so it knows which
// program to kill if the window hangs.
« 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