OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ash/host/ash_window_tree_host_x11.h" | 5 #include "ash/host/ash_window_tree_host_x11.h" |
6 | 6 |
7 #include <X11/extensions/Xfixes.h> | 7 #include <X11/extensions/Xfixes.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/Xlib.h> | 10 #include <X11/Xlib.h> |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 default: | 229 default: |
230 return true; | 230 return true; |
231 } | 231 } |
232 } | 232 } |
233 void AshWindowTreeHostX11::TranslateAndDispatchLocatedEvent( | 233 void AshWindowTreeHostX11::TranslateAndDispatchLocatedEvent( |
234 ui::LocatedEvent* event) { | 234 ui::LocatedEvent* event) { |
235 TranslateLocatedEvent(event); | 235 TranslateLocatedEvent(event); |
236 SendEventToProcessor(event); | 236 SendEventToProcessor(event); |
237 } | 237 } |
238 | 238 |
239 bool AshWindowTreeHostX11::DispatchKeyEventPostIME(const ui::KeyEvent& event) { | 239 ui::EventDispatchDetails AshWindowTreeHostX11::DispatchKeyEventPostIME( |
240 ui::KeyEvent event_copy(event); | 240 ui::KeyEvent* event) { |
241 input_method_handler()->SetPostIME(true); | 241 input_method_handler()->SetPostIME(true); |
242 ui::EventDispatchDetails details = | 242 ui::EventDispatchDetails details = |
243 event_processor()->OnEventFromSource(&event_copy); | 243 event_processor()->OnEventFromSource(event); |
244 if (details.dispatcher_destroyed) | 244 if (!details.dispatcher_destroyed) |
245 return true; | 245 input_method_handler()->SetPostIME(false); |
246 input_method_handler()->SetPostIME(false); | 246 return details; |
247 return event_copy.stopped_propagation(); | |
248 } | 247 } |
249 | 248 |
250 #if defined(OS_CHROMEOS) | 249 #if defined(OS_CHROMEOS) |
251 void AshWindowTreeHostX11::SetCrOSTapPaused(bool state) { | 250 void AshWindowTreeHostX11::SetCrOSTapPaused(bool state) { |
252 if (!ui::IsXInput2Available()) | 251 if (!ui::IsXInput2Available()) |
253 return; | 252 return; |
254 // Temporarily pause tap-to-click when the cursor is hidden. | 253 // Temporarily pause tap-to-click when the cursor is hidden. |
255 Atom prop = atom_cache()->GetAtom("Tap Paused"); | 254 Atom prop = atom_cache()->GetAtom("Tap Paused"); |
256 unsigned char value = state; | 255 unsigned char value = state; |
257 const XIDeviceList& dev_list = | 256 const XIDeviceList& dev_list = |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 #endif | 292 #endif |
294 | 293 |
295 AshWindowTreeHost* AshWindowTreeHost::Create( | 294 AshWindowTreeHost* AshWindowTreeHost::Create( |
296 const AshWindowTreeHostInitParams& init_params) { | 295 const AshWindowTreeHostInitParams& init_params) { |
297 if (init_params.offscreen) | 296 if (init_params.offscreen) |
298 return new AshWindowTreeHostUnified(init_params.initial_bounds); | 297 return new AshWindowTreeHostUnified(init_params.initial_bounds); |
299 return new AshWindowTreeHostX11(init_params.initial_bounds); | 298 return new AshWindowTreeHostX11(init_params.initial_bounds); |
300 } | 299 } |
301 | 300 |
302 } // namespace ash | 301 } // namespace ash |
OLD | NEW |