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_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ |
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ |
7 | 7 |
8 #include <X11/extensions/shape.h> | 8 #include <X11/extensions/shape.h> |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 | 10 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 virtual scoped_ptr<corewm::Tooltip> CreateTooltip() OVERRIDE; | 94 virtual scoped_ptr<corewm::Tooltip> CreateTooltip() OVERRIDE; |
95 virtual scoped_ptr<aura::client::DragDropClient> | 95 virtual scoped_ptr<aura::client::DragDropClient> |
96 CreateDragDropClient(DesktopNativeCursorManager* cursor_manager) OVERRIDE; | 96 CreateDragDropClient(DesktopNativeCursorManager* cursor_manager) OVERRIDE; |
97 virtual void Close() OVERRIDE; | 97 virtual void Close() OVERRIDE; |
98 virtual void CloseNow() OVERRIDE; | 98 virtual void CloseNow() OVERRIDE; |
99 virtual aura::WindowTreeHost* AsWindowTreeHost() OVERRIDE; | 99 virtual aura::WindowTreeHost* AsWindowTreeHost() OVERRIDE; |
100 virtual void ShowWindowWithState(ui::WindowShowState show_state) OVERRIDE; | 100 virtual void ShowWindowWithState(ui::WindowShowState show_state) OVERRIDE; |
101 virtual void ShowMaximizedWithBounds( | 101 virtual void ShowMaximizedWithBounds( |
102 const gfx::Rect& restored_bounds) OVERRIDE; | 102 const gfx::Rect& restored_bounds) OVERRIDE; |
103 virtual bool IsVisible() const OVERRIDE; | 103 virtual bool IsVisible() const OVERRIDE; |
104 virtual void SetSize(const gfx::Size& size) OVERRIDE; | 104 virtual void SetSize(const gfx::Size& requested_size) OVERRIDE; |
105 virtual void StackAtTop() OVERRIDE; | 105 virtual void StackAtTop() OVERRIDE; |
106 virtual void CenterWindow(const gfx::Size& size) OVERRIDE; | 106 virtual void CenterWindow(const gfx::Size& size) OVERRIDE; |
107 virtual void GetWindowPlacement( | 107 virtual void GetWindowPlacement( |
108 gfx::Rect* bounds, | 108 gfx::Rect* bounds, |
109 ui::WindowShowState* show_state) const OVERRIDE; | 109 ui::WindowShowState* show_state) const OVERRIDE; |
110 virtual gfx::Rect GetWindowBoundsInScreen() const OVERRIDE; | 110 virtual gfx::Rect GetWindowBoundsInScreen() const OVERRIDE; |
111 virtual gfx::Rect GetClientAreaBoundsInScreen() const OVERRIDE; | 111 virtual gfx::Rect GetClientAreaBoundsInScreen() const OVERRIDE; |
112 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; | 112 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; |
113 virtual gfx::Rect GetWorkAreaBoundsInScreen() const OVERRIDE; | 113 virtual gfx::Rect GetWorkAreaBoundsInScreen() const OVERRIDE; |
114 virtual void SetShape(gfx::NativeRegion native_region) OVERRIDE; | 114 virtual void SetShape(gfx::NativeRegion native_region) OVERRIDE; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 virtual void OnNativeWidgetBlur() OVERRIDE; | 147 virtual void OnNativeWidgetBlur() OVERRIDE; |
148 virtual bool IsAnimatingClosed() const OVERRIDE; | 148 virtual bool IsAnimatingClosed() const OVERRIDE; |
149 virtual bool IsTranslucentWindowOpacitySupported() const OVERRIDE; | 149 virtual bool IsTranslucentWindowOpacitySupported() const OVERRIDE; |
150 | 150 |
151 // Overridden from aura::WindowTreeHost: | 151 // Overridden from aura::WindowTreeHost: |
152 virtual ui::EventSource* GetEventSource() OVERRIDE; | 152 virtual ui::EventSource* GetEventSource() OVERRIDE; |
153 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; | 153 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; |
154 virtual void Show() OVERRIDE; | 154 virtual void Show() OVERRIDE; |
155 virtual void Hide() OVERRIDE; | 155 virtual void Hide() OVERRIDE; |
156 virtual gfx::Rect GetBounds() const OVERRIDE; | 156 virtual gfx::Rect GetBounds() const OVERRIDE; |
157 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; | 157 virtual void SetBounds(const gfx::Rect& requested_bounds) OVERRIDE; |
158 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE; | 158 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE; |
159 virtual void SetCapture() OVERRIDE; | 159 virtual void SetCapture() OVERRIDE; |
160 virtual void ReleaseCapture() OVERRIDE; | 160 virtual void ReleaseCapture() OVERRIDE; |
161 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; | 161 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; |
162 virtual void SetCursorNative(gfx::NativeCursor cursor) OVERRIDE; | 162 virtual void SetCursorNative(gfx::NativeCursor cursor) OVERRIDE; |
163 virtual void MoveCursorToNative(const gfx::Point& location) OVERRIDE; | 163 virtual void MoveCursorToNative(const gfx::Point& location) OVERRIDE; |
164 virtual void OnCursorVisibilityChangedNative(bool show) OVERRIDE; | 164 virtual void OnCursorVisibilityChangedNative(bool show) OVERRIDE; |
165 | 165 |
166 // Overridden frm ui::EventSource | 166 // Overridden frm ui::EventSource |
167 virtual ui::EventProcessor* GetEventProcessor() OVERRIDE; | 167 virtual ui::EventProcessor* GetEventProcessor() OVERRIDE; |
168 | 168 |
169 private: | 169 private: |
170 // Initializes our X11 surface to draw on. This method performs all | 170 // Initializes our X11 surface to draw on. This method performs all |
171 // initialization related to talking to the X11 server. | 171 // initialization related to talking to the X11 server. |
172 void InitX11Window(const Widget::InitParams& params); | 172 void InitX11Window(const Widget::InitParams& params); |
173 | 173 |
174 // Creates an aura::WindowEventDispatcher to contain the |content_window|, | 174 // Creates an aura::WindowEventDispatcher to contain the |content_window|, |
175 // along with all aura client objects that direct behavior. | 175 // along with all aura client objects that direct behavior. |
176 aura::WindowEventDispatcher* InitDispatcher(const Widget::InitParams& params); | 176 aura::WindowEventDispatcher* InitDispatcher(const Widget::InitParams& params); |
177 | 177 |
| 178 // Adjusts |requested_size| to avoid the WM "feature" where setting the |
| 179 // window size to the monitor size causes the WM to set the EWMH for |
| 180 // fullscreen. |
| 181 gfx::Size AdjustSize(const gfx::Size& requested_size); |
| 182 |
178 // Called when |xwindow_|'s _NET_WM_STATE property is updated. | 183 // Called when |xwindow_|'s _NET_WM_STATE property is updated. |
179 void OnWMStateUpdated(); | 184 void OnWMStateUpdated(); |
180 | 185 |
181 // Called when |xwindow_|'s _NET_FRAME_EXTENTS property is updated. | 186 // Called when |xwindow_|'s _NET_FRAME_EXTENTS property is updated. |
182 void OnFrameExtentsUpdated(); | 187 void OnFrameExtentsUpdated(); |
183 | 188 |
184 // Updates |xwindow_|'s minimum and maximum size. | 189 // Updates |xwindow_|'s minimum and maximum size. |
185 void UpdateMinAndMaxSize(); | 190 void UpdateMinAndMaxSize(); |
186 | 191 |
187 // Updates |xwindow_|'s _NET_WM_USER_TIME if |xwindow_| is active. | 192 // Updates |xwindow_|'s _NET_WM_USER_TIME if |xwindow_| is active. |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 bool urgency_hint_set_; | 345 bool urgency_hint_set_; |
341 | 346 |
342 base::CancelableCallback<void()> delayed_resize_task_; | 347 base::CancelableCallback<void()> delayed_resize_task_; |
343 | 348 |
344 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); | 349 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); |
345 }; | 350 }; |
346 | 351 |
347 } // namespace views | 352 } // namespace views |
348 | 353 |
349 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ | 354 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ |
OLD | NEW |