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

Unified Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc

Issue 693113002: Provide a default role for "bubble" windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing requested changes. Created 6 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/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
index a6f120943f57de515556c227b84f04f8f253b208..841466813dc742fac87054a2d69105181a5b410c 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -121,6 +121,9 @@ const char* kAtomsToCache[] = {
NULL
};
+const char kX11WindowRolePopup[] = "popup";
+const char kX11WindowRoleBubble[] = "bubble";
+
} // namespace
////////////////////////////////////////////////////////////////////////////////
@@ -1185,12 +1188,26 @@ void DesktopWindowTreeHostX11::InitX11Window(
ui::SetWindowClassHint(
xdisplay_, xwindow_, params.wm_class_name, params.wm_class_class);
}
- if (!params.wm_role_name.empty() ||
- params.type == Widget::InitParams::TYPE_POPUP) {
- const char kX11WindowRolePopup[] = "popup";
- ui::SetWindowRole(xdisplay_, xwindow_, params.wm_role_name.empty() ?
- std::string(kX11WindowRolePopup) : params.wm_role_name);
+
+ const char* wm_role_name = NULL;
+ // If the widget isn't overriding the role, provide a default value for popup
+ // and bubble types.
+ 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) {
// Setting _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED tells gnome-shell to not force
« 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