Add a callback from PsppireDialog on GtkDrawingArea draw signals.
authorJohn Darrington <john@cellform.com>
Mon, 19 Jun 2023 18:25:59 +0000 (20:25 +0200)
committerJohn Darrington <john@cellform.com>
Mon, 19 Jun 2023 18:25:59 +0000 (20:25 +0200)
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

index 99f6d228249f0bc5ca97dcf9b221c282edefd8b2..d35fcd602147b11c5b0451ff44b16364a46fd892 100644 (file)
@@ -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",