Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: ui/base/x/x11_util.cc

Issue 17049002: Revert "Merge CMTEventData and ValuatorTracker" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/x/valuators.cc ('k') | ui/ui.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 17 matching lines...) Expand all
28 #include "base/message_loop.h" 28 #include "base/message_loop.h"
29 #include "base/metrics/histogram.h" 29 #include "base/metrics/histogram.h"
30 #include "base/strings/string_number_conversions.h" 30 #include "base/strings/string_number_conversions.h"
31 #include "base/strings/string_util.h" 31 #include "base/strings/string_util.h"
32 #include "base/strings/stringprintf.h" 32 #include "base/strings/stringprintf.h"
33 #include "base/sys_byteorder.h" 33 #include "base/sys_byteorder.h"
34 #include "base/threading/thread.h" 34 #include "base/threading/thread.h"
35 #include "ui/base/events/event_utils.h" 35 #include "ui/base/events/event_utils.h"
36 #include "ui/base/keycodes/keyboard_code_conversion_x.h" 36 #include "ui/base/keycodes/keyboard_code_conversion_x.h"
37 #include "ui/base/touch/touch_factory_x11.h" 37 #include "ui/base/touch/touch_factory_x11.h"
38 #include "ui/base/x/device_data_manager.h" 38 #include "ui/base/x/valuators.h"
39 #include "ui/base/x/x11_util_internal.h" 39 #include "ui/base/x/x11_util_internal.h"
40 #include "ui/gfx/point_conversions.h" 40 #include "ui/gfx/point_conversions.h"
41 #include "ui/gfx/rect.h" 41 #include "ui/gfx/rect.h"
42 #include "ui/gfx/size.h" 42 #include "ui/gfx/size.h"
43 43
44 #if defined(OS_FREEBSD) 44 #if defined(OS_FREEBSD)
45 #include <sys/sysctl.h> 45 #include <sys/sysctl.h>
46 #include <sys/types.h> 46 #include <sys/types.h>
47 #endif 47 #endif
48 48
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 // with one from the master and one from the slave so there will 513 // with one from the master and one from the slave so there will
514 // always be at least one pending. 514 // always be at least one pending.
515 if (!ui::TouchFactory::GetInstance()->ShouldProcessXI2Event(&next_event)) { 515 if (!ui::TouchFactory::GetInstance()->ShouldProcessXI2Event(&next_event)) {
516 XFreeEventData(display, &next_event.xcookie); 516 XFreeEventData(display, &next_event.xcookie);
517 XNextEvent(display, &next_event); 517 XNextEvent(display, &next_event);
518 continue; 518 continue;
519 } 519 }
520 520
521 if (next_event.type == GenericEvent && 521 if (next_event.type == GenericEvent &&
522 next_event.xgeneric.evtype == event_type && 522 next_event.xgeneric.evtype == event_type &&
523 !ui::DeviceDataManager::GetInstance()->IsCMTGestureEvent( 523 !ui::GetScrollOffsets(&next_event, NULL, NULL, NULL, NULL, NULL) &&
524 &next_event)) { 524 !ui::GetFlingData(&next_event, NULL, NULL, NULL, NULL, NULL)) {
525 XIDeviceEvent* next_xievent = 525 XIDeviceEvent* next_xievent =
526 static_cast<XIDeviceEvent*>(next_event.xcookie.data); 526 static_cast<XIDeviceEvent*>(next_event.xcookie.data);
527 // Confirm that the motion event is targeted at the same window 527 // Confirm that the motion event is targeted at the same window
528 // and that no buttons or modifiers have changed. 528 // and that no buttons or modifiers have changed.
529 if (xievent->event == next_xievent->event && 529 if (xievent->event == next_xievent->event &&
530 xievent->child == next_xievent->child && 530 xievent->child == next_xievent->child &&
531 xievent->buttons.mask_len == next_xievent->buttons.mask_len && 531 xievent->buttons.mask_len == next_xievent->buttons.mask_len &&
532 (memcmp(xievent->buttons.mask, 532 (memcmp(xievent->buttons.mask,
533 next_xievent->buttons.mask, 533 next_xievent->buttons.mask,
534 xievent->buttons.mask_len) == 0) && 534 xievent->buttons.mask_len) == 0) &&
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1556 << "request_code " << static_cast<int>(error_event.request_code) << ", " 1556 << "request_code " << static_cast<int>(error_event.request_code) << ", "
1557 << "minor_code " << static_cast<int>(error_event.minor_code) 1557 << "minor_code " << static_cast<int>(error_event.minor_code)
1558 << " (" << request_str << ")"; 1558 << " (" << request_str << ")";
1559 } 1559 }
1560 1560
1561 // ---------------------------------------------------------------------------- 1561 // ----------------------------------------------------------------------------
1562 // End of x11_util_internal.h 1562 // End of x11_util_internal.h
1563 1563
1564 1564
1565 } // namespace ui 1565 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/x/valuators.cc ('k') | ui/ui.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698