| 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 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" |
| 6 | 6 |
| 7 #include <X11/extensions/shape.h> | 7 #include <X11/extensions/shape.h> |
| 8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
| 9 #include <X11/Xatom.h> | 9 #include <X11/Xatom.h> |
| 10 #include <X11/Xregion.h> | 10 #include <X11/Xregion.h> |
| (...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 atom_cache_.GetAtom("_NET_WM_STATE_MAXIMIZED_HORZ")); | 872 atom_cache_.GetAtom("_NET_WM_STATE_MAXIMIZED_HORZ")); |
| 873 if (IsMinimized()) | 873 if (IsMinimized()) |
| 874 ShowWindowWithState(ui::SHOW_STATE_NORMAL); | 874 ShowWindowWithState(ui::SHOW_STATE_NORMAL); |
| 875 } | 875 } |
| 876 | 876 |
| 877 void DesktopWindowTreeHostX11::Minimize() { | 877 void DesktopWindowTreeHostX11::Minimize() { |
| 878 ReleaseCapture(); | 878 ReleaseCapture(); |
| 879 XIconifyWindow(xdisplay_, xwindow_, 0); | 879 XIconifyWindow(xdisplay_, xwindow_, 0); |
| 880 } | 880 } |
| 881 | 881 |
| 882 void DesktopWindowTreeHostX11::Pin(bool trusted) { |
| 883 // We only use Pin() for ARC++ window on Chromebook, so we don't need |
| 884 // implement it for X11. |
| 885 NOTIMPLEMENTED(); |
| 886 } |
| 887 |
| 882 void DesktopWindowTreeHostX11::Restore() { | 888 void DesktopWindowTreeHostX11::Restore() { |
| 883 should_maximize_after_map_ = false; | 889 should_maximize_after_map_ = false; |
| 884 SetWMSpecState(false, | 890 SetWMSpecState(false, |
| 885 atom_cache_.GetAtom("_NET_WM_STATE_MAXIMIZED_VERT"), | 891 atom_cache_.GetAtom("_NET_WM_STATE_MAXIMIZED_VERT"), |
| 886 atom_cache_.GetAtom("_NET_WM_STATE_MAXIMIZED_HORZ")); | 892 atom_cache_.GetAtom("_NET_WM_STATE_MAXIMIZED_HORZ")); |
| 887 if (IsMinimized()) | 893 if (IsMinimized()) |
| 888 ShowWindowWithState(ui::SHOW_STATE_NORMAL); | 894 ShowWindowWithState(ui::SHOW_STATE_NORMAL); |
| 889 } | 895 } |
| 890 | 896 |
| 891 bool DesktopWindowTreeHostX11::IsMaximized() const { | 897 bool DesktopWindowTreeHostX11::IsMaximized() const { |
| 892 return (HasWMSpecProperty("_NET_WM_STATE_MAXIMIZED_VERT") && | 898 return (HasWMSpecProperty("_NET_WM_STATE_MAXIMIZED_VERT") && |
| 893 HasWMSpecProperty("_NET_WM_STATE_MAXIMIZED_HORZ")); | 899 HasWMSpecProperty("_NET_WM_STATE_MAXIMIZED_HORZ")); |
| 894 } | 900 } |
| 895 | 901 |
| 896 bool DesktopWindowTreeHostX11::IsMinimized() const { | 902 bool DesktopWindowTreeHostX11::IsMinimized() const { |
| 897 return HasWMSpecProperty("_NET_WM_STATE_HIDDEN"); | 903 return HasWMSpecProperty("_NET_WM_STATE_HIDDEN"); |
| 898 } | 904 } |
| 899 | 905 |
| 906 bool DesktopWindowTreeHostX11::IsPinned() const { |
| 907 return false; |
| 908 } |
| 909 |
| 900 bool DesktopWindowTreeHostX11::HasCapture() const { | 910 bool DesktopWindowTreeHostX11::HasCapture() const { |
| 901 return g_current_capture == this; | 911 return g_current_capture == this; |
| 902 } | 912 } |
| 903 | 913 |
| 904 void DesktopWindowTreeHostX11::SetAlwaysOnTop(bool always_on_top) { | 914 void DesktopWindowTreeHostX11::SetAlwaysOnTop(bool always_on_top) { |
| 905 is_always_on_top_ = always_on_top; | 915 is_always_on_top_ = always_on_top; |
| 906 SetWMSpecState(always_on_top, | 916 SetWMSpecState(always_on_top, |
| 907 atom_cache_.GetAtom("_NET_WM_STATE_ABOVE"), | 917 atom_cache_.GetAtom("_NET_WM_STATE_ABOVE"), |
| 908 None); | 918 None); |
| 909 } | 919 } |
| (...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2354 | 2364 |
| 2355 // static | 2365 // static |
| 2356 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( | 2366 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( |
| 2357 internal::NativeWidgetDelegate* native_widget_delegate, | 2367 internal::NativeWidgetDelegate* native_widget_delegate, |
| 2358 DesktopNativeWidgetAura* desktop_native_widget_aura) { | 2368 DesktopNativeWidgetAura* desktop_native_widget_aura) { |
| 2359 return new DesktopWindowTreeHostX11(native_widget_delegate, | 2369 return new DesktopWindowTreeHostX11(native_widget_delegate, |
| 2360 desktop_native_widget_aura); | 2370 desktop_native_widget_aura); |
| 2361 } | 2371 } |
| 2362 | 2372 |
| 2363 } // namespace views | 2373 } // namespace views |
| OLD | NEW |