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

Unified Diff: ui/base/x/x11_util.cc

Issue 23093020: Set the WM_CLASS property of X11 windows in Linux Aura build. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Respond to reviews. Created 7 years, 4 months 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
Index: ui/base/x/x11_util.cc
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc
index 3a1ced1533fdda64690c1eeec798df6346d03a95..44d8d2885a131d92e2c438062a9d1ff4b1eec054 100644
--- a/ui/base/x/x11_util.cc
+++ b/ui/base/x/x11_util.cc
@@ -1012,6 +1012,19 @@ Atom GetAtom(const char* name) {
#endif
}
+void SetWindowClassHint(Display* display,
+ XID window,
+ std::string res_name,
+ std::string res_class) {
+ XClassHint class_hints;
+ // const_cast is safe because XSetClassHint does not modify the strings.
+ // Just to be safe, the res_name and res_class parameters are local copies,
+ // not const references.
+ class_hints.res_name = const_cast<char*>(res_name.c_str());
+ class_hints.res_class = const_cast<char*>(res_class.c_str());
+ XSetClassHint(display, window, &class_hints);
+}
+
XID GetParentWindow(XID window) {
XID root = None;
XID parent = None;

Powered by Google App Engine
This is Rietveld 408576698