Fix crashes in connection with pathbar scrolling (#321560, Bogdan Nicula)
2005-11-18 Matthias Clasen <mclasen@redhat.com> Fix crashes in connection with pathbar scrolling (#321560, Bogdan Nicula) * gtk/gtkpathbar.c (gtk_path_bar_update_slider_buttons): Stop scrolling when desensitising slider buttons. (gtk_path_bar_scroll_timeout, gtk_path_bar_slider_button_press): And use it here. * gtk/gtkpathbar.h (struct _GtkPathBar): Add a separate scrolling_down flag.
This commit is contained in:
committed by
Matthias Clasen
parent
f692b06467
commit
e5f4c9cb68
13
ChangeLog
13
ChangeLog
@@ -1,3 +1,16 @@
|
||||
2005-11-18 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Fix crashes in connection with pathbar scrolling (#321560,
|
||||
Bogdan Nicula)
|
||||
|
||||
* gtk/gtkpathbar.c (gtk_path_bar_update_slider_buttons):
|
||||
Stop scrolling when desensitising slider buttons.
|
||||
(gtk_path_bar_scroll_timeout, gtk_path_bar_slider_button_press):
|
||||
And use it here.
|
||||
|
||||
* gtk/gtkpathbar.h (struct _GtkPathBar): Add a separate
|
||||
scrolling_down flag.
|
||||
|
||||
2005-11-18 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkpathbar.c (button_clicked_cb): Fix a C99ism.
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
2005-11-18 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Fix crashes in connection with pathbar scrolling (#321560,
|
||||
Bogdan Nicula)
|
||||
|
||||
* gtk/gtkpathbar.c (gtk_path_bar_update_slider_buttons):
|
||||
Stop scrolling when desensitising slider buttons.
|
||||
(gtk_path_bar_scroll_timeout, gtk_path_bar_slider_button_press):
|
||||
And use it here.
|
||||
|
||||
* gtk/gtkpathbar.h (struct _GtkPathBar): Add a separate
|
||||
scrolling_down flag.
|
||||
|
||||
2005-11-18 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkpathbar.c (button_clicked_cb): Fix a C99ism.
|
||||
|
||||
@@ -127,7 +127,7 @@ get_slider_button (GtkPathBar *path_bar,
|
||||
gtk_widget_push_composite_child ();
|
||||
|
||||
button = gtk_button_new ();
|
||||
gtk_button_set_focus_on_click (button, FALSE);
|
||||
gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
|
||||
gtk_container_add (GTK_CONTAINER (button), gtk_arrow_new (arrow_type, GTK_SHADOW_OUT));
|
||||
gtk_container_add (GTK_CONTAINER (path_bar), button);
|
||||
gtk_widget_show_all (button);
|
||||
@@ -309,13 +309,19 @@ gtk_path_bar_update_slider_buttons (GtkPathBar *path_bar)
|
||||
|
||||
button = BUTTON_DATA (path_bar->button_list->data)->button;
|
||||
if (gtk_widget_get_child_visible (button))
|
||||
gtk_widget_set_sensitive (path_bar->down_slider_button, FALSE);
|
||||
{
|
||||
gtk_path_bar_stop_scrolling (path_bar);
|
||||
gtk_widget_set_sensitive (path_bar->down_slider_button, FALSE);
|
||||
}
|
||||
else
|
||||
gtk_widget_set_sensitive (path_bar->down_slider_button, TRUE);
|
||||
|
||||
button = BUTTON_DATA (g_list_last (path_bar->button_list)->data)->button;
|
||||
if (gtk_widget_get_child_visible (button))
|
||||
gtk_widget_set_sensitive (path_bar->up_slider_button, FALSE);
|
||||
{
|
||||
gtk_path_bar_stop_scrolling (path_bar);
|
||||
gtk_widget_set_sensitive (path_bar->up_slider_button, FALSE);
|
||||
}
|
||||
else
|
||||
gtk_widget_set_sensitive (path_bar->up_slider_button, TRUE);
|
||||
}
|
||||
@@ -736,7 +742,7 @@ gtk_path_bar_scroll_timeout (GtkPathBar *path_bar)
|
||||
{
|
||||
if (path_bar->scrolling_up)
|
||||
gtk_path_bar_scroll_up (path_bar->up_slider_button, path_bar);
|
||||
else
|
||||
else if (path_bar->scrolling_down)
|
||||
gtk_path_bar_scroll_down (path_bar->down_slider_button, path_bar);
|
||||
|
||||
if (path_bar->need_timer)
|
||||
@@ -781,12 +787,14 @@ gtk_path_bar_slider_button_press (GtkWidget *widget,
|
||||
|
||||
if (widget == path_bar->up_slider_button)
|
||||
{
|
||||
path_bar->scrolling_down = FALSE;
|
||||
path_bar->scrolling_up = TRUE;
|
||||
gtk_path_bar_scroll_up (path_bar->up_slider_button, path_bar);
|
||||
}
|
||||
else if (widget == path_bar->down_slider_button)
|
||||
{
|
||||
path_bar->scrolling_up = FALSE;
|
||||
path_bar->scrolling_down = TRUE;
|
||||
gtk_path_bar_scroll_down (path_bar->down_slider_button, path_bar);
|
||||
}
|
||||
|
||||
@@ -1134,7 +1142,7 @@ button_drag_data_get_cb (GtkWidget *widget,
|
||||
gtk_selection_data_set (selection_data,
|
||||
selection_data->target,
|
||||
8,
|
||||
uri_list,
|
||||
(guchar *)uri_list,
|
||||
strlen (uri_list));
|
||||
g_free (uri_list);
|
||||
}
|
||||
@@ -1160,7 +1168,7 @@ make_directory_button (GtkPathBar *path_bar,
|
||||
|
||||
button_data->type = find_button_type (path_bar, path);
|
||||
button_data->button = gtk_toggle_button_new ();
|
||||
gtk_button_set_focus_on_click (button_data->button, FALSE);
|
||||
gtk_button_set_focus_on_click (GTK_BUTTON (button_data->button), FALSE);
|
||||
|
||||
switch (button_data->type)
|
||||
{
|
||||
|
||||
@@ -61,9 +61,10 @@ struct _GtkPathBar
|
||||
gint16 button_offset;
|
||||
guint timer;
|
||||
guint slider_visible : 1;
|
||||
guint need_timer : 1;
|
||||
guint ignore_click : 1;
|
||||
guint scrolling_up : 1;
|
||||
guint need_timer : 1;
|
||||
guint ignore_click : 1;
|
||||
guint scrolling_up : 1;
|
||||
guint scrolling_down : 1;
|
||||
};
|
||||
|
||||
struct _GtkPathBarClass
|
||||
|
||||
Reference in New Issue
Block a user