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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 namespace ui { | 31 namespace ui { |
32 class EventHandler; | 32 class EventHandler; |
33 } | 33 } |
34 | 34 |
35 namespace views { | 35 namespace views { |
36 class DesktopDragDropClientAuraX11; | 36 class DesktopDragDropClientAuraX11; |
37 class DesktopDispatcherClient; | 37 class DesktopDispatcherClient; |
38 class DesktopWindowTreeHostObserverX11; | 38 class DesktopWindowTreeHostObserverX11; |
39 class X11DesktopWindowMoveClient; | 39 class X11DesktopWindowMoveClient; |
40 class X11ScopedCapture; | |
41 class X11WindowEventFilter; | 40 class X11WindowEventFilter; |
42 | 41 |
43 class VIEWS_EXPORT DesktopWindowTreeHostX11 | 42 class VIEWS_EXPORT DesktopWindowTreeHostX11 |
44 : public DesktopWindowTreeHost, | 43 : public DesktopWindowTreeHost, |
45 public aura::WindowTreeHost, | 44 public aura::WindowTreeHost, |
46 public ui::EventSource, | 45 public ui::EventSource, |
47 public ui::PlatformEventDispatcher { | 46 public ui::PlatformEventDispatcher { |
48 public: | 47 public: |
49 DesktopWindowTreeHostX11( | 48 DesktopWindowTreeHostX11( |
50 internal::NativeWidgetDelegate* native_widget_delegate, | 49 internal::NativeWidgetDelegate* native_widget_delegate, |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 // Sends a message to the x11 window manager, enabling or disabling the | 194 // Sends a message to the x11 window manager, enabling or disabling the |
196 // states |state1| and |state2|. | 195 // states |state1| and |state2|. |
197 void SetWMSpecState(bool enabled, ::Atom state1, ::Atom state2); | 196 void SetWMSpecState(bool enabled, ::Atom state1, ::Atom state2); |
198 | 197 |
199 // Checks if the window manager has set a specific state. | 198 // Checks if the window manager has set a specific state. |
200 bool HasWMSpecProperty(const char* property) const; | 199 bool HasWMSpecProperty(const char* property) const; |
201 | 200 |
202 // Sets whether the window's borders are provided by the window manager. | 201 // Sets whether the window's borders are provided by the window manager. |
203 void SetUseNativeFrame(bool use_native_frame); | 202 void SetUseNativeFrame(bool use_native_frame); |
204 | 203 |
205 // Called when another DRWHL takes capture, or when capture is released | |
206 // entirely. | |
207 void OnCaptureReleased(); | |
208 | |
209 // Dispatches a mouse event, taking mouse capture into account. If a | 204 // Dispatches a mouse event, taking mouse capture into account. If a |
210 // different host has capture, we translate the event to its coordinate space | 205 // different host has capture, we translate the event to its coordinate space |
211 // and dispatch it to that host instead. | 206 // and dispatch it to that host instead. |
212 void DispatchMouseEvent(ui::MouseEvent* event); | 207 void DispatchMouseEvent(ui::MouseEvent* event); |
213 | 208 |
214 // Dispatches a touch event, taking capture into account. If a different host | 209 // Dispatches a touch event, taking capture into account. If a different host |
215 // has capture, then touch-press events are translated to its coordinate space | 210 // has capture, then touch-press events are translated to its coordinate space |
216 // and dispatched to that host instead. | 211 // and dispatched to that host instead. |
217 void DispatchTouchEvent(ui::TouchEvent* event); | 212 void DispatchTouchEvent(ui::TouchEvent* event); |
218 | 213 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 311 |
317 // The window shape if the window is non-rectangular. | 312 // The window shape if the window is non-rectangular. |
318 ::Region window_shape_; | 313 ::Region window_shape_; |
319 | 314 |
320 // Whether |window_shape_| was set via SetShape(). | 315 // Whether |window_shape_| was set via SetShape(). |
321 bool custom_window_shape_; | 316 bool custom_window_shape_; |
322 | 317 |
323 // The size of the window manager provided borders (if any). | 318 // The size of the window manager provided borders (if any). |
324 gfx::Insets native_window_frame_borders_; | 319 gfx::Insets native_window_frame_borders_; |
325 | 320 |
326 // The current root window host that has capture. While X11 has something | 321 // The current DesktopWindowTreeHostX11 which has capture. Set synchronously |
327 // like Windows SetCapture()/ReleaseCapture(), it is entirely implicit and | 322 // when capture is requested via SetCapture(). |
328 // there are no notifications when this changes. We need to track this so we | |
329 // can notify widgets when they have lost capture, which controls a bunch of | |
330 // things in views like hiding menus. | |
331 static DesktopWindowTreeHostX11* g_current_capture; | 323 static DesktopWindowTreeHostX11* g_current_capture; |
332 | 324 |
333 // A list of all (top-level) windows that have been created but not yet | 325 // A list of all (top-level) windows that have been created but not yet |
334 // destroyed. | 326 // destroyed. |
335 static std::list<XID>* open_windows_; | 327 static std::list<XID>* open_windows_; |
336 | 328 |
337 scoped_ptr<X11ScopedCapture> x11_capture_; | |
338 | |
339 base::string16 window_title_; | 329 base::string16 window_title_; |
340 | 330 |
341 // Whether we currently are flashing our frame. This feature is implemented | 331 // Whether we currently are flashing our frame. This feature is implemented |
342 // by setting the urgency hint with the window manager, which can draw | 332 // by setting the urgency hint with the window manager, which can draw |
343 // attention to the window or completely ignore the hint. We stop flashing | 333 // attention to the window or completely ignore the hint. We stop flashing |
344 // the frame when |xwindow_| gains focus or handles a mouse button event. | 334 // the frame when |xwindow_| gains focus or handles a mouse button event. |
345 bool urgency_hint_set_; | 335 bool urgency_hint_set_; |
346 | 336 |
347 base::CancelableCallback<void()> delayed_resize_task_; | 337 base::CancelableCallback<void()> delayed_resize_task_; |
348 | 338 |
349 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); | 339 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); |
350 }; | 340 }; |
351 | 341 |
352 } // namespace views | 342 } // namespace views |
353 | 343 |
354 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ | 344 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ |
OLD | NEW |