Browse Source

x11: Add x-support-xi2 variable to enable/disable XInput2 support

rdb 4 years ago
parent
commit
404b685f72

+ 4 - 0
panda/src/x11display/config_x11display.cxx

@@ -84,6 +84,10 @@ ConfigVariableString x_wm_class
  PRC_DESC("Specify the value to use for the res_class field of the window's "
  PRC_DESC("Specify the value to use for the res_class field of the window's "
           "WM_CLASS property."));
           "WM_CLASS property."));
 
 
+ConfigVariableBool x_support_xi2
+("x-support-xi2", true,
+ PRC_DESC("Set this to true to enable the use of XInput2 for input handling."));
+
 /**
 /**
  * Initializes the library.  This must be called at least once before any of
  * Initializes the library.  This must be called at least once before any of
  * the functions or classes in this library can be used.  Normally it will be
  * the functions or classes in this library can be used.  Normally it will be

+ 2 - 0
panda/src/x11display/config_x11display.h

@@ -37,4 +37,6 @@ extern ConfigVariableInt x_cursor_size;
 extern ConfigVariableString x_wm_class_name;
 extern ConfigVariableString x_wm_class_name;
 extern ConfigVariableString x_wm_class;
 extern ConfigVariableString x_wm_class;
 
 
+extern ConfigVariableBool x_support_xi2;
+
 #endif
 #endif

+ 2 - 1
panda/src/x11display/x11GraphicsPipe.cxx

@@ -224,7 +224,8 @@ x11GraphicsPipe(const std::string &display) :
 
 
   // Dynamically load the XInput2 extension.
   // Dynamically load the XInput2 extension.
   int ev, err;
   int ev, err;
-  if (XQueryExtension(_display, "XInputExtension", &_xi_opcode, &ev, &err)) {
+  if (x_support_xi2 &&
+      XQueryExtension(_display, "XInputExtension", &_xi_opcode, &ev, &err)) {
     void *xi = dlopen("libXi.so.6", RTLD_NOW | RTLD_LOCAL);
     void *xi = dlopen("libXi.so.6", RTLD_NOW | RTLD_LOCAL);
     if (xi != nullptr) {
     if (xi != nullptr) {
       pfn_XIQueryVersion _XIQueryVersion = (pfn_XIQueryVersion)dlsym(xi, "XIQueryVersion");
       pfn_XIQueryVersion _XIQueryVersion = (pfn_XIQueryVersion)dlsym(xi, "XIQueryVersion");