From 45fe7b37ff05248c99bbbf79f5fd105364f8ea5c Mon Sep 17 00:00:00 2001 From: John Darrington Date: Mon, 19 Jun 2023 20:25:59 +0200 Subject: [PATCH] Add a callback from PsppireDialog on GtkDrawingArea draw signals. If a PsppireDialog contains a GtkDrawingArea, potentially any change to the drawn surface could indicate a change in state. Therefore, we need to notify interested parties of this change. --- src/ui/gui/psppire-dialog.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ui/gui/psppire-dialog.c b/src/ui/gui/psppire-dialog.c index 99f6d22824..d35fcd6021 100644 --- a/src/ui/gui/psppire-dialog.c +++ b/src/ui/gui/psppire-dialog.c @@ -281,11 +281,17 @@ connect_notify_signal (GtkWidget *w, gpointer data) dialog); } - /* It's unfortunate that GTK+ doesn't have a generic "user-modified-state-changed" signal. Instead, we have to try and predict what widgets and signals are likely to exist in our dialogs. */ + if (GTK_IS_DRAWING_AREA (w)) + { + g_signal_connect_swapped (w, "draw", + G_CALLBACK (psppire_dialog_notify_change), + dialog); + } + if (GTK_IS_TOGGLE_BUTTON (w)) { g_signal_connect_swapped (w, "toggled", -- 2.30.2