block signal GTK

julio <[email protected]> Sat, 25 Apr 2015 20:56:51 -0600
Newsgroups gmane.comp.gnome.love
Message-ID <[email protected]>
Hi everybody,
I am working on a bug in gnome-photos, what happens is that when you 
search something and click on any result the search bar is hidden and 
the text entry is cleared and that triggers a new search, I have tried 
to solve it in many ways, but I created other bugs :), so I was thinking 
if there is a way to block a signal emitted by the search bar, even if I 
am in a different compilation unit and if so. How could I do it?

  According to the docs:

g_signal_handlers_block_by_func(instance, func, data)

where instance would be (I guess) the search controller, function the 
callback function and data

data

The closure data of the handlers' closures.

I am not sure what would go under data but there is something else : in 
photos_search_controller_class_init
I just see

  signals[SEARCH_STRING_CHANGED] = g_signal_new ("search-string-changed",
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
                                                   G_STRUCT_OFFSET 
(PhotosSearchControllerClass,
search_string_changed),
                                                   NULL, /*accumulator */
                                                   NULL, /*accu_data */
g_cclosure_marshal_VOID__STRING,
                                                   G_TYPE_NONE,
                                                   1,
                                                   G_TYPE_STRING);

and in the photos_search_controller_set_string() function I can see this

   g_signal_emit (self, signals[SEARCH_STRING_CHANGED], 0, priv->str);

so I am not sure how would I block that signal, since it looks different 
from what I am used to see and I don't know if instance 
(g_signal_block_signal_by_func(instance, func, data)) would be search 
controller or the search controller string, what do I need to use in 
func since there doesn't seem to be a function associated with the 
signal, and last what should I use in the data argument. Maybe I am not 
doing the right thing or there is another way to do it.

I would appreciate your advice,


Thanks,

Julio Ordonez