11 |
|
|
12 |
#include "base/base_paths.h" |
#include "base/base_paths.h" |
13 |
#include "base/command_line.h" |
#include "base/command_line.h" |
14 |
|
#include "base/environment.h" |
15 |
#include "base/i18n/file_util_icu.h" |
#include "base/i18n/file_util_icu.h" |
16 |
#include "base/logging.h" |
#include "base/logging.h" |
17 |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/scoped_ptr.h" |
18 |
#include "base/memory/singleton.h" |
#include "base/memory/singleton.h" |
19 |
#include "base/message_loop.h" |
#include "base/message_loop.h" |
20 |
|
#include "base/nix/xdg_util.h" |
21 |
#include "base/path_service.h" |
#include "base/path_service.h" |
22 |
#include "base/string_util.h" |
#include "base/string_util.h" |
23 |
#include "base/time.h" |
#include "base/time.h" |
326 |
std::string app_name = browser_->app_name(); |
std::string app_name = browser_->app_name(); |
327 |
if (app_name != DevToolsWindow::kDevToolsApp) { |
if (app_name != DevToolsWindow::kDevToolsApp) { |
328 |
std::string wmclassname = web_app::GetWMClassFromAppName(app_name); |
std::string wmclassname = web_app::GetWMClassFromAppName(app_name); |
329 |
|
|
330 |
|
scoped_ptr<base::Environment> env(base::Environment::Create()); |
331 |
|
if (base::nix::GetDesktopEnvironment(env.get()) == |
332 |
|
base::nix::DESKTOP_ENVIRONMENT_XFCE) { |
333 |
|
// Workaround for XFCE. XFCE seems to treat the class as a user |
334 |
|
// displayed title, which our app name certainly isn't. They don't have |
335 |
|
// a dock or application based behaviour so do what looks good. |
336 |
gtk_window_set_wmclass(window_, |
gtk_window_set_wmclass(window_, |
337 |
wmclassname.c_str(), |
wmclassname.c_str(), |
338 |
gdk_get_program_class()); |
gdk_get_program_class()); |
339 |
|
} else { |
340 |
|
// Most everything else uses the wmclass_class to group windows |
341 |
|
// together (docks, per application stuff, etc). Hopefully they won't |
342 |
|
// display wmclassname to the user. |
343 |
|
gtk_window_set_wmclass(window_, |
344 |
|
window_->wmclass_name, |
345 |
|
wmclassname.c_str()); |
346 |
|
} |
347 |
|
|
348 |
|
gtk_window_set_role(window_, wmclassname.c_str()); |
349 |
} |
} |
350 |
} |
} |
351 |
|
|