# HG changeset patch # User Jan Dj¸«£rv # Date 1049906685 0 # Node ID 3b4cda88d7ef728a5d3063a08e084d2cca94d454 # Parent dd21432cf0e5ad72a45474fe10c9184fb8a344c1 * xterm.c (xg_scroll_callback): Call gtk_range_get_adjustment to get GtkAdjustment as widget now is a GtkRange. * gtkutil.c (xg_create_scroll_bar): Connect to value-changed on GtkRange to avoid memory leak. diff -r dd21432cf0e5 -r 3b4cda88d7ef src/ChangeLog --- a/src/ChangeLog Wed Apr 09 12:17:59 2003 +0000 +++ b/src/ChangeLog Wed Apr 09 16:44:45 2003 +0000 @@ -1,3 +1,11 @@ +2003-04-09 Jan Dj,Ad(Brv + + * xterm.c (xg_scroll_callback): Call gtk_range_get_adjustment to + get GtkAdjustment as widget now is a GtkRange. + + * gtkutil.c (xg_create_scroll_bar): Connect to value-changed on + GtkRange to avoid memory leak. + 2003-04-09 Kenichi Handa * xfaces.c (Vface_font_rescale_alist): New variable. diff -r dd21432cf0e5 -r 3b4cda88d7ef src/gtkutil.c --- a/src/gtkutil.c Wed Apr 09 12:17:59 2003 +0000 +++ b/src/gtkutil.c Wed Apr 09 16:44:45 2003 +0000 @@ -2512,25 +2512,25 @@ scroll_id = xg_store_widget_in_map (wscroll); - g_signal_connect (G_OBJECT (vadj), + g_signal_connect (G_OBJECT (wscroll), "value-changed", scroll_callback, - (gpointer)bar); + (gpointer) bar); g_signal_connect (G_OBJECT (wscroll), "destroy", G_CALLBACK (xg_gtk_scroll_destroy), - (gpointer)scroll_id); + (gpointer) scroll_id); /* Connect to button press and button release to detect if any scroll bar has the pointer. */ g_signal_connect (G_OBJECT (wscroll), "button-press-event", G_CALLBACK (scroll_bar_button_cb), - (gpointer)bar); + (gpointer) bar); g_signal_connect (G_OBJECT (wscroll), "button-release-event", G_CALLBACK (scroll_bar_button_cb), - (gpointer)bar); + (gpointer) bar); gtk_fixed_put (GTK_FIXED (f->output_data.x->edit_widget), wscroll, -1, -1); diff -r dd21432cf0e5 -r 3b4cda88d7ef src/xterm.c --- a/src/xterm.c Wed Apr 09 12:17:59 2003 +0000 +++ b/src/xterm.c Wed Apr 09 16:44:45 2003 +0000 @@ -4190,11 +4190,11 @@ #else /* !USE_MOTIF, i.e. Xaw or GTK */ #ifdef USE_GTK /* Scroll bar callback for GTK scroll bars. WIDGET is the scroll - bar adjustment widget. DATA is a pointer to the scroll_bar structure. */ + bar widget. DATA is a pointer to the scroll_bar structure. */ static void xg_scroll_callback (widget, data) - GtkWidget *widget; + GtkRange *widget; gpointer data; { struct scroll_bar *bar = (struct scroll_bar *) data; @@ -4204,7 +4204,7 @@ int diff; int part = -1, whole = 0, portion = 0; - GtkAdjustment *adj = GTK_ADJUSTMENT (widget); + GtkAdjustment *adj = GTK_ADJUSTMENT (gtk_range_get_adjustment (widget)); if (xg_ignore_gtk_scrollbar) return;