From 7cc14762b9c1cbef337242dd47eea85136f66a4f Mon Sep 17 00:00:00 2001 From: Jonathan Blandford Date: Mon, 25 Mar 2002 04:10:49 +0000 Subject: [PATCH] Make path arg const, #75653 Sun Mar 24 10:32:38 2002 Jonathan Blandford * gtk/gtktreemodel.c (gtk_tree_path_copy): Make path arg const, #75653 * gtk/gtkfontsel.c (gtk_font_selection_show_available_styles): fix a warning * gtk/gtktreeview.c (gtk_tree_view_button_press): remove the grab when we emit row_activated so that listeners of this signal can grab the mouse, #75629 --- ChangeLog | 11 +++++++++++ ChangeLog.pre-2-10 | 11 +++++++++++ ChangeLog.pre-2-2 | 11 +++++++++++ ChangeLog.pre-2-4 | 11 +++++++++++ ChangeLog.pre-2-6 | 11 +++++++++++ ChangeLog.pre-2-8 | 11 +++++++++++ gtk/gtkfontsel.c | 2 +- gtk/gtktreemodel.c | 2 +- gtk/gtktreemodel.h | 2 +- gtk/gtktreeview.c | 23 ++++++++++++++++------- 10 files changed, 85 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 661288f5a..c004df722 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Sun Mar 24 10:32:38 2002 Jonathan Blandford + + * gtk/gtktreemodel.c (gtk_tree_path_copy): Make path arg const, #75653 + + * gtk/gtkfontsel.c (gtk_font_selection_show_available_styles): fix + a warning + + * gtk/gtktreeview.c (gtk_tree_view_button_press): remove the grab + when we emit row_activated so that listeners of this signal can + grab the mouse, #75629 + 2002-03-23 Havoc Pennington * gtk/gtktextlayout.c (gtk_text_layout_real_invalidate): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 661288f5a..c004df722 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,14 @@ +Sun Mar 24 10:32:38 2002 Jonathan Blandford + + * gtk/gtktreemodel.c (gtk_tree_path_copy): Make path arg const, #75653 + + * gtk/gtkfontsel.c (gtk_font_selection_show_available_styles): fix + a warning + + * gtk/gtktreeview.c (gtk_tree_view_button_press): remove the grab + when we emit row_activated so that listeners of this signal can + grab the mouse, #75629 + 2002-03-23 Havoc Pennington * gtk/gtktextlayout.c (gtk_text_layout_real_invalidate): diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 661288f5a..c004df722 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,14 @@ +Sun Mar 24 10:32:38 2002 Jonathan Blandford + + * gtk/gtktreemodel.c (gtk_tree_path_copy): Make path arg const, #75653 + + * gtk/gtkfontsel.c (gtk_font_selection_show_available_styles): fix + a warning + + * gtk/gtktreeview.c (gtk_tree_view_button_press): remove the grab + when we emit row_activated so that listeners of this signal can + grab the mouse, #75629 + 2002-03-23 Havoc Pennington * gtk/gtktextlayout.c (gtk_text_layout_real_invalidate): diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 661288f5a..c004df722 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,14 @@ +Sun Mar 24 10:32:38 2002 Jonathan Blandford + + * gtk/gtktreemodel.c (gtk_tree_path_copy): Make path arg const, #75653 + + * gtk/gtkfontsel.c (gtk_font_selection_show_available_styles): fix + a warning + + * gtk/gtktreeview.c (gtk_tree_view_button_press): remove the grab + when we emit row_activated so that listeners of this signal can + grab the mouse, #75629 + 2002-03-23 Havoc Pennington * gtk/gtktextlayout.c (gtk_text_layout_real_invalidate): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 661288f5a..c004df722 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,14 @@ +Sun Mar 24 10:32:38 2002 Jonathan Blandford + + * gtk/gtktreemodel.c (gtk_tree_path_copy): Make path arg const, #75653 + + * gtk/gtkfontsel.c (gtk_font_selection_show_available_styles): fix + a warning + + * gtk/gtktreeview.c (gtk_tree_view_button_press): remove the grab + when we emit row_activated so that listeners of this signal can + grab the mouse, #75629 + 2002-03-23 Havoc Pennington * gtk/gtktextlayout.c (gtk_text_layout_real_invalidate): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 661288f5a..c004df722 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,14 @@ +Sun Mar 24 10:32:38 2002 Jonathan Blandford + + * gtk/gtktreemodel.c (gtk_tree_path_copy): Make path arg const, #75653 + + * gtk/gtkfontsel.c (gtk_font_selection_show_available_styles): fix + a warning + + * gtk/gtktreeview.c (gtk_tree_view_button_press): remove the grab + when we emit row_activated so that listeners of this signal can + grab the mouse, #75629 + 2002-03-23 Havoc Pennington * gtk/gtktextlayout.c (gtk_text_layout_real_invalidate): diff --git a/gtk/gtkfontsel.c b/gtk/gtkfontsel.c index 6b9f2e910..6e5b40242 100644 --- a/gtk/gtkfontsel.c +++ b/gtk/gtkfontsel.c @@ -773,9 +773,9 @@ gtk_font_selection_show_available_styles (GtkFontSelection *fontsel) fontsel->face = match_face; if (match_face) { +#ifdef INCLUDE_FONT_ENTRIES const gchar *str = pango_font_face_get_face_name (fontsel->face); -#ifdef INCLUDE_FONT_ENTRIES gtk_entry_set_text (GTK_ENTRY (fontsel->font_style_entry), str); #endif set_cursor_to_iter (GTK_TREE_VIEW (fontsel->face_list), &match_row); diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c index b03824c14..9749a4ddb 100644 --- a/gtk/gtktreemodel.c +++ b/gtk/gtktreemodel.c @@ -345,7 +345,7 @@ gtk_tree_path_free (GtkTreePath *path) * Return value: A new #GtkTreePath. **/ GtkTreePath * -gtk_tree_path_copy (GtkTreePath *path) +gtk_tree_path_copy (const GtkTreePath *path) { GtkTreePath *retval; diff --git a/gtk/gtktreemodel.h b/gtk/gtktreemodel.h index 09109a8a1..e498a1460 100644 --- a/gtk/gtktreemodel.h +++ b/gtk/gtktreemodel.h @@ -126,7 +126,7 @@ void gtk_tree_path_prepend_index (GtkTreePath *path, gint gtk_tree_path_get_depth (GtkTreePath *path); gint *gtk_tree_path_get_indices (GtkTreePath *path); void gtk_tree_path_free (GtkTreePath *path); -GtkTreePath *gtk_tree_path_copy (GtkTreePath *path); +GtkTreePath *gtk_tree_path_copy (const GtkTreePath *path); GType gtk_tree_path_get_type (void); gint gtk_tree_path_compare (const GtkTreePath *a, const GtkTreePath *b); diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index ed8160e78..ce8303c35 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -1709,6 +1709,7 @@ gtk_tree_view_button_press (GtkWidget *widget, gint pre_val, aft_val; GtkTreeViewColumn *column = NULL; gint column_handled_click = FALSE; + gboolean emit_row_activated = FALSE; if (!GTK_WIDGET_HAS_FOCUS (widget)) gtk_widget_grab_focus (widget); @@ -1877,14 +1878,9 @@ gtk_tree_view_button_press (GtkWidget *widget, if (event->button == 1 && event->type == GDK_2BUTTON_PRESS && tree_view->priv->last_single_clicked) { - GtkTreePath *lsc = gtk_tree_row_reference_get_path (tree_view->priv->last_single_clicked); + GtkTreePath *lsc; - if (lsc) - { - if (!gtk_tree_path_compare (lsc, path)) - gtk_tree_view_row_activated (tree_view, path, column); - gtk_tree_path_free (lsc); - } + lsc = gtk_tree_row_reference_get_path (tree_view->priv->last_single_clicked); if (tree_view->priv->last_single_clicked) gtk_tree_row_reference_free (tree_view->priv->last_single_clicked); @@ -1892,6 +1888,13 @@ gtk_tree_view_button_press (GtkWidget *widget, gtk_tree_row_reference_free (tree_view->priv->last_single_clicked_2); tree_view->priv->last_single_clicked = NULL; tree_view->priv->last_single_clicked_2 = NULL; + + if (lsc) + { + if (!gtk_tree_path_compare (lsc, path)) + emit_row_activated = TRUE; + gtk_tree_path_free (lsc); + } } else if (event->button == 1 && event->type == GDK_BUTTON_PRESS) { @@ -1903,6 +1906,12 @@ gtk_tree_view_button_press (GtkWidget *widget, GTK_TREE_VIEW_UNSET_FLAG (tree_view, GTK_TREE_VIEW_DRAW_KEYFOCUS); gtk_tree_path_free (path); + + if (emit_row_activated) + { + gtk_grab_remove (widget); + gtk_tree_view_row_activated (tree_view, path, column); + } return TRUE; } -- 2.43.2