From 2c62ac41c179bca46dc151e3749747f076ef1fb3 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sat, 23 May 2020 11:14:00 -0700 Subject: [PATCH] Set WM_CLASS class name as app display name Gnome seems to use it as a fallback display name with X11. By default, it will be the capitalized program name, which is what GTK would set it to anyway. --- src/gtk/toplevel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 4a38a00b86..d7f94d8b3a 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -25,6 +25,7 @@ #ifndef WX_PRECOMP #include "wx/frame.h" + #include "wx/app.h" // GetAppDisplayName() #include "wx/icon.h" #include "wx/log.h" #endif @@ -629,6 +630,11 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent, m_title = title; +#ifndef __WXGTK4__ + // Gnome uses class as display name + gdk_set_program_class(wxTheApp->GetAppDisplayName().utf8_str()); +#endif + // NB: m_widget may be !=NULL if it was created by derived class' Create, // e.g. in wxTaskBarIconAreaGTK if (m_widget == NULL)