Chromium Code Reviews| 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/aura/root_window_host_linux.h" | 5 #include "ui/aura/root_window_host_linux.h" |
| 6 | 6 |
| 7 #include <X11/cursorfont.h> | 7 #include <X11/cursorfont.h> |
| 8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 381 if (size_changed) | 381 if (size_changed) |
| 382 root_window_->OnHostResized(bounds.size()); | 382 root_window_->OnHostResized(bounds.size()); |
| 383 handled = true; | 383 handled = true; |
| 384 break; | 384 break; |
| 385 } | 385 } |
| 386 case GenericEvent: { | 386 case GenericEvent: { |
| 387 ui::TouchFactory* factory = ui::TouchFactory::GetInstance(); | 387 ui::TouchFactory* factory = ui::TouchFactory::GetInstance(); |
| 388 if (!factory->ShouldProcessXI2Event(xev)) | 388 if (!factory->ShouldProcessXI2Event(xev)) |
| 389 break; | 389 break; |
| 390 | 390 |
| 391 // Update utouch frame state | |
| 392 #if defined(USE_UTOUCH) | |
| 393 ui::TouchFactory::GetInstance()->ProcessXI2Event(xev); | |
| 394 #else // USE_UTOUCH | |
|
rjkroege
2012/04/02 17:05:15
you should split out the change that is for the ex
| |
| 395 // Update the device list if necessary. | |
| 396 if (xev->xgeneric.evtype == XI_HierarchyChanged) { | |
| 397 ui::UpdateDeviceList(); | |
| 398 handled = true; | |
| 399 break; | |
| 400 } | |
|
sadrul
2012/04/03 19:52:01
This is already done in DispatcherLinux
| |
| 401 #endif // USE_UTOUCH | |
| 402 | |
| 391 ui::EventType type = ui::EventTypeFromNative(xev); | 403 ui::EventType type = ui::EventTypeFromNative(xev); |
| 392 // If this is a motion event we want to coalesce all pending motion | 404 // If this is a motion event we want to coalesce all pending motion |
| 393 // events that are at the top of the queue. | 405 // events that are at the top of the queue. |
| 394 XEvent last_event; | 406 XEvent last_event; |
| 395 int num_coalesced = 0; | 407 int num_coalesced = 0; |
| 396 | 408 |
| 397 switch (type) { | 409 switch (type) { |
| 398 case ui::ET_TOUCH_PRESSED: | 410 case ui::ET_TOUCH_PRESSED: |
| 399 case ui::ET_TOUCH_RELEASED: | 411 case ui::ET_TOUCH_RELEASED: |
| 400 case ui::ET_TOUCH_MOVED: { | 412 case ui::ET_TOUCH_MOVED: { |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 640 return new RootWindowHostLinux(bounds); | 652 return new RootWindowHostLinux(bounds); |
| 641 } | 653 } |
| 642 | 654 |
| 643 // static | 655 // static |
| 644 gfx::Size RootWindowHost::GetNativeScreenSize() { | 656 gfx::Size RootWindowHost::GetNativeScreenSize() { |
| 645 ::Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay(); | 657 ::Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay(); |
| 646 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); | 658 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); |
| 647 } | 659 } |
| 648 | 660 |
| 649 } // namespace aura | 661 } // namespace aura |
| OLD | NEW |