| 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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 XWindowAttributes win_attributes; | 550 XWindowAttributes win_attributes; |
| 551 if (!XGetWindowAttributes(gfx::GetXDisplay(), window, &win_attributes)) | 551 if (!XGetWindowAttributes(gfx::GetXDisplay(), window, &win_attributes)) |
| 552 return false; | 552 return false; |
| 553 if (win_attributes.map_state != IsViewable) | 553 if (win_attributes.map_state != IsViewable) |
| 554 return false; | 554 return false; |
| 555 | 555 |
| 556 // Minimized windows are not visible. | 556 // Minimized windows are not visible. |
| 557 std::vector<XAtom> wm_states; | 557 std::vector<XAtom> wm_states; |
| 558 if (GetAtomArrayProperty(window, "_NET_WM_STATE", &wm_states)) { | 558 if (GetAtomArrayProperty(window, "_NET_WM_STATE", &wm_states)) { |
| 559 XAtom hidden_atom = GetAtom("_NET_WM_STATE_HIDDEN"); | 559 XAtom hidden_atom = GetAtom("_NET_WM_STATE_HIDDEN"); |
| 560 if (ContainsValue(wm_states, hidden_atom)) | 560 if (base::ContainsValue(wm_states, hidden_atom)) |
| 561 return false; | 561 return false; |
| 562 } | 562 } |
| 563 | 563 |
| 564 // Some compositing window managers (notably kwin) do not actually unmap | 564 // Some compositing window managers (notably kwin) do not actually unmap |
| 565 // windows on desktop switch, so we also must check the current desktop. | 565 // windows on desktop switch, so we also must check the current desktop. |
| 566 int window_desktop, current_desktop; | 566 int window_desktop, current_desktop; |
| 567 return (!GetWindowDesktop(window, &window_desktop) || | 567 return (!GetWindowDesktop(window, &window_desktop) || |
| 568 !GetCurrentDesktop(¤t_desktop) || | 568 !GetCurrentDesktop(¤t_desktop) || |
| 569 window_desktop == kAllDesktops || | 569 window_desktop == kAllDesktops || |
| 570 window_desktop == current_desktop); | 570 window_desktop == current_desktop); |
| (...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1462 if (depth) | 1462 if (depth) |
| 1463 *depth = s_depth; | 1463 *depth = s_depth; |
| 1464 } | 1464 } |
| 1465 #endif | 1465 #endif |
| 1466 | 1466 |
| 1467 // ---------------------------------------------------------------------------- | 1467 // ---------------------------------------------------------------------------- |
| 1468 // End of x11_util_internal.h | 1468 // End of x11_util_internal.h |
| 1469 | 1469 |
| 1470 | 1470 |
| 1471 } // namespace ui | 1471 } // namespace ui |
| OLD | NEW |