Re: Problem with reparent (Gtk+-2.12)



В Птн, 08/02/2008 в 11:56 +0200, Tor Lillqvist пишет:
> > What version could you suggest to download then? Just latest unstable?
> >
> >  Now we are using those: atk-1.20.0 glib-2.14.6 pango-1.18.4 gtk+-2.12.6
> 
> Those are the latest stable ones, and your program works fine against
> them here... Are you using some theme?
> 

Ok, we eventually forced to upgrade our GTK library, so, back to the
issue :). At some point you were right Tor - theme has side effect to
find a problem. When I chaged theme toolbar icon_size settings on Linux,
I've got same crush issue.

After spending some time in debugger I found the problem with reparent.
The problem is that gtk_widget_realize and gtk_widget_map was called for
widget with GTK_ANCHORED unset. So, there we got assertion and program
crashed.

I will explain what's happened.
I have toolbar with stock-item elements. Then I do REPARENT from one
toplevel to another.

When widget removed from old parent and added to new one this method is
called:

gtk_widget_propagate_hierarchy_changed_recurse()

there GTK_ANCHORED flag was UNSET and SET for all widgets recursively
including toolbar->toolbutton->button->image.

Also, there is call to do_screen_change() method.
When it's called for toolbar there is check if settings were changed
(gtk_toolbar_screen_chaged()). In our case we have theme with ICON_SIZE
= GTK_ICON_SIZE_SMALL_TOOLBAR, but there was GTK_ICON_SIZE_LARGE_TOOLBAR
 set in toolbar widget. I wonder when it was reset? Perhaps, somewhere
in reparent process.

So, gtk attempts to chage ICON_SIZE and calls appropriate
methods/signals. All ends in gtk_tool_button_construct_contents(), where
icon removed and added to toolbutton->button. Because gtk_button_add()
forces gtk_widget_realize/map to be called, but toolbar children was not
set with GTK_ANCHORED flag yet.

I will create simple test case and submit a bug at the Monday. Just let
me know, if that problem wasn't fixed yet, please.

Last worked version: gtk+-2.8.17
Tested versions (bug): gtk+-2.10.4, gtk+-2.12.6

Regards,
-- 
Andrew E. Makeev <andrew solvo ru>
Solvo Logistic



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