| 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 #ifndef UI_BASE_X_X11_UTIL_H_ | 5 #ifndef UI_BASE_X_X11_UTIL_H_ |
| 6 #define UI_BASE_X_X11_UTIL_H_ | 6 #define UI_BASE_X_X11_UTIL_H_ |
| 7 | 7 |
| 8 // This file declares utility functions for X11 (Linux only). | 8 // This file declares utility functions for X11 (Linux only). |
| 9 // | 9 // |
| 10 // These functions do not require the Xlib headers to be included (which is why | 10 // These functions do not require the Xlib headers to be included (which is why |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 UI_BASE_EXPORT void SetWindowRole(XDisplay* display, | 217 UI_BASE_EXPORT void SetWindowRole(XDisplay* display, |
| 218 XID window, | 218 XID window, |
| 219 const std::string& role); | 219 const std::string& role); |
| 220 | 220 |
| 221 // Get |window|'s parent window, or None if |window| is the root window. | 221 // Get |window|'s parent window, or None if |window| is the root window. |
| 222 UI_BASE_EXPORT XID GetParentWindow(XID window); | 222 UI_BASE_EXPORT XID GetParentWindow(XID window); |
| 223 | 223 |
| 224 // Walk up |window|'s hierarchy until we find a direct child of |root|. | 224 // Walk up |window|'s hierarchy until we find a direct child of |root|. |
| 225 XID GetHighestAncestorWindow(XID window, XID root); | 225 XID GetHighestAncestorWindow(XID window, XID root); |
| 226 | 226 |
| 227 // Determine whether we should default to native decorations or the custom |
| 228 // frame based on the currently-running window manager. |
| 229 UI_BASE_EXPORT bool GetCustomFramePrefDefault(); |
| 230 |
| 227 static const int kAllDesktops = -1; | 231 static const int kAllDesktops = -1; |
| 228 // Queries the desktop |window| is on, kAllDesktops if sticky. Returns false if | 232 // Queries the desktop |window| is on, kAllDesktops if sticky. Returns false if |
| 229 // property not found. | 233 // property not found. |
| 230 bool GetWindowDesktop(XID window, int* desktop); | 234 bool GetWindowDesktop(XID window, int* desktop); |
| 231 | 235 |
| 232 // Translates an X11 error code into a printable string. | 236 // Translates an X11 error code into a printable string. |
| 233 UI_BASE_EXPORT std::string GetX11ErrorString(XDisplay* display, int err); | 237 UI_BASE_EXPORT std::string GetX11ErrorString(XDisplay* display, int err); |
| 234 | 238 |
| 235 // Implementers of this interface receive a notification for every X window of | 239 // Implementers of this interface receive a notification for every X window of |
| 236 // the main display. | 240 // the main display. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 private: | 394 private: |
| 391 ::Cursor cursor_; | 395 ::Cursor cursor_; |
| 392 XDisplay* display_; | 396 XDisplay* display_; |
| 393 | 397 |
| 394 DISALLOW_COPY_AND_ASSIGN(XScopedCursor); | 398 DISALLOW_COPY_AND_ASSIGN(XScopedCursor); |
| 395 }; | 399 }; |
| 396 | 400 |
| 397 } // namespace ui | 401 } // namespace ui |
| 398 | 402 |
| 399 #endif // UI_BASE_X_X11_UTIL_H_ | 403 #endif // UI_BASE_X_X11_UTIL_H_ |
| OLD | NEW |