static pthread_mutex_t event_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t elem_mutex = PTHREAD_MUTEX_INITIALIZER;
+bool virtio_touchscreen_ready(void)
+{
+ if (ts == NULL) {
+ return false;
+ }
+
+ return virtio_queue_ready(ts->vq) != 0;
+}
void virtio_touchscreen_event(int x, int y, int z, int buttons_state)
{
uint8_t state;
} EmulTouchEvent;
+bool virtio_touchscreen_ready(void);
void virtio_touchscreen_event(int x, int y, int z, int buttons_state);
void maru_virtio_touchscreen_notify(void);
event->nativeScanCode() << event->modifiers() << event->nativeModifiers();
/* multi-touch checking */
- if (mtTracker != NULL && get_max_touch_point() > 1) {
- pressFilterMtChecking(event);
+ if (mtTracker != NULL && mtTracker->isTrackingReady() == true) {
+ if (get_max_touch_point() > 1) {
+ pressFilterMtChecking(event);
+ }
/* fall through */
}
int qt5_mt_height = 0;
extern "C" {
+bool virtio_touchscreen_ready(void);
void virtio_touchscreen_event(int x, int y, int z, int buttons_state);
}
return touchPointList;
}
+bool MultiTouchTracker::isTrackingReady()
+{
+ if (touchPointImage.isNull() == true) {
+ qWarning() << "touch point image is null";
+ return false;
+ }
+
+ return virtio_touchscreen_ready();
+}
+
int MultiTouchTracker::addTouchPoint(QPoint hostPos, QPoint guestPos)
{
const int touchCnt = touchPointList.count();
const QImage &getPointImage();
int getMaxTouchPoint();
QList<TouchPoint *> getTouchPointList();
+ bool isTrackingReady();
int addTouchPoint(QPoint hostPos, QPoint guestPos);
TouchPoint *searchTouchPoint(QPoint targetPos);