linux: Add a way to set WM_CLASS for devtools window

This commit is contained in:
Cheng Zhao 2014-11-24 16:03:55 +08:00
parent 601ee75bcf
commit 06eff5cd8c
2 changed files with 14 additions and 0 deletions

View file

@ -19,6 +19,12 @@ class InspectableWebContentsDelegate {
const std::string& url, const std::string& content, bool save_as) {}
virtual void DevToolsAppendToFile(
const std::string& url, const std::string& content) {}
#if defined(USE_X11)
// Called when creating devtools window.
virtual void GetDevToolsWindowWMClass(
std::string* name, std::string* class_name) {}
#endif
};
} // namespace brightray

View file

@ -147,6 +147,14 @@ void InspectableWebContentsViewViews::SetIsDocked(bool docked) {
devtools_window_web_view_,
devtools_window_.get());
params.bounds = inspectable_web_contents()->GetDevToolsBounds();
#if defined(USE_X11)
params.wm_role_name = "devtools";
InspectableWebContentsDelegate* delegate = inspectable_web_contents()->GetDelegate();
if (delegate)
delegate->GetDevToolsWindowWMClass(&params.wm_class_name, &params.wm_class_class);
#endif
devtools_window_->Init(params);
devtools_window_->UpdateWindowIcon();
}