mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-11-26 10:49:21 +00:00
GTK3: Fix crash on changing theme
SDL uses GTK to draw window title bars on Wayland, and can crash when the color scheme is changed. Disconnecting from the portal before launching the emulator works around this.
This commit is contained in:
parent
208c2645da
commit
8c1580ebc8
@ -287,4 +287,13 @@ color_scheme_set_async (AppColorScheme scheme)
|
||||
init_color_scheme_async();
|
||||
}
|
||||
|
||||
void
|
||||
color_scheme_disconnect (void)
|
||||
{
|
||||
if (desktop_portal)
|
||||
{
|
||||
g_object_unref(desktop_portal);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // GTK_CHECK_VERSION
|
||||
|
@ -432,6 +432,10 @@ static void gui_startup (void)
|
||||
#endif
|
||||
if (use_gui && !PrefsEditor())
|
||||
QuitEmulator();
|
||||
#ifdef ENABLE_GTK_3_22
|
||||
else
|
||||
color_scheme_disconnect();
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef ENABLE_GTK3
|
||||
|
@ -54,5 +54,6 @@ gboolean color_scheme_is_dark_theme (void);
|
||||
gboolean color_scheme_toggle (void);
|
||||
AppColorScheme color_scheme_get_app_scheme (void);
|
||||
DesktopColorScheme color_scheme_get_desktop_scheme (void);
|
||||
void color_scheme_disconnect (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -767,10 +767,14 @@ GtkWindow *win;
|
||||
static void gui_startup (void)
|
||||
{
|
||||
#ifdef ENABLE_GTK_3_22
|
||||
color_scheme_set(APP_PREFERS_LIGHT);
|
||||
color_scheme_set(APP_PREFERS_LIGHT);
|
||||
#endif
|
||||
if (use_gui && !PrefsEditor())
|
||||
QuitEmulator();
|
||||
#ifdef ENABLE_GTK_3_22
|
||||
else
|
||||
color_scheme_disconnect();
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef ENABLE_GTK3
|
||||
|
Loading…
Reference in New Issue
Block a user