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_AURA_ROOT_WINDOW_HOST_LINUX_H_ | 5 #ifndef UI_AURA_ROOT_WINDOW_HOST_LINUX_H_ |
6 #define UI_AURA_ROOT_WINDOW_HOST_LINUX_H_ | 6 #define UI_AURA_ROOT_WINDOW_HOST_LINUX_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 virtual void SetCapture() OVERRIDE; | 44 virtual void SetCapture() OVERRIDE; |
45 virtual void ReleaseCapture() OVERRIDE; | 45 virtual void ReleaseCapture() OVERRIDE; |
46 virtual void SetCursor(gfx::NativeCursor cursor_type) OVERRIDE; | 46 virtual void SetCursor(gfx::NativeCursor cursor_type) OVERRIDE; |
47 virtual void ShowCursor(bool show) OVERRIDE; | 47 virtual void ShowCursor(bool show) OVERRIDE; |
48 virtual gfx::Point QueryMouseLocation() OVERRIDE; | 48 virtual gfx::Point QueryMouseLocation() OVERRIDE; |
49 virtual bool ConfineCursorToRootWindow() OVERRIDE; | 49 virtual bool ConfineCursorToRootWindow() OVERRIDE; |
50 virtual void UnConfineCursor() OVERRIDE; | 50 virtual void UnConfineCursor() OVERRIDE; |
51 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; | 51 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; |
52 virtual void SetFocusWhenShown(bool focus_when_shown) OVERRIDE; | 52 virtual void SetFocusWhenShown(bool focus_when_shown) OVERRIDE; |
53 virtual void PostNativeEvent(const base::NativeEvent& event) OVERRIDE; | 53 virtual void PostNativeEvent(const base::NativeEvent& event) OVERRIDE; |
| 54 virtual void SetUseHostWindowBorders(bool use_os_borders) OVERRIDE; |
| 55 virtual bool DispatchHostWindowDragMovement(int hittest, |
| 56 MouseEvent* event) OVERRIDE; |
54 | 57 |
55 // Returns true if there's an X window manager present... in most cases. Some | 58 // Returns true if there's an X window manager present... in most cases. Some |
56 // window managers (notably, ion3) don't implement enough of ICCCM for us to | 59 // window managers (notably, ion3) don't implement enough of ICCCM for us to |
57 // detect that they're there. | 60 // detect that they're there. |
58 bool IsWindowManagerPresent(); | 61 bool IsWindowManagerPresent(); |
59 | 62 |
60 // Sets the cursor on |xwindow_| to |cursor|. Does not check or update | 63 // Sets the cursor on |xwindow_| to |cursor|. Does not check or update |
61 // |current_cursor_|. | 64 // |current_cursor_|. |
62 void SetCursorInternal(gfx::NativeCursor cursor); | 65 void SetCursorInternal(gfx::NativeCursor cursor); |
63 | 66 |
| 67 // Signal to the window manager that it is to move the window as we've had a |
| 68 // hit in our non-client area. |
| 69 void SendWMMoveResize(int direction, int x_root, int y_root); |
| 70 |
64 RootWindow* root_window_; | 71 RootWindow* root_window_; |
65 | 72 |
66 // The display and the native X window hosting the root window. | 73 // The display and the native X window hosting the root window. |
67 Display* xdisplay_; | 74 Display* xdisplay_; |
68 ::Window xwindow_; | 75 ::Window xwindow_; |
69 | 76 |
70 // The native root window. | 77 // The native root window. |
71 ::Window x_root_window_; | 78 ::Window x_root_window_; |
72 | 79 |
73 // Current Aura cursor. | 80 // Current Aura cursor. |
74 gfx::NativeCursor current_cursor_; | 81 gfx::NativeCursor current_cursor_; |
75 | 82 |
76 // Is the cursor currently shown? | 83 // Is the cursor currently shown? |
77 bool cursor_shown_; | 84 bool cursor_shown_; |
78 | 85 |
79 // The invisible cursor. | 86 // The invisible cursor. |
80 ::Cursor invisible_cursor_; | 87 ::Cursor invisible_cursor_; |
81 | 88 |
82 // The bounds of |xwindow_|. | 89 // The bounds of |xwindow_|. |
83 gfx::Rect bounds_; | 90 gfx::Rect bounds_; |
84 | 91 |
85 // Names of cached atoms that we fetch during the constructor to minimize | 92 // Names of cached atoms that we fetch during the constructor to minimize |
86 // round trips to the X11 server. | 93 // round trips to the X11 server. |
87 enum AtomList { | 94 enum AtomList { |
88 ATOM_WM_DELETE_WINDOW = 0, | 95 ATOM_WM_DELETE_WINDOW = 0, |
| 96 ATOM__NET_WM_MOVERESIZE, |
89 ATOM__NET_WM_PING, | 97 ATOM__NET_WM_PING, |
90 ATOM__NET_WM_PID, | 98 ATOM__NET_WM_PID, |
91 ATOM_WM_S0, | 99 ATOM_WM_S0, |
92 | 100 |
| 101 ATOM__MOTIF_WM_HINTS, |
| 102 |
93 ATOM_COUNT | 103 ATOM_COUNT |
94 }; | 104 }; |
95 ::Atom cached_atoms_[ATOM_COUNT]; | 105 ::Atom cached_atoms_[ATOM_COUNT]; |
96 | 106 |
97 // True if the window should be focused when the window is shown. | 107 // True if the window should be focused when the window is shown. |
98 bool focus_when_shown_; | 108 bool focus_when_shown_; |
99 | 109 |
100 scoped_array<XID> pointer_barriers_; | 110 scoped_array<XID> pointer_barriers_; |
101 | 111 |
102 scoped_ptr<ui::ViewProp> prop_; | 112 scoped_ptr<ui::ViewProp> prop_; |
103 | 113 |
104 DISALLOW_COPY_AND_ASSIGN(RootWindowHostLinux); | 114 DISALLOW_COPY_AND_ASSIGN(RootWindowHostLinux); |
105 }; | 115 }; |
106 | 116 |
107 } // namespace aura | 117 } // namespace aura |
108 | 118 |
109 #endif // UI_AURA_ROOT_WINDOW_HOST_LINUX_H_ | 119 #endif // UI_AURA_ROOT_WINDOW_HOST_LINUX_H_ |
OLD | NEW |