| 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 ui::TouchFactory::GetInstance()->ProcessXI2Event(xev); |
| 393 |
| 394 // Update the device list if necessary. |
| 395 if (xev->xgeneric.evtype == XI_HierarchyChanged) { |
| 396 ui::UpdateDeviceList(); |
| 397 handled = true; |
| 398 break; |
| 399 } |
| 400 |
| 391 ui::EventType type = ui::EventTypeFromNative(xev); | 401 ui::EventType type = ui::EventTypeFromNative(xev); |
| 392 // If this is a motion event we want to coalesce all pending motion | 402 // If this is a motion event we want to coalesce all pending motion |
| 393 // events that are at the top of the queue. | 403 // events that are at the top of the queue. |
| 394 XEvent last_event; | 404 XEvent last_event; |
| 395 int num_coalesced = 0; | 405 int num_coalesced = 0; |
| 396 | 406 |
| 397 switch (type) { | 407 switch (type) { |
| 398 case ui::ET_TOUCH_PRESSED: | 408 case ui::ET_TOUCH_PRESSED: |
| 399 case ui::ET_TOUCH_RELEASED: | 409 case ui::ET_TOUCH_RELEASED: |
| 400 case ui::ET_TOUCH_MOVED: { | 410 case ui::ET_TOUCH_MOVED: { |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 return new RootWindowHostLinux(bounds); | 650 return new RootWindowHostLinux(bounds); |
| 641 } | 651 } |
| 642 | 652 |
| 643 // static | 653 // static |
| 644 gfx::Size RootWindowHost::GetNativeScreenSize() { | 654 gfx::Size RootWindowHost::GetNativeScreenSize() { |
| 645 ::Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay(); | 655 ::Display* xdisplay = base::MessagePumpX::GetDefaultXDisplay(); |
| 646 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); | 656 return gfx::Size(DisplayWidth(xdisplay, 0), DisplayHeight(xdisplay, 0)); |
| 647 } | 657 } |
| 648 | 658 |
| 649 } // namespace aura | 659 } // namespace aura |
| OLD | NEW |