summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWeseung Hwang <weseung@gmail.com>2011-02-01 19:54:50 -0800
committerWeseung Hwang <weseung@gmail.com>2011-02-01 19:54:50 -0800
commitf9ac7bd0e20eafc394260be38789dfcbff99db68 (patch)
treeb60d3d6f90b07f032f359dcba3ddb4109638a56e
parenta76bed2e77189ec71e31a7d7cfdf2e243db152ce (diff)
Added a new function in xNestedMouse to allow the main nested driver to load the nested mouse driver during its startup sequence. With Josh's help made it not segfault, and made it runnable by non-root (that part might not be code-side). TODO: get rid of the compiler warnings that don't have to do with deprecated functions.
-rw-r--r--src/driver.c3
-rw-r--r--src/xNestedMouse.c6
-rw-r--r--src/xNestedMouse.h2
3 files changed, 11 insertions, 0 deletions
diff --git a/src/driver.c b/src/driver.c
index c180035..253fc00 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -38,6 +38,8 @@
#include "client.h"
+#include "xNestedMouse.h"
+
#define NESTED_VERSION 0
#define NESTED_NAME "NESTED"
#define NESTED_DRIVER_NAME "nested"
@@ -165,6 +167,7 @@ NestedSetup(pointer module, pointer opts, int *errmaj, int *errmin) {
if (!setupDone) {
setupDone = TRUE;
xf86AddDriver(&NESTED, module, HaveDriverFuncs);
+ Load_Nested_Mouse(module);
return (pointer)1;
} else {
diff --git a/src/xNestedMouse.c b/src/xNestedMouse.c
index 0cdb09b..c651f02 100644
--- a/src/xNestedMouse.c
+++ b/src/xNestedMouse.c
@@ -175,3 +175,9 @@ NestedMouseControl(DeviceIntPtr device, int what) {
static void
NestedMouseReadInput(InputInfoPtr pInfo) {
}
+
+//Helper func to load mouse driver at the init of nested video driver
+void Load_Nested_Mouse(pointer module) {
+ xf86Msg(X_INFO, "NESTED MOUSE LOADING\n");
+ xf86AddInputDriver(&NESTEDMOUSE, module, 0);
+}
diff --git a/src/xNestedMouse.h b/src/xNestedMouse.h
index 0cd2858..d586a36 100644
--- a/src/xNestedMouse.h
+++ b/src/xNestedMouse.h
@@ -9,3 +9,5 @@ typedef struct _NestedMouseDeviceRec {
int num_vals;
int axes;
} NestedMouseDeviceRec, *NestedMouseDevicePtr;
+
+void Load_Nested_Mouse(pointer module);