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_root_window_host_linux.h" | 5 #include "ui/views/widget/desktop_aura/desktop_root_window_host_linux.h" |
6 | 6 |
7 #include <X11/extensions/XInput2.h> | 7 #include <X11/extensions/XInput2.h> |
8 #include <X11/Xatom.h> | 8 #include <X11/Xatom.h> |
9 #include <X11/Xutil.h> | 9 #include <X11/Xutil.h> |
10 | 10 |
11 #include "base/message_pump_aurax11.h" | 11 #include "base/message_pump_aurax11.h" |
12 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "ui/aura/client/cursor_client.h" | |
15 #include "ui/aura/client/default_capture_client.h" | 14 #include "ui/aura/client/default_capture_client.h" |
16 #include "ui/aura/client/screen_position_client.h" | 15 #include "ui/aura/client/screen_position_client.h" |
17 #include "ui/aura/client/user_action_client.h" | 16 #include "ui/aura/client/user_action_client.h" |
18 #include "ui/aura/focus_manager.h" | 17 #include "ui/aura/focus_manager.h" |
19 #include "ui/aura/root_window.h" | 18 #include "ui/aura/root_window.h" |
20 #include "ui/aura/window_property.h" | 19 #include "ui/aura/window_property.h" |
21 #include "ui/base/events/event_utils.h" | 20 #include "ui/base/events/event_utils.h" |
22 #include "ui/base/touch/touch_factory.h" | 21 #include "ui/base/touch/touch_factory.h" |
23 #include "ui/base/x/x11_util.h" | 22 #include "ui/base/x/x11_util.h" |
24 #include "ui/native_theme/native_theme.h" | 23 #include "ui/native_theme/native_theme.h" |
25 #include "ui/views/corewm/compound_event_filter.h" | 24 #include "ui/views/corewm/compound_event_filter.h" |
26 #include "ui/views/corewm/corewm_switches.h" | 25 #include "ui/views/corewm/corewm_switches.h" |
| 26 #include "ui/views/corewm/cursor_manager.h" |
27 #include "ui/views/corewm/focus_controller.h" | 27 #include "ui/views/corewm/focus_controller.h" |
28 #include "ui/views/ime/input_method.h" | 28 #include "ui/views/ime/input_method.h" |
29 #include "ui/views/widget/desktop_aura/desktop_activation_client.h" | 29 #include "ui/views/widget/desktop_aura/desktop_activation_client.h" |
30 #include "ui/views/widget/desktop_aura/desktop_cursor_client.h" | |
31 #include "ui/views/widget/desktop_aura/desktop_dispatcher_client.h" | 30 #include "ui/views/widget/desktop_aura/desktop_dispatcher_client.h" |
32 #include "ui/views/widget/desktop_aura/desktop_focus_rules.h" | 31 #include "ui/views/widget/desktop_aura/desktop_focus_rules.h" |
33 #include "ui/views/widget/desktop_aura/desktop_layout_manager.h" | 32 #include "ui/views/widget/desktop_aura/desktop_layout_manager.h" |
| 33 #include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h" |
34 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 34 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
35 #include "ui/views/widget/desktop_aura/desktop_screen_position_client.h" | 35 #include "ui/views/widget/desktop_aura/desktop_screen_position_client.h" |
36 #include "ui/views/widget/desktop_aura/x11_desktop_handler.h" | 36 #include "ui/views/widget/desktop_aura/x11_desktop_handler.h" |
37 #include "ui/views/widget/desktop_aura/x11_desktop_window_move_client.h" | 37 #include "ui/views/widget/desktop_aura/x11_desktop_window_move_client.h" |
38 #include "ui/views/widget/desktop_aura/x11_window_event_filter.h" | 38 #include "ui/views/widget/desktop_aura/x11_window_event_filter.h" |
39 | 39 |
40 namespace views { | 40 namespace views { |
41 | 41 |
42 DesktopRootWindowHostLinux* DesktopRootWindowHostLinux::g_current_capture = | 42 DesktopRootWindowHostLinux* DesktopRootWindowHostLinux::g_current_capture = |
43 NULL; | 43 NULL; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 } else { | 229 } else { |
230 focus_client_.reset(new aura::FocusManager); | 230 focus_client_.reset(new aura::FocusManager); |
231 aura::client::SetFocusClient(root_window_, focus_client_.get()); | 231 aura::client::SetFocusClient(root_window_, focus_client_.get()); |
232 activation_client_.reset(new DesktopActivationClient(root_window_)); | 232 activation_client_.reset(new DesktopActivationClient(root_window_)); |
233 } | 233 } |
234 | 234 |
235 dispatcher_client_.reset(new DesktopDispatcherClient); | 235 dispatcher_client_.reset(new DesktopDispatcherClient); |
236 aura::client::SetDispatcherClient(root_window_, | 236 aura::client::SetDispatcherClient(root_window_, |
237 dispatcher_client_.get()); | 237 dispatcher_client_.get()); |
238 | 238 |
239 cursor_client_.reset(new DesktopCursorClient(root_window_)); | 239 cursor_client_.reset( |
| 240 new views::corewm::CursorManager( |
| 241 scoped_ptr<corewm::NativeCursorManager>( |
| 242 new views::DesktopNativeCursorManager(root_window_)))); |
240 aura::client::SetCursorClient(root_window_, | 243 aura::client::SetCursorClient(root_window_, |
241 cursor_client_.get()); | 244 cursor_client_.get()); |
242 | 245 |
243 position_client_.reset(new DesktopScreenPositionClient); | 246 position_client_.reset(new DesktopScreenPositionClient); |
244 aura::client::SetScreenPositionClient(root_window_, | 247 aura::client::SetScreenPositionClient(root_window_, |
245 position_client_.get()); | 248 position_client_.get()); |
246 | 249 |
247 desktop_native_widget_aura_->InstallInputMethodEventFilter(root_window_); | 250 desktop_native_widget_aura_->InstallInputMethodEventFilter(root_window_); |
248 | 251 |
249 // TODO(erg): Unify this code once the other consumer goes away. | 252 // TODO(erg): Unify this code once the other consumer goes away. |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 bool DesktopRootWindowHostLinux::ConfineCursorToRootWindow() { | 797 bool DesktopRootWindowHostLinux::ConfineCursorToRootWindow() { |
795 NOTIMPLEMENTED(); | 798 NOTIMPLEMENTED(); |
796 return false; | 799 return false; |
797 } | 800 } |
798 | 801 |
799 void DesktopRootWindowHostLinux::UnConfineCursor() { | 802 void DesktopRootWindowHostLinux::UnConfineCursor() { |
800 NOTIMPLEMENTED(); | 803 NOTIMPLEMENTED(); |
801 } | 804 } |
802 | 805 |
803 void DesktopRootWindowHostLinux::OnCursorVisibilityChanged(bool show) { | 806 void DesktopRootWindowHostLinux::OnCursorVisibilityChanged(bool show) { |
804 NOTIMPLEMENTED(); | 807 // TODO(erg): Conditional on us enabling touch on desktop linux builds, do |
| 808 // the same tap-to-click disabling here that chromeos does. |
805 } | 809 } |
806 | 810 |
807 void DesktopRootWindowHostLinux::MoveCursorTo(const gfx::Point& location) { | 811 void DesktopRootWindowHostLinux::MoveCursorTo(const gfx::Point& location) { |
808 NOTIMPLEMENTED(); | 812 NOTIMPLEMENTED(); |
809 } | 813 } |
810 | 814 |
811 void DesktopRootWindowHostLinux::SetFocusWhenShown(bool focus_when_shown) { | 815 void DesktopRootWindowHostLinux::SetFocusWhenShown(bool focus_when_shown) { |
812 static const char* k_NET_WM_USER_TIME = "_NET_WM_USER_TIME"; | 816 static const char* k_NET_WM_USER_TIME = "_NET_WM_USER_TIME"; |
813 focus_when_shown_ = focus_when_shown; | 817 focus_when_shown_ = focus_when_shown; |
814 if (IsWindowManagerPresent() && !focus_when_shown_) { | 818 if (IsWindowManagerPresent() && !focus_when_shown_) { |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 DesktopRootWindowHost* DesktopRootWindowHost::Create( | 1122 DesktopRootWindowHost* DesktopRootWindowHost::Create( |
1119 internal::NativeWidgetDelegate* native_widget_delegate, | 1123 internal::NativeWidgetDelegate* native_widget_delegate, |
1120 DesktopNativeWidgetAura* desktop_native_widget_aura, | 1124 DesktopNativeWidgetAura* desktop_native_widget_aura, |
1121 const gfx::Rect& initial_bounds) { | 1125 const gfx::Rect& initial_bounds) { |
1122 return new DesktopRootWindowHostLinux(native_widget_delegate, | 1126 return new DesktopRootWindowHostLinux(native_widget_delegate, |
1123 desktop_native_widget_aura, | 1127 desktop_native_widget_aura, |
1124 initial_bounds); | 1128 initial_bounds); |
1125 } | 1129 } |
1126 | 1130 |
1127 } // namespace views | 1131 } // namespace views |
OLD | NEW |