[vlc-commits] Set application display name and desktop entry

Kai Uwe Broulik git at videolan.org
Wed Apr 3 19:36:28 CEST 2019


vlc | branch: master | Kai Uwe Broulik <kde at privat.broulik.de> | Tue Apr  2 23:02:00 2019 +0200| [184664ada5fb0fa4296d2b8e5ad72f691b19a98f] | committer: Rémi Denis-Courmont

Set application display name and desktop entry

This ensures that the application can be properly identified.
For instance, a platform theme plugin may use those hints to identify the app
to the window manager, notification service, or system tray container.
Furthermore, on Wayland a desktop entry name is required in the the xdg-shell protocol.

Qt also automatically appends the application display name to the window title
on Windows and Linux removing the need for a custom window title function.

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=184664ada5fb0fa4296d2b8e5ad72f691b19a98f
---

 modules/gui/qt/main_interface.cpp | 9 +--------
 modules/gui/qt/qt.cpp             | 4 ++++
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index da3d809371..a95a83b94d 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -1288,14 +1288,7 @@ void MainInterface::setName( const QString& name )
  **/
 void MainInterface::setVLCWindowsTitle( const QString& aTitle )
 {
-    if( aTitle.isEmpty() )
-    {
-        setWindowTitle( qtr( "VLC media player" ) );
-    }
-    else
-    {
-        setWindowTitle( aTitle + " - " + qtr( "VLC media player" ) );
-    }
+    setWindowTitle( aTitle );
 }
 
 void MainInterface::showCryptedLabel( bool b_show )
diff --git a/modules/gui/qt/qt.cpp b/modules/gui/qt/qt.cpp
index a390d3b7ae..9d9440a3d8 100644
--- a/modules/gui/qt/qt.cpp
+++ b/modules/gui/qt/qt.cpp
@@ -533,11 +533,15 @@ static void *Thread( void *obj )
 #endif
             QSettings::UserScope, "vlc", "vlc-qt-interface" );
 
+    app.setApplicationDisplayName( qtr("VLC media player") );
+
     if( QDate::currentDate().dayOfYear() >= QT_XMAS_JOKE_DAY && var_InheritBool( p_intf, "qt-icon-change" ) )
         app.setWindowIcon( QIcon::fromTheme( "vlc-xmas", QIcon( ":/logo/vlc128-xmas.png" ) ) );
     else
         app.setWindowIcon( QIcon::fromTheme( "vlc", QIcon( ":/logo/vlc256.png" ) ) );
 
+    app.setDesktopFileName( PACKAGE );
+
     /* Initialize the Dialog Provider and the Main Input Manager */
     DialogsProvider::getInstance( p_intf );
     MainInputManager* mim = MainInputManager::getInstance( p_intf );



More information about the vlc-commits mailing list