From 819d3b1f159d34116fb27f00468371410322c1c8 Mon Sep 17 00:00:00 2001 From: Pier Luigi Fiorini Date: Mon, 5 Nov 2012 22:11:15 +0100 Subject: Set surface class name. The class name identifies the general class of applications to which the surface belongs. The class is the name of the desktop file and is derived from the process name. We might want to add a new method to QWindow in order to set a custom class name. It's quiet similar to WM_CLASS on X11, for more information see https://live.gnome.org/GnomeShell/ApplicationBased Change-Id: I5be90fb45e82e79710dda376f42c18c126d2a80f Reviewed-by: Andy Nichols --- src/plugins/platforms/wayland/qwaylandwindow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/plugins/platforms/wayland/qwaylandwindow.cpp') diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 8bb135675..1e48bfdea 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -51,6 +51,7 @@ #include "qwaylandsubsurface.h" #include "qwaylanddecoration.h" +#include #include #ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT @@ -92,6 +93,11 @@ QWaylandWindow::QWaylandWindow(QWindow *window) mDisplay->windowManagerIntegration()->authenticateWithToken(); #endif + // Set surface class to the .desktop file name (obtained from executable name) + QFileInfo exeFileInfo(qApp->applicationFilePath()); + QString className = exeFileInfo.baseName() + QLatin1String(".desktop"); + mShellSurface->setClassName(className.toUtf8().constData()); + if (parent() && mSubSurfaceWindow) { mSubSurfaceWindow->setParent(static_cast(parent())); } else if (window->transientParent()) { -- cgit v1.2.3