summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2008-04-28 18:33:43 +0800
committerSam Spilsbury <smspillaz@gmail.com>2008-04-28 18:33:43 +0800
commit047003f85658f0cd62714cb3b90f089a7a3af0c0 (patch)
treec2f9fe84d5b1389f3679866e1c6d1bcd508790b4
parent7a501dc13d6d3588adca7d5b9e0be78695a7cd3c (diff)
downloadwiimote-047003f85658f0cd62714cb3b90f089a7a3af0c0.tar.gz
wiimote-047003f85658f0cd62714cb3b90f089a7a3af0c0.tar.bz2
* Reload the options on initDisplay so that if one of the multilists is blank and reloadWiimoteOptions does not get called for that multilist, then we do not end up with a bunch of garbadge variables what strncpy() dies on
-rw-r--r--.dotest/00010
-rw-r--r--.dotest/last0
-rw-r--r--action.c2
-rw-r--r--callback.c2
-rw-r--r--compiz-wiimote.h1
-rw-r--r--connect.c2
-rw-r--r--gesture.c2
-rw-r--r--option.c2
-rw-r--r--report.c2
-rw-r--r--util.c2
-rw-r--r--wiimote.c4
11 files changed, 18 insertions, 1 deletions
diff --git a/.dotest/0001 b/.dotest/0001
deleted file mode 100644
index e69de29..0000000
--- a/.dotest/0001
+++ /dev/null
diff --git a/.dotest/last b/.dotest/last
deleted file mode 100644
index e69de29..0000000
--- a/.dotest/last
+++ /dev/null
diff --git a/action.c b/action.c
index 8ee8702..ac1207c 100644
--- a/action.c
+++ b/action.c
@@ -21,6 +21,8 @@
#include "compiz-wiimote.h"
#include "wiimote_options.h"
+static int wiimoteDisplayPrivateIndex;
+
/* Callable Actions --------------------------------------------------- */
Bool
diff --git a/callback.c b/callback.c
index 7d1776d..497103c 100644
--- a/callback.c
+++ b/callback.c
@@ -21,6 +21,8 @@
#include "compiz-wiimote.h"
#include "wiimote_options.h"
+static int wiimoteDisplayPrivateIndex;
+
/* Prototype cwiid_callback with cwiid_callback_t, define it with the actual
* type - this will cause a compile error (rather than some undefined bizarre
diff --git a/compiz-wiimote.h b/compiz-wiimote.h
index 79ab61d..a36931a 100644
--- a/compiz-wiimote.h
+++ b/compiz-wiimote.h
@@ -372,7 +372,6 @@ typedef struct _WiimoteScreen
cwiid_mesg_callback_t wiimoteCWiiDCallback;
cwiid_err_t err;
-static int wiimoteDisplayPrivateIndex;
CompDisplay *firstDisplay;
/* Function Prototypes */
diff --git a/connect.c b/connect.c
index 0b4226e..d29ff59 100644
--- a/connect.c
+++ b/connect.c
@@ -21,6 +21,8 @@
#include "compiz-wiimote.h"
#include "wiimote_options.h"
+static int wiimoteDisplayPrivateIndex;
+
/* Wii Remote Connection / Handling --------------------------------------------------- */
/* Allocate a callback function */
diff --git a/gesture.c b/gesture.c
index 0d77778..2e288e9 100644
--- a/gesture.c
+++ b/gesture.c
@@ -21,6 +21,8 @@
#include "compiz-wiimote.h"
#include "wiimote_options.h"
+static int wiimoteDisplayPrivateIndex;
+
/* Gesturing and gesture checking --------------------------------------------- */
#define CHECK_BUTTON(a,b,c,e) \
diff --git a/option.c b/option.c
index 54a7225..30d2ad8 100644
--- a/option.c
+++ b/option.c
@@ -21,6 +21,8 @@
#include "compiz-wiimote.h"
#include "wiimote_options.h"
+static int wiimoteDisplayPrivateIndex;
+
/* Option Initialisation --------------------------------------------------- */
void
diff --git a/report.c b/report.c
index d420e98..795b6c8 100644
--- a/report.c
+++ b/report.c
@@ -20,6 +20,8 @@
#include "compiz-wiimote.h"
+static int wiimoteDisplayPrivateIndex;
+
/* Value Reporting --------------------------------------------------- */
Bool sendReports(void *vs)
diff --git a/util.c b/util.c
index adda275..a2fef3a 100644
--- a/util.c
+++ b/util.c
@@ -20,6 +20,8 @@
#include "compiz-wiimote.h"
+static int wiimoteDisplayPrivateIndex;
+
/* Utility Functions --------------------------------------------------- */
/* Error Handling */
diff --git a/wiimote.c b/wiimote.c
index d473c31..8c67c3f 100644
--- a/wiimote.c
+++ b/wiimote.c
@@ -23,6 +23,7 @@
#include "compiz-wiimote.h"
#include "wiimote_options.h"
+static int wiimoteDisplayPrivateIndex;
static int corePrivateIndex;
/* Wrappable Functions --------------------------------------------------- */
@@ -168,6 +169,9 @@ wiimoteInitDisplay (CompPlugin *p,
ad->cWiimote[i].report[j].type = 0;
}
}
+
+ reloadWiimoteOptions (d);
+
wiimoteSetXCalibrationMulNotify (d, wiimoteDisplayOptionChanged);
wiimoteSetYCalibrationMulNotify (d, wiimoteDisplayOptionChanged);
wiimoteSetXAdjustNotify (d, wiimoteDisplayOptionChanged);