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 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1575 ui::MouseEvent mouse_event(xev); | 1575 ui::MouseEvent mouse_event(xev); |
1576 DispatchMouseEvent(&mouse_event); | 1576 DispatchMouseEvent(&mouse_event); |
1577 break; | 1577 break; |
1578 } | 1578 } |
1579 case Expose: { | 1579 case Expose: { |
1580 gfx::Rect damage_rect(xev->xexpose.x, xev->xexpose.y, | 1580 gfx::Rect damage_rect(xev->xexpose.x, xev->xexpose.y, |
1581 xev->xexpose.width, xev->xexpose.height); | 1581 xev->xexpose.width, xev->xexpose.height); |
1582 compositor()->ScheduleRedrawRect(damage_rect); | 1582 compositor()->ScheduleRedrawRect(damage_rect); |
1583 break; | 1583 break; |
1584 } | 1584 } |
1585 case KeyPress: | 1585 case KeyPress: { |
| 1586 ui::KeyEvent keydown_event(xev); |
| 1587 SendEventToProcessor(&keydown_event); |
| 1588 break; |
| 1589 } |
1586 case KeyRelease: { | 1590 case KeyRelease: { |
1587 // There is no way to deactivate a window in X11 so ignore input if | 1591 // There is no way to deactivate a window in X11 so ignore input if |
1588 // window is supposed to be 'inactive'. See comments in | 1592 // window is supposed to be 'inactive'. See comments in |
1589 // X11DesktopHandler::DeactivateWindow() for more details. | 1593 // X11DesktopHandler::DeactivateWindow() for more details. |
1590 if (!IsActive() && !HasCapture()) | 1594 if (!IsActive() && !HasCapture()) |
1591 break; | 1595 break; |
1592 | 1596 |
1593 ui::KeyEvent key_event(xev, false); | 1597 ui::KeyEvent key_event(xev); |
1594 SendEventToProcessor(&key_event); | 1598 SendEventToProcessor(&key_event); |
1595 break; | 1599 break; |
1596 } | 1600 } |
1597 case ButtonPress: | 1601 case ButtonPress: |
1598 case ButtonRelease: { | 1602 case ButtonRelease: { |
1599 ui::EventType event_type = ui::EventTypeFromNative(xev); | 1603 ui::EventType event_type = ui::EventTypeFromNative(xev); |
1600 switch (event_type) { | 1604 switch (event_type) { |
1601 case ui::ET_MOUSEWHEEL: { | 1605 case ui::ET_MOUSEWHEEL: { |
1602 ui::MouseWheelEvent mouseev(xev); | 1606 ui::MouseWheelEvent mouseev(xev); |
1603 DispatchMouseEvent(&mouseev); | 1607 DispatchMouseEvent(&mouseev); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1843 if (linux_ui) { | 1847 if (linux_ui) { |
1844 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); | 1848 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); |
1845 if (native_theme) | 1849 if (native_theme) |
1846 return native_theme; | 1850 return native_theme; |
1847 } | 1851 } |
1848 | 1852 |
1849 return ui::NativeTheme::instance(); | 1853 return ui::NativeTheme::instance(); |
1850 } | 1854 } |
1851 | 1855 |
1852 } // namespace views | 1856 } // namespace views |
OLD | NEW |