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

Unified Diff: ui/base/x/x11_util.cc

Issue 578443004: linux: Default to custom frame for EWMH-supporting WMs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: ui/base/x/x11_util.cc
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc
index 6daf1686c5cdc84da9b43e5e7954c3e0b30d1025..381695e90049551766547758ec72ef0d3883545f 100644
--- a/ui/base/x/x11_util.cc
+++ b/ui/base/x/x11_util.cc
@@ -994,23 +994,33 @@ void SetWindowRole(XDisplay* display, XID window, const std::string& role) {
}
bool GetCustomFramePrefDefault() {
- // Ideally, we'd use the custom frame by default and just fall back on using
- // system decorations for the few (?) tiling window managers where the custom
- // frame doesn't make sense (e.g. awesome, ion3, ratpoison, xmonad, etc.) or
- // other WMs where it has issues (e.g. Fluxbox -- see issue 19130). The EWMH
- // _NET_SUPPORTING_WM property makes it easy to look up a name for the current
- // WM, but at least some of the WMs in the latter group don't set it.
- // Instead, we default to using system decorations for all WMs and
- // special-case the ones where the custom frame should be used.
- ui::WindowManagerName wm_type = GuessWindowManager();
- return (wm_type == WM_BLACKBOX ||
- wm_type == WM_COMPIZ ||
- wm_type == WM_ENLIGHTENMENT ||
- wm_type == WM_METACITY ||
- wm_type == WM_MUFFIN ||
- wm_type == WM_MUTTER ||
- wm_type == WM_OPENBOX ||
- wm_type == WM_XFWM4);
+ // If the window manager doesn't support enough of EWMH to tell us its name,
+ // assume that it doesn't want custom frames.
Matt Giuca 2014/09/17 01:09:16 I'm not sure why you make this assumption. If the
Daniel Erat 2014/09/18 16:07:58 if the WM doesn't support EWMH, then it doesn't un
Matt Giuca 2014/09/19 01:01:38 Acknowledged.
+ std::string wm_name;
+ if (!GetWindowManagerName(&wm_name))
+ return false;
+
+ // Also disable custom frames for (at-least-partially-)EWMH-supporting tiling
+ // window managers.
+ ui::WindowManagerName wm = GuessWindowManager();
+ if (wm == WM_AWESOME ||
+ wm == WM_I3 ||
+ wm == WM_ION3 ||
+ wm == WM_MATCHBOX ||
+ wm == WM_NOTION ||
+ wm == WM_QTILE ||
+ wm == WM_RATPOISON ||
+ wm == WM_STUMPWM)
+ return false;
+
+ // Handle a few more window managers that don't get along well with custom
+ // frames.
Daniel Erat 2014/09/16 23:48:34 at least, i'm assuming that their omission from th
Elliot Glaysher 2014/09/16 23:59:36 We've had problems with icewm in the past, at leas
+ if (wm == WM_ICE_WM ||
+ wm == WM_KWIN)
+ return false;
+
+ // For everything else, use custom frames.
+ return true;
}
bool GetWindowDesktop(XID window, int* desktop) {
@@ -1191,10 +1201,10 @@ WindowManagerName GuessWindowManager() {
std::string name;
if (GetWindowManagerName(&name)) {
// These names are taken from the WMs' source code.
+ if (name == "awesome")
+ return WM_AWESOME;
if (name == "Blackbox")
return WM_BLACKBOX;
- if (name == "chromeos-wm")
- return WM_CHROME_OS;
if (name == "Compiz" || name == "compiz")
return WM_COMPIZ;
if (name == "e16")
@@ -1209,10 +1219,24 @@ WindowManagerName GuessWindowManager() {
return WM_MUFFIN;
if (name == "GNOME Shell")
return WM_MUTTER; // GNOME Shell uses Mutter
+ if (name == "i3")
+ return WM_I3;
+ if (name == "ion3")
+ return WM_ION3;
+ if (name == "matchbox")
+ return WM_MATCHBOX;
if (name == "Mutter")
return WM_MUTTER;
+ if (name == "notion") // FIXME: Double-check this.
+ return WM_NOTION;
if (name == "Openbox")
return WM_OPENBOX;
+ if (name == "qtile")
+ return WM_QTILE;
+ if (name == "ratpoison")
+ return WM_OPENBOX;
+ if (name == "stumpwm")
+ return WM_STUMPWM;
if (name == "Xfwm4")
return WM_XFWM4;
}
« chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc ('K') | « ui/base/x/x11_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698