| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/wayland/wayland_input_device.h" | 5 #include "ui/wayland/wayland_input_device.h" |
| 6 | 6 |
| 7 #include <X11/extensions/XKBcommon.h> | 7 #include <X11/extensions/XKBcommon.h> |
| 8 #include <wayland-client.h> | 8 #include <wayland-client.h> |
| 9 | 9 |
| 10 #include "ui/wayland/events/wayland_event.h" | 10 #include "base/wayland/wayland_event.h" |
| 11 #include "ui/wayland/wayland_widget.h" | 11 #include "ui/wayland/wayland_widget.h" |
| 12 #include "ui/wayland/wayland_window.h" | 12 #include "ui/wayland/wayland_window.h" |
| 13 | 13 |
| 14 using namespace base::wayland; |
| 15 |
| 14 namespace ui { | 16 namespace ui { |
| 15 | 17 |
| 16 WaylandInputDevice::WaylandInputDevice( | 18 WaylandInputDevice::WaylandInputDevice( |
| 17 wl_display* display, | 19 wl_display* display, |
| 18 uint32_t id) | 20 uint32_t id) |
| 19 : input_device_(static_cast<wl_input_device*>( | 21 : input_device_(static_cast<wl_input_device*>( |
| 20 wl_display_bind(display, id, &wl_input_device_interface))), | 22 wl_display_bind(display, id, &wl_input_device_interface))), |
| 21 pointer_focus_(NULL), | 23 pointer_focus_(NULL), |
| 22 keyboard_focus_(NULL), | 24 keyboard_focus_(NULL), |
| 23 keyboard_modifiers_(0) { | 25 keyboard_modifiers_(0) { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 // If we have a surface, then a window gains focus | 205 // If we have a surface, then a window gains focus |
| 204 if (surface) { | 206 if (surface) { |
| 205 event.keyboard_focus.state = 1; | 207 event.keyboard_focus.state = 1; |
| 206 window = static_cast<WaylandWindow*>(wl_surface_get_user_data(surface)); | 208 window = static_cast<WaylandWindow*>(wl_surface_get_user_data(surface)); |
| 207 device->keyboard_focus_ = window; | 209 device->keyboard_focus_ = window; |
| 208 window->widget()->OnKeyboardFocus(event); | 210 window->widget()->OnKeyboardFocus(event); |
| 209 } | 211 } |
| 210 } | 212 } |
| 211 | 213 |
| 212 } // namespace ui | 214 } // namespace ui |
| OLD | NEW |