From: Cheng Zhao Date: Mon, 24 Nov 2014 07:23:02 +0000 (+0800) Subject: linux: Set WM_WINDOW_ROLE correctly X-Git-Tag: v0.19.5~13^2~2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=60bd20872cb3540cf20b2f39d4d43d805aec0f7a;p=electron.git linux: Set WM_WINDOW_ROLE correctly WM_WINDOW_ROLE is used to specify the "role" of the window, and all browser windows in atom-shell should have the same role. --- diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index eb5f31d4..7136efcc 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -35,7 +35,6 @@ #include "atom/browser/ui/x/x_window_utils.h" #include "base/environment.h" #include "base/nix/xdg_util.h" -#include "base/strings/stringprintf.h" #include "chrome/browser/ui/libgtk2ui/unity_service.h" #include "dbus/bus.h" #include "dbus/object_proxy.h" @@ -63,10 +62,6 @@ const int kMenuBarHeight = 25; #endif #if defined(USE_X11) -// Counts how many window has already been created, it will be used to set the -// window role for X11. -int kWindowsCreated = 0; - // Returns true if the bus name "com.canonical.AppMenu.Registrar" is available. bool ShouldUseGlobalMenuBar() { dbus::Bus::Options options; @@ -183,9 +178,7 @@ NativeWindowViews::NativeWindowViews(content::WebContents* web_contents, #if defined(USE_X11) // Set WM_WINDOW_ROLE. - params.wm_role_name = base::StringPrintf( - "%s/%s/%d", "Atom Shell", Browser::Get()->GetName().c_str(), - ++kWindowsCreated); + params.wm_role_name = "atom-shell app"; // Set WM_CLASS. params.wm_class_name = "atom"; params.wm_class_class = "Atom";