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 // This file defines utility functions for X11 (Linux only). This code has been | 5 // This file defines utility functions for X11 (Linux only). This code has been |
6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support | 6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support |
7 // remains woefully incomplete. | 7 // remains woefully incomplete. |
8 | 8 |
9 #include "ui/base/x/x11_util.h" | 9 #include "ui/base/x/x11_util.h" |
10 | 10 |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 // with one from the master and one from the slave so there will | 569 // with one from the master and one from the slave so there will |
570 // always be at least one pending. | 570 // always be at least one pending. |
571 if (!ui::TouchFactory::GetInstance()->ShouldProcessXI2Event(&next_event)) { | 571 if (!ui::TouchFactory::GetInstance()->ShouldProcessXI2Event(&next_event)) { |
572 XFreeEventData(display, &next_event.xcookie); | 572 XFreeEventData(display, &next_event.xcookie); |
573 XNextEvent(display, &next_event); | 573 XNextEvent(display, &next_event); |
574 continue; | 574 continue; |
575 } | 575 } |
576 | 576 |
577 if (next_event.type == GenericEvent && | 577 if (next_event.type == GenericEvent && |
578 next_event.xgeneric.evtype == event_type && | 578 next_event.xgeneric.evtype == event_type && |
579 !ui::GetScrollOffsets(&next_event, NULL, NULL, NULL)) { | 579 !ui::GetScrollOffsets(&next_event, NULL, NULL, NULL, NULL, NULL)) { |
580 XIDeviceEvent* next_xievent = | 580 XIDeviceEvent* next_xievent = |
581 static_cast<XIDeviceEvent*>(next_event.xcookie.data); | 581 static_cast<XIDeviceEvent*>(next_event.xcookie.data); |
582 #if defined(USE_XI2_MT) | 582 #if defined(USE_XI2_MT) |
583 float next_tracking_id = -1; | 583 float next_tracking_id = -1; |
584 if (event_type == XI_TouchUpdate) { | 584 if (event_type == XI_TouchUpdate) { |
585 // If this is a touch motion event (as opposed to mouse motion event), | 585 // If this is a touch motion event (as opposed to mouse motion event), |
586 // then make sure the events are from the same touch-point. | 586 // then make sure the events are from the same touch-point. |
587 if (!ui::ValuatorTracker::GetInstance()->ExtractValuator(next_event, | 587 if (!ui::ValuatorTracker::GetInstance()->ExtractValuator(next_event, |
588 ui::ValuatorTracker::VAL_TRACKING_ID, &next_tracking_id)) | 588 ui::ValuatorTracker::VAL_TRACKING_ID, &next_tracking_id)) |
589 next_tracking_id = -1; | 589 next_tracking_id = -1; |
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1828 << "request_code " << static_cast<int>(error_event.request_code) << ", " | 1828 << "request_code " << static_cast<int>(error_event.request_code) << ", " |
1829 << "minor_code " << static_cast<int>(error_event.minor_code) | 1829 << "minor_code " << static_cast<int>(error_event.minor_code) |
1830 << " (" << request_str << ")"; | 1830 << " (" << request_str << ")"; |
1831 } | 1831 } |
1832 | 1832 |
1833 // ---------------------------------------------------------------------------- | 1833 // ---------------------------------------------------------------------------- |
1834 // End of x11_util_internal.h | 1834 // End of x11_util_internal.h |
1835 | 1835 |
1836 | 1836 |
1837 } // namespace ui | 1837 } // namespace ui |
OLD | NEW |