diff options
Diffstat (limited to 'src/plugins/platforms/wayland')
-rw-r--r-- | src/plugins/platforms/wayland/qwaylandshellsurface.cpp | 5 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/qwaylandshellsurface.h | 2 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/qwaylandwindow.cpp | 6 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/platforms/wayland/qwaylandshellsurface.cpp b/src/plugins/platforms/wayland/qwaylandshellsurface.cpp index 60176ef88..de0101f9b 100644 --- a/src/plugins/platforms/wayland/qwaylandshellsurface.cpp +++ b/src/plugins/platforms/wayland/qwaylandshellsurface.cpp @@ -107,6 +107,11 @@ void QWaylandShellSurface::updateTransientParent(QWindow *parent) flags); } +void QWaylandShellSurface::setClassName(const char *_class) +{ + wl_shell_surface_set_class(m_shell_surface, _class); +} + void QWaylandShellSurface::setTitle(const char *title) { wl_shell_surface_set_title(m_shell_surface, title); diff --git a/src/plugins/platforms/wayland/qwaylandshellsurface.h b/src/plugins/platforms/wayland/qwaylandshellsurface.h index 4772e69be..d18bda36d 100644 --- a/src/plugins/platforms/wayland/qwaylandshellsurface.h +++ b/src/plugins/platforms/wayland/qwaylandshellsurface.h @@ -64,6 +64,8 @@ public: struct wl_shell_surface *handle() const { return m_shell_surface; } + void setClassName(const char *_class); + void setTitle(const char *title); private: 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 <QtCore/QFileInfo> #include <QtGui/QWindow> #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<const QWaylandWindow *>(parent())); } else if (window->transientParent()) { |