[gtk/wip.win32.fixes: 2/17] widget: Change callback scope




commit 1cee37ec0d2176776c0b91d9ca322ed128e2d606
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Jul 28 21:48:01 2021 +0200

    widget: Change callback scope
    
    Look who changed his mind since commit 8e2ffb3b46 :-)
    
    The "call" scope means that the callback is only used during the
    function call itself (here: gtk_widget_class_install_action()).
    
    That's clearly wrong here, as the callback is invoked every time
    the action is activated.
    
    Arguably the "notified" scope is a better match here, where the
    lack of a GDestroyNotify parameter suggests that the callback may
    be used forever (which is the case here).
    
    Related: #3498

 gtk/gtkwidget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index a032876e55..825276b8f1 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -12449,7 +12449,7 @@ gtk_widget_class_add_action (GtkWidgetClass  *widget_class,
  * @widget_class: a `GtkWidgetClass`
  * @action_name: a prefixed action name, such as "clipboard.paste"
  * @parameter_type: (nullable): the parameter type
- * @activate: (scope call): callback to use when the action is activated
+ * @activate: (scope notified): callback to use when the action is activated
  *
  * This should be called at class initialization time to specify
  * actions to be added for all instances of this class.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]