Index: chrome/browser/ui/gtk/browser_window_gtk.cc |
diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc |
index ac24d2c07b125a66db2e854086743b46a78b0a32..afa5015eaa1a4afae14962138de0e3012a10bfdf 100644 |
--- a/chrome/browser/ui/gtk/browser_window_gtk.cc |
+++ b/chrome/browser/ui/gtk/browser_window_gtk.cc |
@@ -11,11 +11,13 @@ |
#include "base/base_paths.h" |
#include "base/command_line.h" |
+#include "base/environment.h" |
#include "base/i18n/file_util_icu.h" |
#include "base/logging.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/singleton.h" |
#include "base/message_loop.h" |
+#include "base/nix/xdg_util.h" |
#include "base/path_service.h" |
#include "base/string_util.h" |
#include "base/time.h" |
@@ -325,9 +327,26 @@ void BrowserWindowGtk::Init() { |
std::string app_name = browser_->app_name(); |
if (app_name != DevToolsWindow::kDevToolsApp) { |
std::string wmclassname = web_app::GetWMClassFromAppName(app_name); |
- gtk_window_set_wmclass(window_, |
- wmclassname.c_str(), |
- gdk_get_program_class()); |
+ |
+ scoped_ptr<base::Environment> env(base::Environment::Create()); |
+ if (base::nix::GetDesktopEnvironment(env.get()) == |
+ base::nix::DESKTOP_ENVIRONMENT_XFCE) { |
Marco Trevisan (Treviño)
2011/04/21 21:02:29
If you prefer you can also mix these two cases int
Elliot Glaysher
2011/04/21 21:25:17
I don't think that helps. The whole point is that
|
+ // Workaround for XFCE. XFCE seems to treat the class as a user |
+ // displayed title, which our app name certainly isn't. They don't have |
+ // a dock or application based behaviour so do what looks good. |
Evan Martin
2011/04/21 20:54:34
Relevant docs:
http://developer.gimp.org/api/2.0/g
Daniel Erat
2011/04/21 21:10:28
(Sorry if I'm stating stuff that you guys already
Elliot Glaysher
2011/04/21 21:23:31
It's not setting the window title; xfce's alt-tab
|
+ gtk_window_set_wmclass(window_, |
+ wmclassname.c_str(), |
+ gdk_get_program_class()); |
+ } else { |
+ // Most everything else uses the wmclass_class to group windows |
+ // together (docks, per application stuff, etc). Hopefully they won't |
+ // display wmclassname to the user. |
+ gtk_window_set_wmclass(window_, |
+ window_->wmclass_name, |
+ wmclassname.c_str()); |
+ } |
+ |
+ gtk_window_set_role(window_, wmclassname.c_str()); |
} |
} |