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

Unified Diff: chrome/browser/ui/libgtk2ui/gtk2_ui.cc

Issue 557503002: linux: Don't lower windows on middle-click on KDE 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compilation Created 6 years, 3 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/libgtk2ui/gtk2_ui.cc
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
index 6501f185cec709c9aff0f833c379d0fcf2032b88..00a07ace2d3edcd2a7f782030bea8f49c40e2095 100644
--- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
+++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
@@ -14,6 +14,7 @@
#include "base/i18n/rtl.h"
#include "base/logging.h"
#include "base/nix/mime_util_xdg.h"
+#include "base/nix/xdg_util.h"
#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/themes/theme_properties.h"
@@ -378,9 +379,23 @@ gfx::FontRenderParams GetGtkFontRenderParams() {
return params;
}
+views::LinuxUI::NonClientMiddleClickAction GetDefaultMiddleClickAction() {
+ scoped_ptr<base::Environment> env(base::Environment::Create());
+ switch (base::nix::GetDesktopEnvironment(env.get())) {
+ case base::nix::DESKTOP_ENVIRONMENT_KDE4:
+ // Starting with KDE 4.4, windows' titlebars can be dragged with the
+ // middle mouse button to create tab groups. We don't support that in
+ // Chrome, but at least avoid lowering windows in response to middle
+ // clicks to avoid surprising users who expect the KDE behavior.
+ return views::LinuxUI::MIDDLE_CLICK_ACTION_NONE;
+ default:
+ return views::LinuxUI::MIDDLE_CLICK_ACTION_LOWER;
+ }
+}
+
} // namespace
-Gtk2UI::Gtk2UI() : middle_click_action_(MIDDLE_CLICK_ACTION_LOWER) {
+Gtk2UI::Gtk2UI() : middle_click_action_(GetDefaultMiddleClickAction()) {
GtkInitFromCommandLine(*CommandLine::ForCurrentProcess());
}
« 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