A patch an a bug report for the About dialog



I (finally!) found the bug in the about dialog.  GTK widgets are initially
given an allocation of width 1 and hieght 1, and then later given the
correct size.  Normally, this doesn't lead to any problems, but in this
case, the size of the pixmap is determined by the allocated size of the
drawing area on the drawing area's first expose.  For reasons only X
knows, sometimes the expose event happens after the resizing of the
allocation, and sometimes it doesn't.  So sometimes the pixmap is
generated with the correct size, and sometimes it is generated with size
1,1.  That's bad.  A patch is appended that creates the pixmap at a time
that we know the widget has the right size.

This did not solve the (surprisingly!) unrelated problem of the logo not
always completely drawing.  I tried to debug it, but without success,
because of what is probably a bug in gtk.  (The ears of the gtk bug
finders sleeping through this message suddenly perk up. :)  After applying
the patch, change the == in line 402 of about_dialog.c to >=, and watch
gimp totally lock up.  Why?

Nathan

*** about_dialog.c.orig	Fri Nov 14 21:53:50 1997
--- about_dialog.c	Wed Nov 19 16:32:07 1997
***************
*** 367,378 ****
  about_dialog_scroll_expose (GtkWidget      *widget,
  			    GdkEventExpose *event)
  {
!   if (!scroll_pixmap)
!     scroll_pixmap = gdk_pixmap_new (widget->window,
! 				    widget->allocation.width,
! 				    widget->allocation.height,
! 				    -1);
! 
    gdk_window_clear (scroll_area->window);
  
    return FALSE;
--- 367,373 ----
  about_dialog_scroll_expose (GtkWidget      *widget,
  			    GdkEventExpose *event)
  {
!  
    gdk_window_clear (scroll_area->window);
  
    return FALSE;
***************
*** 429,434 ****
--- 424,436 ----
  
    if (do_scrolling)
      {
+       if (!scroll_pixmap)
+ 	scroll_pixmap = gdk_pixmap_new (scroll_area->window,
+ 					scroll_area->allocation.width,
+ 					scroll_area->allocation.height,
+ 					-1);
+   
+ 
        switch (scroll_state)
  	{
  	case 1:




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