[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] [bug #32406] env var TSLIB_TSDEVICE ignored
From: |
Gabriele Mondada |
Subject: |
[Gnash-commit] [bug #32406] env var TSLIB_TSDEVICE ignored |
Date: |
Thu, 09 Jun 2011 11:39:04 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; fr-fr) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1 |
Follow-up Comment #5, bug #32406 (project gnash):
Here is a patch for version 0.8.9 with some not-so-clean code inside:
<pre>
diff -ru gnash-0.8.9/gui/fb/TouchDevice.cpp
gnash-0.8.9.modified/gui/fb/TouchDevice.cpp
--- gnash-0.8.9/gui/fb/TouchDevice.cpp 2011-02-26 19:11:07.000000000 +0100
+++ gnash-0.8.9.modified/gui/fb/TouchDevice.cpp 2011-06-09 10:09:13.000000000
+0200
@@ -80,15 +80,12 @@
_type = TouchDevice::TOUCHSCREEN;
_filespec = filespec;
- char *devname = getenv(TSLIB_DEVICE_ENV);
+ const char *devname = getenv(TSLIB_DEVICE_ENV);
if (!devname) {
- devname = const_cast<char *>(TSLIB_DEVICE_NAME);
- } else {
- if (!filespec.empty()) {
- devname = const_cast<char *>(_filespec.c_str());
- } else {
+ if (!filespec.empty())
+ devname = _filespec.c_str();
+ else
log_error("No filespec specified for the touchscreen device.");
- }
}
_tsDev = ts_open(devname, 1); //Open tslib non-blocking
@@ -134,10 +131,8 @@
if (event.y >
static_cast<int>(_gui->getStage()->getStageHeight())) {
event.y =
static_cast<int>(_gui->getStage()->getStageHeight());
}
- // FIXME: the API for these mouse events has changed, so this
needs to be
- // updated.
- _gui->notifyMouseMove(int(event.x / _gui->getXScale()),
- int(event.y / _gui->getYScale()));
+
+ _gui->notifyMouseMove(int(event.x), int(event.y));
_gui->notifyMouseClick(true); //fire mouse click event into
Gnash
log_debug("Touched x: %d y: %d width: %d height: %d",
@@ -285,9 +280,16 @@
struct ts_types touch[] = {
InputDevice::TOUCHSCREEN, "/dev/ts",
+ InputDevice::UNKNOWN, 0,
InputDevice::UNKNOWN, 0
};
+ const char *devname = getenv(TSLIB_DEVICE_ENV);
+ if (devname) {
+ touch[1].type = InputDevice::TOUCHSCREEN;
+ touch[1].filespec = devname;
+ }
+
int i = 0;
while (touch[i].type != InputDevice::UNKNOWN) {
int fd = 0;
</pre>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?32406>
_______________________________________________
Message posté via/par Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] [bug #32406] env var TSLIB_TSDEVICE ignored,
Gabriele Mondada <=