linux: Add a way to set WM_CLASS for devtools window
This commit is contained in:
parent
601ee75bcf
commit
06eff5cd8c
2 changed files with 14 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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(¶ms.wm_class_name, ¶ms.wm_class_class);
|
||||
#endif
|
||||
|
||||
devtools_window_->Init(params);
|
||||
devtools_window_->UpdateWindowIcon();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue