Send a quit message to let the client shut down cleanly.
Change-Id: I5f99c9b92341fdb5f1b171f6fe36f26bf8a47026
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
<event name="hints">
<arg name="show_is_fullscreen" type="int"/>
</event>
+ <event name="quit">
+ </event>
</interface>
</protocol>
void Compositor::destroyClient(WaylandClient *c)
{
wl_client *client = static_cast<wl_client *>(c);
- if (client) {
+ if (!client)
+ return;
+
+ if (m_windowManagerIntegration->managedClient(client)) {
+ m_windowManagerIntegration->sendQuitMessage(client);
m_windowManagerIntegration->removeClient(client);
+ } else {
wl_client_destroy(client);
}
}
}
}
+void WindowManagerServerIntegration::sendQuitMessage(wl_client *client)
+{
+ struct wl_resource *resource;
+ wl_list_for_each(resource, &client_resources, link) {
+ if (resource->client == client) {
+ wl_windowmanager_send_quit(resource);
+ return;
+ }
+ }
+}
+
struct WindowManagerServerIntegrationClientData
{
QByteArray url;
WaylandManagedClient *managedClient(wl_client *client) const;
void setShowIsFullScreen(bool value);
+ void sendQuitMessage(wl_client *client);
signals:
void clientAuthenticated(wl_client *client);
mInputContext = QPlatformInputContextFactory::create();
}
+QWaylandIntegration::~QWaylandIntegration()
+{
+ delete mDrag;
+ delete mClipboard;
+ delete mAccessibility;
+ delete mNativeInterface;
+ delete mDisplay;
+}
+
QPlatformNativeInterface * QWaylandIntegration::nativeInterface() const
{
return mNativeInterface;
{
public:
QWaylandIntegration();
+ ~QWaylandIntegration();
bool hasCapability(QPlatformIntegration::Capability cap) const;
QPlatformWindow *createPlatformWindow(QWindow *window) const;
}
const struct wl_windowmanager_listener QWaylandWindowManagerIntegration::windowmanager_listener = {
- QWaylandWindowManagerIntegration::handle_hints
+ QWaylandWindowManagerIntegration::handle_hints,
+ QWaylandWindowManagerIntegration::handle_quit
};
void QWaylandWindowManagerIntegration::handle_hints(void *data, wl_windowmanager *ext, int32_t showIsFullScreen)
self->d_func()->m_showIsFullScreen = showIsFullScreen;
}
+void QWaylandWindowManagerIntegration::handle_quit(void *data, wl_windowmanager *ext)
+{
+ Q_UNUSED(data);
+ Q_UNUSED(ext);
+ QGuiApplication::quit();
+}
+
void QWaylandWindowManagerIntegration::mapClientToProcess(long long processId)
{
Q_D(QWaylandWindowManagerIntegration);
static void handle_hints(void *data,
struct wl_windowmanager *ext,
int32_t showIsFullScreen);
+ static void handle_quit(void *data, struct wl_windowmanager *ext);
static const struct wl_windowmanager_listener m_windowManagerListener;