Allow initializing wxWidgets multiple times against one instance of GTK+, episode 3
See #17751
This commit is contained in:
@@ -1024,6 +1024,11 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxSystemSettingsModule, wxModule);
|
|||||||
void wxSystemSettingsModule::OnExit()
|
void wxSystemSettingsModule::OnExit()
|
||||||
{
|
{
|
||||||
#ifdef __WXGTK3__
|
#ifdef __WXGTK3__
|
||||||
|
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);
|
||||||
#else
|
#else
|
||||||
if (gs_tlw_parent)
|
if (gs_tlw_parent)
|
||||||
gtk_widget_destroy(gs_tlw_parent);
|
gtk_widget_destroy(gs_tlw_parent);
|
||||||
|
@@ -325,6 +325,13 @@ GType wxPizza::type()
|
|||||||
static GType type;
|
static GType type;
|
||||||
if (type == 0)
|
if (type == 0)
|
||||||
{
|
{
|
||||||
|
const char* name = "wxPizza";
|
||||||
|
char buf[30];
|
||||||
|
for (unsigned i = 0; g_type_from_name(name); i++)
|
||||||
|
{
|
||||||
|
g_snprintf(buf, sizeof(buf), "wxPizza%u", i);
|
||||||
|
name = buf;
|
||||||
|
}
|
||||||
const GTypeInfo info = {
|
const GTypeInfo info = {
|
||||||
sizeof(wxPizzaClass),
|
sizeof(wxPizzaClass),
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
@@ -334,7 +341,7 @@ GType wxPizza::type()
|
|||||||
NULL, NULL
|
NULL, NULL
|
||||||
};
|
};
|
||||||
type = g_type_register_static(
|
type = g_type_register_static(
|
||||||
GTK_TYPE_FIXED, "wxPizza", &info, GTypeFlags(0));
|
GTK_TYPE_FIXED, name, &info, GTypeFlags(0));
|
||||||
#ifdef __WXGTK3__
|
#ifdef __WXGTK3__
|
||||||
const GInterfaceInfo interface_info = { NULL, NULL, NULL };
|
const GInterfaceInfo interface_info = { NULL, NULL, NULL };
|
||||||
g_type_add_interface_static(type, GTK_TYPE_SCROLLABLE, &interface_info);
|
g_type_add_interface_static(type, GTK_TYPE_SCROLLABLE, &interface_info);
|
||||||
|
Reference in New Issue
Block a user