Hello,
I've been looking into this weird tab coloring problem I've been having with the latest SVN pull of geany. Running it through valgrind and such I was getting read errors on unintialized values in ui_tree_view_find_next, so I started poking around in there to see what was going on. After adding a few printf's valgrind has stopped complaining, but I'm noticing that the document style's colors change. So if document_get_status() returns a NULL color, we change the tabs to meet the style colors, like so
gtk_widget_modify_fg(doc_list[idx].tab_label, GTK_STATE_NORMAL, color ? color : &(style->fg[GTK_STATE_NORMAL])); gtk_widget_modify_fg(doc_list[idx].tab_label, GTK_STATE_ACTIVE, color ? color : &(style->fg[GTK_STATE_ACTIVE]));
but for some reason, these colors change, I put some printfs in if color is NULL
printf("style fg is this %lu, %u %u %u\n", style->fg[GTK_STATE_ACTIVE].pixel, style->fg[GTK_STATE_ACTIVE].red, style->fg[GTK_STATE_ACTIVE].green, style->fg[GTK_STATE_ACTIVE].blue); printf("style fg is this %lu, %u %u %u\n", style->fg[GTK_STATE_NORMAL].pixel, style->fg[GTK_STATE_NORMAL].red, style->fg[GTK_STATE_NORMAL].green, style->fg[GTK_STATE_NORMAL].blue);
and I get this
color is null style fg is this 4, 25 0 32768 style fg is this 153896787, 0 0 0 color is null style fg is this 4, 25 0 32768 style fg is this 153896787, 0 0 0
and this is random, I get all kinds of colors, purple, yellow, pink etc. I haven't figured out the exact steps to make this happen, it just happens if I start editing and saving multiple files. This happens with the 0.10 release as well btw. Is anybody else seeing this kind of problem?
Josef
and this is random, I get all kinds of colors, purple, yellow, pink etc. I haven't figured out the exact steps to make this happen, it just happens if I start editing and saving multiple files. This happens with the 0.10 release as well btw. Is anybody else seeing this kind of problem?
I've figured out how to reproduce it. Open up a C file for instance, and put the cursor in an comment area (which in my case is red). Then close geany, and open it again, then click to a different tab, the background color of the original tab should be red (though sometimes its some other random color). I've gotten this to reproduce everytime, so now to try and figure out what the problem is. Try with a bunch of tabs open all on different colored syntaxes, that seems to help.
Josef
On 29/12/06 17:23:35, Josef Whiter wrote:
Hello,
I've been looking into this weird tab coloring problem I've been having with the latest SVN pull of geany. Running it through valgrind and such I was getting read errors on unintialized values in ui_tree_view_find_next,
I assume you mean ui_update_tab_status() ;-)
so I started poking around in there to see what was going on. After adding a few printf's valgrind has stopped complaining, but I'm noticing that the document style's colors change. So if document_get_status() returns a NULL color, we change the tabs to meet the style colors, like so
gtk_widget_modify_fg(doc_list[idx].tab_label, GTK_STATE_NORMAL, color ? color : &(style->fg[GTK_STATE_NORMAL])); gtk_widget_modify_fg(doc_list[idx].tab_label, GTK_STATE_ACTIVE, color ? color : &(style->fg[GTK_STATE_ACTIVE]));
[...]
Thanks for reporting this - I also found Valgrind pointed me to these lines for the invalid memory reads, which should be fixed now in SVN r1148.
I haven't seen the tab colours change personally, but I imagine this behaviour is undefined due to the invalid memory reads.
Regards, Nick
P.S. I'm about to look at your make parse directory patch.