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 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1806 event->type() == ui::ET_TOUCH_PRESSED) { | 1806 event->type() == ui::ET_TOUCH_PRESSED) { |
1807 ConvertEventToDifferentHost(event, g_current_capture); | 1807 ConvertEventToDifferentHost(event, g_current_capture); |
1808 g_current_capture->SendEventToSink(event); | 1808 g_current_capture->SendEventToSink(event); |
1809 } else { | 1809 } else { |
1810 SendEventToSink(event); | 1810 SendEventToSink(event); |
1811 } | 1811 } |
1812 } | 1812 } |
1813 | 1813 |
1814 void DesktopWindowTreeHostX11::DispatchKeyEvent(ui::KeyEvent* event) { | 1814 void DesktopWindowTreeHostX11::DispatchKeyEvent(ui::KeyEvent* event) { |
1815 if (native_widget_delegate_->AsWidget()->IsActive()) | 1815 if (native_widget_delegate_->AsWidget()->IsActive()) |
1816 GetInputMethod()->DispatchKeyEvent(event); | 1816 SendEventToSink(event); |
1817 } | 1817 } |
1818 | 1818 |
1819 void DesktopWindowTreeHostX11::ConvertEventToDifferentHost( | 1819 void DesktopWindowTreeHostX11::ConvertEventToDifferentHost( |
1820 ui::LocatedEvent* located_event, | 1820 ui::LocatedEvent* located_event, |
1821 DesktopWindowTreeHostX11* host) { | 1821 DesktopWindowTreeHostX11* host) { |
1822 DCHECK_NE(this, host); | 1822 DCHECK_NE(this, host); |
1823 DCHECK_EQ(ui::GetScaleFactorForNativeView(window()), | 1823 DCHECK_EQ(ui::GetScaleFactorForNativeView(window()), |
1824 ui::GetScaleFactorForNativeView(host->window())); | 1824 ui::GetScaleFactorForNativeView(host->window())); |
1825 gfx::Vector2d offset = | 1825 gfx::Vector2d offset = |
1826 GetLocationOnScreenInPixels() - host->GetLocationOnScreenInPixels(); | 1826 GetLocationOnScreenInPixels() - host->GetLocationOnScreenInPixels(); |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2356 | 2356 |
2357 // static | 2357 // static |
2358 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( | 2358 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( |
2359 internal::NativeWidgetDelegate* native_widget_delegate, | 2359 internal::NativeWidgetDelegate* native_widget_delegate, |
2360 DesktopNativeWidgetAura* desktop_native_widget_aura) { | 2360 DesktopNativeWidgetAura* desktop_native_widget_aura) { |
2361 return new DesktopWindowTreeHostX11(native_widget_delegate, | 2361 return new DesktopWindowTreeHostX11(native_widget_delegate, |
2362 desktop_native_widget_aura); | 2362 desktop_native_widget_aura); |
2363 } | 2363 } |
2364 | 2364 |
2365 } // namespace views | 2365 } // namespace views |
OLD | NEW |