diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp index 5a822bd603..a11dcb3041 100644 --- a/src/gtk/settings.cpp +++ b/src/gtk/settings.cpp @@ -14,6 +14,7 @@ #ifndef WX_PRECOMP #include "wx/toplevel.h" + #include "wx/module.h" #endif #include "wx/fontutil.h" @@ -958,3 +959,23 @@ bool wxSystemSettingsNative::HasFeature(wxSystemFeature index) return false; } } + +#ifdef __WXGTK3__ +class wxSystemSettingsModule: public wxModule +{ +public: + virtual bool OnInit() { return true; } + virtual void OnExit(); + wxDECLARE_DYNAMIC_CLASS(wxSystemSettingsModule); +}; +wxIMPLEMENT_DYNAMIC_CLASS(wxSystemSettingsModule, wxModule); + +void wxSystemSettingsModule::OnExit() +{ + GtkSettings* settings = gtk_settings_get_default(); + g_signal_handlers_disconnect_by_func(settings, + (void*)notify_gtk_theme_name, NULL); + g_signal_handlers_disconnect_by_func(settings, + (void*)notify_gtk_font_name, NULL); +} +#endif diff --git a/src/gtk/win_gtk.cpp b/src/gtk/win_gtk.cpp index 49f0b348dc..3415327452 100644 --- a/src/gtk/win_gtk.cpp +++ b/src/gtk/win_gtk.cpp @@ -334,6 +334,10 @@ GType wxPizza::type() static GType type; if (type == 0) { + type = g_type_from_name("wxPizza"); + if (type) + return type; + const GTypeInfo info = { sizeof(wxPizzaClass), NULL, NULL,