Gtk/Wayland: Disable display driver during unfullscreening.

Gtk incorrectly doesn't resize widgets beneath a subsurface.
This commit is contained in:
BearOso 2024-02-08 12:49:12 -06:00
parent 68af8fe783
commit be6372c034
2 changed files with 19 additions and 0 deletions

View File

@ -965,6 +965,7 @@ void S9xDeinitDisplay()
if (driver) if (driver)
driver->deinit(); driver->deinit();
delete driver; delete driver;
driver = nullptr;
if (pool) if (pool)
{ {

View File

@ -1293,8 +1293,17 @@ void Snes9xWindow::leave_fullscreen_mode()
} }
#endif #endif
#ifdef GDK_WINDOWING_WAYLAND
if (GDK_IS_WAYLAND_WINDOW(gdk_window))
{
S9xDeinitDisplay();
}
#endif
window->unfullscreen(); window->unfullscreen();
window->show();
#ifdef GDK_WINDOWING_X11 #ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_WINDOW(gdk_window)) if (GDK_IS_X11_WINDOW(gdk_window))
{ {
@ -1310,6 +1319,15 @@ void Snes9xWindow::leave_fullscreen_mode()
config->rom_loaded = rom_loaded; config->rom_loaded = rom_loaded;
config->fullscreen = 0; config->fullscreen = 0;
configure_widgets(); configure_widgets();
window->show();
#ifdef GDK_WINDOWING_WAYLAND
if (GDK_IS_WAYLAND_WINDOW(gdk_window))
{
S9xReinitDisplay();
}
#endif
} }
void Snes9xWindow::resize_viewport(int width, int height) void Snes9xWindow::resize_viewport(int width, int height)