[Scummvm-git-logs] scummvm master -> bb0ce7ff25f4110ecacab8bc387f917c6be6d9a5

sev- sev at scummvm.org
Mon Nov 8 07:46:50 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
bb0ce7ff25 BACKENDS: DIALOG: GTK: Keep main window updated during GTK+ dialog


Commit: bb0ce7ff25f4110ecacab8bc387f917c6be6d9a5
    https://github.com/scummvm/scummvm/commit/bb0ce7ff25f4110ecacab8bc387f917c6be6d9a5
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2021-11-08T08:46:47+01:00

Commit Message:
BACKENDS: DIALOG: GTK: Keep main window updated during GTK+ dialog

Otherwise, anything moving across the main window while the dialog is
open may leave ugly trails. At least it does for me.

Changed paths:
    backends/dialogs/gtk/gtk-dialogs.cpp


diff --git a/backends/dialogs/gtk/gtk-dialogs.cpp b/backends/dialogs/gtk/gtk-dialogs.cpp
index 0d2d6fa9e1..a1602a5692 100644
--- a/backends/dialogs/gtk/gtk-dialogs.cpp
+++ b/backends/dialogs/gtk/gtk-dialogs.cpp
@@ -34,6 +34,16 @@
 
 #include <gtk/gtk.h>
 
+// TODO: Move this into the class? Probably possible, but I've been told that
+//       this might not necessarily work properly with all compilers.
+
+static gboolean _inDialog;
+
+static gboolean idleCallback(gpointer data) {
+	g_system->updateScreen();
+	return _inDialog;
+}
+
 Common::DialogManager::DialogResult GtkDialogManager::showFileBrowser(const Common::U32String &title, Common::FSNode &choice, bool isDirBrowser) {
 	if (!gtk_init_check(NULL, NULL))
 		return kDialogError;
@@ -65,6 +75,10 @@ Common::DialogManager::DialogResult GtkDialogManager::showFileBrowser(const Comm
 
 	// Show dialog
 	beginDialog();
+
+	_inDialog = TRUE;
+	g_idle_add(idleCallback, NULL);
+
 #if GTK_CHECK_VERSION(3,20,0)
 	int res = gtk_native_dialog_run(GTK_NATIVE_DIALOG(native));
 #else
@@ -79,6 +93,8 @@ Common::DialogManager::DialogResult GtkDialogManager::showFileBrowser(const Comm
 		g_free(path);
 	}
 
+	_inDialog = FALSE;
+
 #if GTK_CHECK_VERSION(3,20,0)
 	g_object_unref(native);
 #else




More information about the Scummvm-git-logs mailing list