diff options
author | Josh Rickmar <jrick@devio.us> | 2012-06-18 11:17:39 -0400 |
---|---|---|
committer | Josh Rickmar <jrick@devio.us> | 2012-06-28 15:29:06 -0400 |
commit | 778314350a27c698799439f8e4d5c3b3e536f492 (patch) | |
tree | 2865701be633745655897d8f4a5684fdbaa3fd2d | |
parent | 375e29bed3993b912011d10418bd54ca473989c4 (diff) | |
download | xombrero-778314350a27c698799439f8e4d5c3b3e536f492.tar.gz |
Modify the allocation of the scrollbar and GTK adjustment so they are
allocated by the gtk_scrolled_window_new command instead of allocating them first and then passing them as args. I was seeing some segfaults from invalid t->adjust_h pointers earlier, and although I couldn't figure out why the pointers were invalid, I have not yet seen that crash after this change.
-rw-r--r-- | xombrero.c | 11 | ||||
-rw-r--r-- | xombrero.h | 2 |
2 files changed, 5 insertions, 8 deletions
diff --git a/xombrero.c b/xombrero.c index 6268399..d1a8eab 100644 --- a/xombrero.c +++ b/xombrero.c @@ -6704,12 +6704,11 @@ create_browser(struct tab *t) return (NULL); } - t->sb_h = GTK_SCROLLBAR(gtk_hscrollbar_new(NULL)); - t->sb_v = GTK_SCROLLBAR(gtk_vscrollbar_new(NULL)); - t->adjust_h = gtk_range_get_adjustment(GTK_RANGE(t->sb_h)); - t->adjust_v = gtk_range_get_adjustment(GTK_RANGE(t->sb_v)); - - w = gtk_scrolled_window_new(t->adjust_h, t->adjust_v); + w = gtk_scrolled_window_new(NULL, NULL); + t->adjust_h = gtk_scrolled_window_get_hadjustment( + GTK_SCROLLED_WINDOW(w)); + t->adjust_v = gtk_scrolled_window_get_vadjustment( + GTK_SCROLLED_WINDOW(w)); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(w), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); diff --git a/xombrero.h b/xombrero.h index 13baebb..28e4770 100644 --- a/xombrero.h +++ b/xombrero.h @@ -231,8 +231,6 @@ struct tab { gchar *icon_dest_uri; /* adjustments for browser */ - GtkScrollbar *sb_h; - GtkScrollbar *sb_v; GtkAdjustment *adjust_h; GtkAdjustment *adjust_v; |