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

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

Issue 6879127: GTK: Set WMCLASS in a way docks notice while still solving display issues on XFCE. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/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
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());
}
}
« 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