OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/message_pump_x.h" | 5 #include "base/message_pump_x.h" |
6 | 6 |
7 #include <gdk/gdkx.h> | 7 #include <gdk/gdkx.h> |
8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 return; | 63 return; |
64 | 64 |
65 int event, err; | 65 int event, err; |
66 | 66 |
67 if (!XQueryExtension(display, "XInputExtension", &xiopcode, &event, &err)) { | 67 if (!XQueryExtension(display, "XInputExtension", &xiopcode, &event, &err)) { |
68 VLOG(1) << "X Input extension not available."; | 68 VLOG(1) << "X Input extension not available."; |
69 xiopcode = -1; | 69 xiopcode = -1; |
70 return; | 70 return; |
71 } | 71 } |
72 | 72 |
| 73 #if defined(USE_XI2_1) |
| 74 int major = 2, minor = 1; |
| 75 #else |
73 int major = 2, minor = 0; | 76 int major = 2, minor = 0; |
| 77 #endif |
74 if (XIQueryVersion(display, &major, &minor) == BadRequest) { | 78 if (XIQueryVersion(display, &major, &minor) == BadRequest) { |
75 VLOG(1) << "XInput2 not supported in the server."; | 79 VLOG(1) << "XInput" << major << "." << minor |
| 80 << "not supported in the server."; |
76 xiopcode = -1; | 81 xiopcode = -1; |
77 return; | 82 return; |
78 } | 83 } |
79 } | 84 } |
80 | 85 |
81 } // namespace | 86 } // namespace |
82 | 87 |
83 namespace base { | 88 namespace base { |
84 | 89 |
85 MessagePumpX::MessagePumpX() : MessagePumpGlib(), | 90 MessagePumpX::MessagePumpX() : MessagePumpGlib(), |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 } | 285 } |
281 | 286 |
282 MessagePumpObserver::EventStatus | 287 MessagePumpObserver::EventStatus |
283 MessagePumpObserver::WillProcessXEvent(XEvent* xev) { | 288 MessagePumpObserver::WillProcessXEvent(XEvent* xev) { |
284 return EVENT_CONTINUE; | 289 return EVENT_CONTINUE; |
285 } | 290 } |
286 | 291 |
287 COMPILE_ASSERT(XLASTEvent >= LASTEvent, XLASTEvent_too_small); | 292 COMPILE_ASSERT(XLASTEvent >= LASTEvent, XLASTEvent_too_small); |
288 | 293 |
289 } // namespace base | 294 } // namespace base |
OLD | NEW |