diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-07-08 10:13:26 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-07-08 13:39:34 +0200 |
commit | 2b17f09920e41c96bf8b5d4b1f5bc429b238f70e (patch) | |
tree | b0cb2aa4700463903aa6cee6769dd9112037dc37 /vcl | |
parent | 54b6a6a5c95ed51ce0cd709d9fd3e477ced5ce8f (diff) |
use gdk_wayland_window_set_application_id when it becomes available
Change-Id: I60775dcbfbc396f195a71f219668944d0bfecf31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98333
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkframe.cxx | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index 09c99caf81fd..b4757b39023c 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -1244,6 +1244,20 @@ void GtkSalFrame::SetIcon( sal_uInt16 nIcon ) appicon = g_strdup ("libreoffice-startcenter"); gtk_window_set_icon_name (GTK_WINDOW (m_pWindow), appicon); + +#if defined(GDK_WINDOWING_WAYLAND) + if (DLSYM_GDK_IS_WAYLAND_DISPLAY(getGdkDisplay())) + { + static auto set_application_id = reinterpret_cast<void (*) (GdkWindow*, const char*)>( + dlsym(nullptr, "gdk_wayland_window_set_application_id")); + if (set_application_id) + { + GdkWindow* gdkWindow = gtk_widget_get_window(m_pWindow); + set_application_id(gdkWindow, appicon); + } + } +#endif + g_free (appicon); } @@ -1312,13 +1326,18 @@ void GtkSalFrame::Show( bool bVisible, bool /*bNoActivate*/ ) } #if defined(GDK_WINDOWING_WAYLAND) - //rhbz#1334915, gnome#779143, tdf#100158 - //gtk under wayland lacks a way to change the app_id - //of a window, so brute force everything as a - //startcenter when initially shown to at least get - //the default LibreOffice icon and not the broken - //app icon - if (DLSYM_GDK_IS_WAYLAND_DISPLAY(getGdkDisplay())) + /* + rhbz#1334915, gnome#779143, tdf#100158 + https://gitlab.gnome.org/GNOME/gtk/-/issues/767 + + before gdk_wayland_window_set_application_id was available gtk + under wayland lacked a way to change the app_id of a window, so + brute force everything as a startcenter when initially shown to at + least get the default LibreOffice icon and not the broken app icon + */ + static bool bAppIdImmutable = DLSYM_GDK_IS_WAYLAND_DISPLAY(getGdkDisplay()) && + !dlsym(nullptr, "gdk_wayland_window_set_application_id"); + if (bAppIdImmutable) { OString sOrigName(g_get_prgname()); g_set_prgname("libreoffice-startcenter"); |