[gtk+] listbox: return GDK_EVENT_STOP if button events were handled
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] listbox: return GDK_EVENT_STOP if button events were handled
- Date: Tue, 28 Jan 2014 15:46:20 +0000 (UTC)
commit 628b1f5e1cf562e0318b8de70324e07ec77c92cf
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Jan 28 16:44:01 2014 +0100
listbox: return GDK_EVENT_STOP if button events were handled
The button press/release handlers did invariably return FALSE, even
though it shouldn't if a row was found on the event coordinates. Also,
use GDK_EVENT_* defines for the return values.
gtk/gtklistbox.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index 1819794..e1896fc 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -1252,6 +1252,7 @@ gtk_list_box_button_press_event (GtkWidget *widget,
{
GtkListBox *list_box = GTK_LIST_BOX (widget);
GtkListBoxPrivate *priv = gtk_list_box_get_instance_private (list_box);
+ gboolean retval = GDK_EVENT_PROPAGATE;
gboolean ctrl_pressed;
GdkWindow *window;
double x, y;
@@ -1301,13 +1302,14 @@ gtk_list_box_button_press_event (GtkWidget *widget,
gtk_widget_queue_draw (GTK_WIDGET (list_box));
}
+ retval = GDK_EVENT_STOP;
}
/* TODO:
Should mark as active while down,
and handle grab breaks */
}
- return FALSE;
+ return retval;
}
static gboolean
@@ -1316,6 +1318,7 @@ gtk_list_box_button_release_event (GtkWidget *widget,
{
GtkListBox *list_box = GTK_LIST_BOX (widget);
GtkListBoxPrivate *priv = gtk_list_box_get_instance_private (list_box);
+ gboolean retval = GDK_EVENT_PROPAGATE;
/* Take a ref to protect against reentrancy (i.e. the activation may destroy the widget) */
g_object_ref (list_box);
@@ -1333,6 +1336,7 @@ gtk_list_box_button_release_event (GtkWidget *widget,
else
gtk_list_box_update_selected (list_box, priv->active_row);
+ retval = GDK_EVENT_STOP;
}
priv->active_row = NULL;
priv->active_row_active = FALSE;
@@ -1341,7 +1345,7 @@ gtk_list_box_button_release_event (GtkWidget *widget,
g_object_unref (list_box);
- return FALSE;
+ return retval;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]