GNOME Bugzilla – Bug 643286
GTK3: gtk_cell_area_stop_editing warnings
Last modified: 2011-02-28 10:20:43 UTC
Our port of Cheese to GTK+ 3, currently here https://github.com/Patriciasc/Cheese-GTK-3/ shows a few of these warnings, though there is no obvious problem for the user: (cheese:3753): Gtk-CRITICAL **: gtk_cell_area_stop_editing: assertion `GTK_IS_CELL_AREA (area)' failed This is the backtrace at that point:
+ Trace 226115
An updated backtrace after rebuilding GTK+ from today's git master:
+ Trace 226116
Thanks for pasting the new backtrace. Building cheese was going to be time consuming I have a feeling (as I mentioned to Patricia, first I would have to build the latest vala, and I dont know what other dependencies). I added yet another commit to master today to prevent warnings from the icon view subclasses which access the icon view from the instance initializer (i.e. before the parent class has finished initializing... as I also mentioned, I did not intend to support these premature api accesses but since Company complained so loudly about it... we ended up supporting them). Today's commit is 2408b1c59ee3f6c190f5bfcbd7f22520175f1aaf Again, whether this works well or not, it's wiser to wait for the super class to finish initializing and only access it's apis from the ->constructor()... that's a good rule to follow for *any* subclass (since it's perfectly valid for the parent class to add some api in the future that requires it to finish initializing in ->constructor()).
Thanks. I don't really expect you to build Cheese. It's just to give a hint. Unfortunately the warning is still there, with this backtrace at that point:
+ Trace 226122
Actually, maybe we should just change the CheeseThumbView. Can you describe what you think we are doing wrong?
Created attachment 181937 [details] [review] 0001-Avoid-GtkIconView-warnings.patch This seems to fix it. Is this what you mean? And should I move more code from init() to constructed()?
I just added another patch to icon view that should fix your last warning f85e80aadadbd5ff96e18c5669376278f84ab451 (Company will be happy that we've forced as much api as possible to work from that stage). (In reply to comment #5) > Created an attachment (id=181937) [details] [review] > 0001-Avoid-GtkIconView-warnings.patch > > This seems to fix it. Is this what you mean? And should I move more code from > init() to constructed()? Yes that's what I mean. The thing is GtkCellLayout widgets that use a GtkCellArea build the cell area at constructor() time... this way the cell area can be provided by the caller with apis such as _new_with_area(). In truth, much GTK+ code already abuses the instance structure initializer (i.e. the _init()) and goes ahead calling lots of GTK+ apis prematurely, however that means that those subclasses will break if ever the parent class uses construct properties and defers its initialization to a later time than _init().
Thanks, and sorry for any frustration. The warnings are now gone, even without that patch to Cheese, so we can close this bug. I guess I should move more code into constructed() too anyway.
Created attachment 181947 [details] [review] 0001-Avoid-GtkIconView-warnings2.patch Actually, I'll keep this open so that Patricia can apply this patch to make things generally safer.
I already applied the patch so we can close this bug. Everything worked fine and the warnings are not showing any more. Thanks for the help!