summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@redhat.com>2002-03-25 04:10:49 +0000
committerJonathan Blandford <jrb@src.gnome.org>2002-03-25 04:10:49 +0000
commit7cc14762b9c1cbef337242dd47eea85136f66a4f (patch)
tree3ceac577ed48f22a2f82678a871dc3a2bfb9ab7e /gtk
parent2a8fc72b0dfd892fe6e47babc2a5a0de5a12e757 (diff)
downloadgtk+-7cc14762b9c1cbef337242dd47eea85136f66a4f.tar.gz
Make path arg const, #75653
Sun Mar 24 10:32:38 2002 Jonathan Blandford <jrb@redhat.com> * 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
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkfontsel.c2
-rw-r--r--gtk/gtktreemodel.c2
-rw-r--r--gtk/gtktreemodel.h2
-rw-r--r--gtk/gtktreeview.c23
4 files changed, 19 insertions, 10 deletions
diff --git a/gtk/gtkfontsel.c b/gtk/gtkfontsel.c
index 6b9f2e9106..6e5b402428 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 b03824c143..9749a4ddb2 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 09109a8a1b..e498a14605 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 ed8160e78c..ce8303c35c 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;
}