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

Unified Diff: tools/xdisplaycheck/xdisplaycheck.cc

Issue 862133002: Update from https://crrev.com/312398 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: tools/xdisplaycheck/xdisplaycheck.cc
diff --git a/tools/xdisplaycheck/xdisplaycheck.cc b/tools/xdisplaycheck/xdisplaycheck.cc
index a5a447c11120b12dfe376730adcac5b1d2130b9b..6623153a846c06f5d618df5223682e77baff3e90 100644
--- a/tools/xdisplaycheck/xdisplaycheck.cc
+++ b/tools/xdisplaycheck/xdisplaycheck.cc
@@ -16,6 +16,10 @@
#include <time.h>
#include <X11/Xlib.h>
+#if defined(USE_AURA)
+#include <X11/extensions/XInput2.h>
+#endif
+
void Sleep(int duration_ms) {
struct timespec sleep_time, remaining;
@@ -73,6 +77,33 @@ int main(int argc, char* argv[]) {
fprintf(stderr, "Connected after %d retries\n", tries);
+#if defined(USE_AURA)
+ // Check for XInput2
+ int opcode, event, err;
+ if (!XQueryExtension(scoped_display.display(), "XInputExtension", &opcode,
+ &event, &err)) {
+ fprintf(stderr,
+ "Failed to get XInputExtension on %s.\n", XDisplayName(NULL));
+ return -2;
+ }
+
+ int major = 2, minor = 0;
+ if (XIQueryVersion(scoped_display.display(), &major, &minor) == BadRequest) {
+ fprintf(stderr,
+ "Server does not have XInput2 on %s.\n", XDisplayName(NULL));
+ return -3;
+ }
+
+ // Ask for the list of devices. This can cause some Xvfb to crash.
+ int count = 0;
+ XIDeviceInfo* devices =
+ XIQueryDevice(scoped_display.display(), XIAllDevices, &count);
+ if (devices)
+ XIFreeDeviceInfo(devices);
+
+ fprintf(stderr,
+ "XInput2 verified initially sane on %s.\n", XDisplayName(NULL));
+#endif
return 0;
}
« shell/BUILD.gn ('K') | « tools/vim/chromium.ycm_extra_conf.py ('k') | ui/events/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698