[Libreoffice-commits] core.git: vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Mon May 10 18:59:28 UTC 2021
vcl/unx/gtk3/gtkframe.cxx | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
New commits:
commit 60ed173e04838c57c1a73279d01fdad9bdd1575e
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon May 10 17:12:54 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon May 10 20:58:33 2021 +0200
gtk4: use gdk_wayland_toplevel_set_application_id for dynamic icon changing
Change-Id: Ie1f903a9fa8bfdb94ec3fc0409b350a3e73c444d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115350
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx
index 9933e4689dec..f8effa137620 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -1426,23 +1426,25 @@ void GtkSalFrame::SetIcon(const char* appicon)
{
gtk_window_set_icon_name(GTK_WINDOW(m_pWindow), appicon);
-#if !GTK_CHECK_VERSION(4,0,0)
#if defined(GDK_WINDOWING_WAYLAND)
if (DLSYM_GDK_IS_WAYLAND_DISPLAY(getGdkDisplay()))
{
+#if GTK_CHECK_VERSION(4,0,0)
+ GdkSurface* gdkWindow = gtk_native_get_surface(gtk_widget_get_native(m_pWindow));
+ gdk_wayland_toplevel_set_application_id((GDK_TOPLEVEL(gdkWindow)), appicon);
+#else
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);
-
- // gdk_wayland_window_set_application_id doesn't seem to work before
- // the window is mapped, so set this for real when/if we are mapped
- m_bIconSetWhileUnmapped = !gtk_widget_get_mapped(m_pWindow);
}
- }
#endif
+ // gdk_wayland_window_set_application_id doesn't seem to work before
+ // the window is mapped, so set this for real when/if we are mapped
+ m_bIconSetWhileUnmapped = !gtk_widget_get_mapped(m_pWindow);
+ }
#endif
}
More information about the Libreoffice-commits
mailing list