Commit f5b2b513 authored by mithro's avatar mithro Committed by Commit bot

Provide a default role for "bubble" windows.

This provides a default WM_ROLE property for "bubble" windows in a similar
manner to how "popup" windows do.

BUG=427430

Review URL: https://codereview.chromium.org/693113002

Cr-Commit-Position: refs/heads/master@{#302589}
parent 2eeec685
...@@ -121,6 +121,9 @@ const char* kAtomsToCache[] = { ...@@ -121,6 +121,9 @@ const char* kAtomsToCache[] = {
NULL NULL
}; };
const char kX11WindowRolePopup[] = "popup";
const char kX11WindowRoleBubble[] = "bubble";
} // namespace } // namespace
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
...@@ -1185,12 +1188,26 @@ void DesktopWindowTreeHostX11::InitX11Window( ...@@ -1185,12 +1188,26 @@ void DesktopWindowTreeHostX11::InitX11Window(
ui::SetWindowClassHint( ui::SetWindowClassHint(
xdisplay_, xwindow_, params.wm_class_name, params.wm_class_class); xdisplay_, xwindow_, params.wm_class_name, params.wm_class_class);
} }
if (!params.wm_role_name.empty() ||
params.type == Widget::InitParams::TYPE_POPUP) { const char* wm_role_name = NULL;
const char kX11WindowRolePopup[] = "popup"; // If the widget isn't overriding the role, provide a default value for popup
ui::SetWindowRole(xdisplay_, xwindow_, params.wm_role_name.empty() ? // and bubble types.
std::string(kX11WindowRolePopup) : params.wm_role_name); if (!params.wm_role_name.empty()) {
wm_role_name = params.wm_role_name.c_str();
} else {
switch (params.type) {
case Widget::InitParams::TYPE_POPUP:
wm_role_name = kX11WindowRolePopup;
break;
case Widget::InitParams::TYPE_BUBBLE:
wm_role_name = kX11WindowRoleBubble;
break;
default:
break;
}
} }
if (wm_role_name)
ui::SetWindowRole(xdisplay_, xwindow_, std::string(wm_role_name));
if (params.remove_standard_frame) { if (params.remove_standard_frame) {
// Setting _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED tells gnome-shell to not force // Setting _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED tells gnome-shell to not force
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment