I am not sure if this is a gtk problem or if it is a REdhat specific bug just yet. It seemt that at work I am using gtk 1.2.3. When I compile my program there it runs just fine (gtk and Solaris) however when I compile this program at home (gtk and Redhat 6.2) I have problems. The problem is this:I have a text widget that I create with gtk_text_new(). The initial size is 500x300. When I use this size and start typing into the text area the data types in just fine. However when I resize the window from 500 to 600 or 700 or larger then typing into the text area gets immensly slow. Since the same results were not achieved under Solaris I know that it is not my code. I believe that Redhat 6.2 comes with gtk1.2.6. The text widget is created as follows: GtkWidget *text; text = gtk_text_new(NULL, NULL); gtk_widget_show(text); with a windows that has an initial size of 500x300. I have tried just creating a text area with no other widget and it still occured. The strange this is that GXedit does not have this problem, however I think that GXedit uses another gtk text widget. If there is another widget that I can use as my text that is include in either gnome or gtk I can substitute that as a workaround, but this is still a bug and I have several programs that are now using this widget.
Are you using a theme? I've seen reports of behavior like this with some pixmap themes, though I don't understand why that would happen.
I noticed it happens with certain gtk themes. In particular the theme called "blue theme" and "blue steel" under gnome. It started in RH 6.1 with gtk 1.2.5. I know that if I change themes to "basic" it goes away. It may be in the gtk-themes package.
I have found a workaround that seems to work, although I don't know why. I basically reset teh style. Here is a code snippet. GtkStyle *curstyle; GtkWidget *text; text = gtk_text_new(NULL, NULL); curstyle = gtk_widget_get_style(text); gtk_widget_set_style(text, curstyle); gtk_widget_show(text);
So, does this happen only with your own code or also with other GtkText widgets? Do you see the problem with, say, gedit?
Yes it happens in the gedit program also but not as much. First the gedit text widget is not as large as mine, I put mine in a viewport so I can get horizontal and verticle scroll bars. I also resize the text widgets to be large enough to contain the text with not scrolling, thus the viewport is used to see the area of interest. It also seems that gedit sets the style and does not use the style that is set by the window manager, so the font is a different font than the theme font. My guess is that gedit does something like font = 'some gont'; style = gtk_text_get_style(wiget); style->font = font; gtk_widget_set_style(widget,style); There is hesitance in typing in text in gedit, however it is not as noticable as in my editor.
This is upstream as: http://bugzilla.gnome.org/show_bug.cgi?id=4485 We've never tracked this down; I've never been able to reproduce it myself. Both the GtkText widget and the "pixmap" theme engine are being replaced with total rewrites for GTK+-2.0, so it's pretty safe to say this problem will go away. For now, the workaround is simply not to use a pixmap theme.