When a QWaylandWindow is destroyed we need to make sure it's not still
referenced by QWaylandInputDevice.
#endif
void setCursor(QWaylandBuffer *buffer, int32_t x, int32_t y);
#endif
void setCursor(QWaylandBuffer *buffer, int32_t x, int32_t y);
void syncCallback(wl_display_sync_func_t func, void *data);
void frameCallback(wl_display_frame_func_t func, void *data);
struct wl_display *wl_display() const { return mDisplay; }
void syncCallback(wl_display_sync_func_t func, void *data);
void frameCallback(wl_display_frame_func_t func, void *data);
struct wl_display *wl_display() const { return mDisplay; }
+
+ QList<QWaylandInputDevice *> inputDevices() const { return mInputDevices; }
+
public slots:
void createNewScreen(struct wl_output *output, QRect geometry);
void readEvents();
public slots:
void createNewScreen(struct wl_output *output, QRect geometry);
void readEvents();
+void QWaylandInputDevice::handleWindowDestroyed(QWaylandWindow *window)
+{
+ if (window == mPointerFocus)
+ mPointerFocus = 0;
+ if (window == mKeyboardFocus)
+ mKeyboardFocus = 0;
+}
+
void QWaylandInputDevice::inputHandleMotion(void *data,
struct wl_input_device *input_device,
uint32_t time,
void QWaylandInputDevice::inputHandleMotion(void *data,
struct wl_input_device *input_device,
uint32_t time,
public:
QWaylandInputDevice(struct wl_display *display, uint32_t id);
void attach(QWaylandBuffer *buffer, int x, int y);
public:
QWaylandInputDevice(struct wl_display *display, uint32_t id);
void attach(QWaylandBuffer *buffer, int x, int y);
+ void handleWindowDestroyed(QWaylandWindow *window);
private:
struct wl_display *mDisplay;
private:
struct wl_display *mDisplay;
#include "qwaylandwindow.h"
#include "qwaylandwindow.h"
+#include "qwaylandbuffer.h"
#include "qwaylanddisplay.h"
#include "qwaylanddisplay.h"
+#include "qwaylandinputdevice.h"
#include "qwaylandscreen.h"
#include "qwaylandscreen.h"
-#include "qwaylandbuffer.h"
#include <QtGui/QWidget>
#include <QtGui/QWindowSystemInterface>
#include <QtGui/QWidget>
#include <QtGui/QWindowSystemInterface>
{
if (mSurface)
wl_surface_destroy(mSurface);
{
if (mSurface)
wl_surface_destroy(mSurface);
+
+ QList<QWaylandInputDevice *> inputDevices = mDisplay->inputDevices();
+ for (int i = 0; i < inputDevices.size(); ++i)
+ inputDevices.at(i)->handleWindowDestroyed(this);
}
WId QWaylandWindow::winId() const
}
WId QWaylandWindow::winId() const