OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file defines utility functions for X11 (Linux only). This code has been | 5 // This file defines utility functions for X11 (Linux only). This code has been |
6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support | 6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support |
7 // remains woefully incomplete. | 7 // remains woefully incomplete. |
8 | 8 |
9 #include "ui/base/x/x11_util.h" | 9 #include "ui/base/x/x11_util.h" |
10 | 10 |
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1184 return false; | 1184 return false; |
1185 } | 1185 } |
1186 | 1186 |
1187 return true; | 1187 return true; |
1188 } | 1188 } |
1189 | 1189 |
1190 WindowManagerName GuessWindowManager() { | 1190 WindowManagerName GuessWindowManager() { |
1191 std::string name; | 1191 std::string name; |
1192 if (GetWindowManagerName(&name)) { | 1192 if (GetWindowManagerName(&name)) { |
1193 // These names are taken from the WMs' source code. | 1193 // These names are taken from the WMs' source code. |
| 1194 if (name == "awesome") |
| 1195 return WM_AWESOME; |
1194 if (name == "Blackbox") | 1196 if (name == "Blackbox") |
1195 return WM_BLACKBOX; | 1197 return WM_BLACKBOX; |
1196 if (name == "chromeos-wm") | |
1197 return WM_CHROME_OS; | |
1198 if (name == "Compiz" || name == "compiz") | 1198 if (name == "Compiz" || name == "compiz") |
1199 return WM_COMPIZ; | 1199 return WM_COMPIZ; |
1200 if (name == "e16") | 1200 if (name == "e16" || name == "Enlightenment") |
1201 return WM_ENLIGHTENMENT; | 1201 return WM_ENLIGHTENMENT; |
| 1202 if (name == "i3") |
| 1203 return WM_I3; |
1202 if (StartsWithASCII(name, "IceWM", true)) | 1204 if (StartsWithASCII(name, "IceWM", true)) |
1203 return WM_ICE_WM; | 1205 return WM_ICE_WM; |
| 1206 if (name == "ion3") |
| 1207 return WM_ION3; |
1204 if (name == "KWin") | 1208 if (name == "KWin") |
1205 return WM_KWIN; | 1209 return WM_KWIN; |
| 1210 if (name == "matchbox") |
| 1211 return WM_MATCHBOX; |
1206 if (name == "Metacity") | 1212 if (name == "Metacity") |
1207 return WM_METACITY; | 1213 return WM_METACITY; |
1208 if (name == "Mutter (Muffin)") | 1214 if (name == "Mutter (Muffin)") |
1209 return WM_MUFFIN; | 1215 return WM_MUFFIN; |
1210 if (name == "GNOME Shell") | 1216 if (name == "GNOME Shell") |
1211 return WM_MUTTER; // GNOME Shell uses Mutter | 1217 return WM_MUTTER; // GNOME Shell uses Mutter |
1212 if (name == "Mutter") | 1218 if (name == "Mutter") |
1213 return WM_MUTTER; | 1219 return WM_MUTTER; |
| 1220 if (name == "notion") |
| 1221 return WM_NOTION; |
1214 if (name == "Openbox") | 1222 if (name == "Openbox") |
1215 return WM_OPENBOX; | 1223 return WM_OPENBOX; |
| 1224 if (name == "qtile") |
| 1225 return WM_QTILE; |
| 1226 if (name == "ratpoison") |
| 1227 return WM_RATPOISON; |
| 1228 if (name == "stumpwm") |
| 1229 return WM_STUMPWM; |
1216 if (name == "Xfwm4") | 1230 if (name == "Xfwm4") |
1217 return WM_XFWM4; | 1231 return WM_XFWM4; |
1218 } | 1232 } |
1219 return WM_UNKNOWN; | 1233 return WM_UNKNOWN; |
1220 } | 1234 } |
1221 | 1235 |
1222 std::string GuessWindowManagerName() { | 1236 std::string GuessWindowManagerName() { |
1223 std::string name; | 1237 std::string name; |
1224 if (GetWindowManagerName(&name)) | 1238 if (GetWindowManagerName(&name)) |
1225 return name; | 1239 return name; |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1420 << "request_code " << static_cast<int>(error_event.request_code) << ", " | 1434 << "request_code " << static_cast<int>(error_event.request_code) << ", " |
1421 << "minor_code " << static_cast<int>(error_event.minor_code) | 1435 << "minor_code " << static_cast<int>(error_event.minor_code) |
1422 << " (" << request_str << ")"; | 1436 << " (" << request_str << ")"; |
1423 } | 1437 } |
1424 | 1438 |
1425 // ---------------------------------------------------------------------------- | 1439 // ---------------------------------------------------------------------------- |
1426 // End of x11_util_internal.h | 1440 // End of x11_util_internal.h |
1427 | 1441 |
1428 | 1442 |
1429 } // namespace ui | 1443 } // namespace ui |
OLD | NEW |