1.1.9 hpaned changes



Hi,

my program linked with 1.1.9 segfaults. 1.1.7 is ok, never tried 1.1.8
(when the compilation of 1.1.8 just ends I received announce of 1.1.9
;-). Sorry, I can not provide clear source example yet.

gdb says:

Program received signal SIGSEGV, Segmentation fault.
0x400b077b in gtk_hpaned_size_allocate (widget=0x8093bb8, 
    allocation=0xbfffedd0) at gtkhpaned.c:147
147       gtk_paned_compute_position (paned,
(gdb) where
#0  0x400b077b in gtk_hpaned_size_allocate (widget=0x8093bb8, 
    allocation=0xbfffedd0) at gtkhpaned.c:147
#1  0x40122b51 in gtk_marshal_NONE__POINTER () at gtkmarshal.c:187
#2  0x400ebc16 in gtk_signal_real_emit (object=0x8093bb8, signal_id=12, 
.....

There are changes between 1.1.7 and 1.1.9 in gtkhpaned.c:

--- gtkhpaned.c	Tue Dec  1 02:15:35 1998
+++ /home/pavel/ROOT/source/gtk+-1.1.9/gtk/gtkhpaned.c	Wed Dec 16 02:42:06 1998
@@ -144,18 +144,13 @@
   paned = GTK_PANED (widget);
   border_width = GTK_CONTAINER (paned)->border_width;
 
-  if (!paned->position_set)
-    {
-      if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1))
-	paned->child1_size = paned->child1->requisition.width;
-      else
-	paned->child1_size = 0;
-    }
-  else
-    paned->child1_size = CLAMP (paned->child1_size, 0,
-				allocation->width - paned->gutter_size
-				- 2 * GTK_CONTAINER (paned)->border_width);
-
+  gtk_paned_compute_position (paned,
+			      widget->allocation.width
+			        - paned->gutter_size
+			        - 2 * border_width,
+			      paned->child1->requisition.width,
+			      paned->child2->requisition.width);
+  
   /* Move the handle before the children so we don't get extra expose events */
 
   paned->handle_xpos = paned->child1_size + border_width + paned->gutter_size / 2 - paned->handle_size / 2;
@@ -338,20 +333,21 @@
   g_return_val_if_fail (widget != NULL, FALSE);
   g_return_val_if_fail (GTK_IS_PANED (widget), FALSE);
 
+  paned = GTK_PANED (widget);
+
   if (event->is_hint || event->window != widget->window)
     gtk_widget_get_pointer(widget, &x, NULL);
   else
     x = event->x;
 
-  paned = GTK_PANED (widget);
-
   if (paned->in_drag)
     {
+      gint size = x - GTK_CONTAINER (paned)->border_width - paned->gutter_size/2;
+      
       gtk_hpaned_xor_line (paned);
-      paned->child1_size = x - GTK_CONTAINER (paned)->border_width - paned->gutter_size / 2;
-      paned->child1_size = CLAMP (paned->child1_size, 0,
-                                  widget->allocation.width - paned->gutter_size
-                                  - 2 * GTK_CONTAINER (paned)->border_width);
+      paned->child1_size = CLAMP (size,
+				  paned->min_position,
+				  paned->max_position);
       gtk_hpaned_xor_line (paned);
     }
 

I think there is something bad, but I do not have time to look at
it. Any additional info on request.
-- 
Pavel Janík ml.
Pavel.Janik@inet.cz



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