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

Side by Side Diff: base/message_pump_x.cc

Issue 7792094: touchui: support XInput2 MT (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Update patch according to comment #27 Created 9 years, 3 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 | « no previous file | build/common.gypi » ('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) 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
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_MT)
74 // USE_XI2_MT also defines the required XI2 minor minimum version.
75 int major = 2, minor = USE_XI2_MT;
76 #else
73 int major = 2, minor = 0; 77 int major = 2, minor = 0;
78 #endif
74 if (XIQueryVersion(display, &major, &minor) == BadRequest) { 79 if (XIQueryVersion(display, &major, &minor) == BadRequest) {
75 VLOG(1) << "XInput2 not supported in the server."; 80 VLOG(1) << "XInput2 not supported in the server.";
76 xiopcode = -1; 81 xiopcode = -1;
77 return; 82 return;
78 } 83 }
84 #if defined(USE_XI2_MT)
85 if (major < 2 || minor < USE_XI2_MT) {
Daniel Kurtz 2011/09/24 00:29:10 Sorry, this is my fault. This isn't quite right.
86 VLOG(1) << "XI version on server is " << major << "." << minor << ". "
87 << "But 2." << USE_XI2_MT << " is required.";
88 xiopcode = -1;
89 return;
90 }
91 #endif
79 } 92 }
80 93
81 } // namespace 94 } // namespace
82 95
83 namespace base { 96 namespace base {
84 97
85 MessagePumpX::MessagePumpX() : MessagePumpGlib(), 98 MessagePumpX::MessagePumpX() : MessagePumpGlib(),
86 x_source_(NULL), 99 x_source_(NULL),
87 gdksource_(NULL), 100 gdksource_(NULL),
88 dispatching_event_(false), 101 dispatching_event_(false),
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 } 293 }
281 294
282 MessagePumpObserver::EventStatus 295 MessagePumpObserver::EventStatus
283 MessagePumpObserver::WillProcessXEvent(XEvent* xev) { 296 MessagePumpObserver::WillProcessXEvent(XEvent* xev) {
284 return EVENT_CONTINUE; 297 return EVENT_CONTINUE;
285 } 298 }
286 299
287 COMPILE_ASSERT(XLASTEvent >= LASTEvent, XLASTEvent_too_small); 300 COMPILE_ASSERT(XLASTEvent >= LASTEvent, XLASTEvent_too_small);
288 301
289 } // namespace base 302 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | build/common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698