[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 8 11:40:28 UTC 2020
vcl/unx/gtk3/gtk3gtkframe.cxx | 33 ++++++++++++++++++++++++++-------
1 file changed, 26 insertions(+), 7 deletions(-)
New commits:
commit 2b17f09920e41c96bf8b5d4b1f5bc429b238f70e
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Jul 8 10:13:26 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Jul 8 13:39:34 2020 +0200
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 at redhat.com>
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");
More information about the Libreoffice-commits
mailing list