summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qguiapplication.h
diff options
context:
space:
mode:
authorPier Luigi Fiorini <pierluigi.fiorini@gmail.com>2015-08-13 16:37:07 +0200
committerPier Luigi Fiorini <pierluigi.fiorini@gmail.com>2015-08-27 11:00:39 +0000
commit61ad604ad41607be97efea5a18cd4d9fb7ddca73 (patch)
tree4f6d3612490205281309d6fa474ee403448dd32f /src/gui/kernel/qguiapplication.h
parent3b1cbc4753bcd30c6eec37728e531405d0aee30d (diff)
Add QGuiApplication::setDesktopFileName()
This property might be set by applications whose desktop entry file name cannot be determined by heuristics already in place. It is particularly useful for QtWayland as it can be used to determine the app_id simply by stripping the ".desktop" suffix from this property. Without a correct app_id, Wayland compositors won't be able to e.g. show the application icon on task managers. This property is also very interesting for X11 as there are various desktop environments trying to map windows to launchers. It will be possible to export desktopFileName as a xproperty, making such mapping less error prone. Change-Id: I0fef23f28f383639e625379ab46e36aecb338ac4 Reviewed-by: Martin Gräßlin <mgraesslin@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/gui/kernel/qguiapplication.h')
-rw-r--r--src/gui/kernel/qguiapplication.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h
index c89268d8d4..6eb26e8b06 100644
--- a/src/gui/kernel/qguiapplication.h
+++ b/src/gui/kernel/qguiapplication.h
@@ -67,6 +67,7 @@ class Q_GUI_EXPORT QGuiApplication : public QCoreApplication
Q_OBJECT
Q_PROPERTY(QIcon windowIcon READ windowIcon WRITE setWindowIcon)
Q_PROPERTY(QString applicationDisplayName READ applicationDisplayName WRITE setApplicationDisplayName)
+ Q_PROPERTY(QString desktopFileName READ desktopFileName WRITE setDesktopFileName)
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged)
Q_PROPERTY(QString platformName READ platformName STORED false)
Q_PROPERTY(bool quitOnLastWindowClosed READ quitOnLastWindowClosed WRITE setQuitOnLastWindowClosed)
@@ -82,6 +83,9 @@ public:
static void setApplicationDisplayName(const QString &name);
static QString applicationDisplayName();
+ static void setDesktopFileName(const QString &name);
+ static QString desktopFileName();
+
static QWindowList allWindows();
static QWindowList topLevelWindows();
static QWindow *topLevelAt(const QPoint &pos);