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

Unified Diff: chrome/browser/ui/gtk/browser_window_gtk.cc

Issue 6902003: Merge 82581 - GTK: Set WMCLASS in a way docks notice while still solving display issues on XFCE.B... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/742/src/
Patch Set: Created 9 years, 8 months 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: chrome/browser/ui/gtk/browser_window_gtk.cc
===================================================================
--- chrome/browser/ui/gtk/browser_window_gtk.cc (revision 82895)
+++ chrome/browser/ui/gtk/browser_window_gtk.cc (working copy)
@@ -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"
@@ -324,9 +326,26 @@
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) {
+ // 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.
+ 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());
}
}
« 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