void WaylandCompositor::enableTouchExtension()
{
- m_compositor->enableTouchExtension();
+ // nothing to do here
}
void WaylandCompositor::configureTouchExtension(TouchExtensionFlags flags)
m_outputExtension = new OutputExtensionGlobal(this);
m_surfaceExtension = new SurfaceExtensionGlobal(this);
m_qtkeyExtension = new QtKeyExtensionGlobal(this);
+ m_touchExtension = new TouchExtensionGlobal(this);
if (wl_display_add_socket(m_display->handle(), qt_compositor->socketName())) {
fprintf(stderr, "Fatal: Failed to open server socket\n");
return ret;
}
-void Compositor::enableTouchExtension()
-{
- if (!m_touchExtension) {
- m_touchExtension = new TouchExtensionGlobal(this);
- }
-}
-
void Compositor::configureTouchExtension(int flags)
{
if (m_touchExtension)
void setClientFullScreenHint(bool value);
- void enableTouchExtension();
TouchExtensionGlobal *touchExtension() { return m_touchExtension; }
void configureTouchExtension(int flags);
}
TouchExtensionGlobal *ext = m_compositor->touchExtension();
- if (ext) {
- ext->postTouchEvent(event, mouseFocus());
+ if (ext && ext->postTouchEvent(event, mouseFocus()))
return;
- }
const QList<QTouchEvent::TouchPoint> points = event->touchPoints();
if (points.isEmpty())
return int(f * 10000);
}
-void TouchExtensionGlobal::postTouchEvent(QTouchEvent *event, Surface *surface)
+bool TouchExtensionGlobal::postTouchEvent(QTouchEvent *event, Surface *surface)
{
const QList<QTouchEvent::TouchPoint> points = event->touchPoints();
const int pointCount = points.count();
if (!pointCount)
- return;
+ return false;
QPointF surfacePos = surface->pos();
wl_client *surfaceClient = surface->base()->resource.client;
pressure, vx, vy,
flags, rawData);
}
+
+ return true;
}
+
+ return false;
}
}
TouchExtensionGlobal(Compositor *compositor);
~TouchExtensionGlobal();
- void postTouchEvent(QTouchEvent *event, Surface *surface);
+ bool postTouchEvent(QTouchEvent *event, Surface *surface);
void setFlags(int flags) { m_flags = flags; }