From e9dc381d3ace3404d0eafe94eb6da3b9a843abb8 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 17 Feb 2010 19:45:28 -0500 Subject: =?UTF-8?q?Bug=C2=A0587014=20-=20Magic=20space=20does=20not=20work?= =?UTF-8?q?=20as=20expected?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Neither ETree::key-press nor ETableItem::key-press signal definitions specify a GSignalAccumulator that terminates the signal emission when a handler returns TRUE, and Evolution 2.29 connects multiple handlers to ETree::key-press. When the space key is pressed, the first handler implements the magic space bar behavior and returns TRUE, which should terminate signal emission but doesn't because there's no accumulator function on the signal. So the second handler runs and checks for other keys besides space. It returns FALSE since it didn't handle the key press. End result: emission site gets back FALSE (from the second handler) as the return value, so it thinks the key press was not handled at all and invokes the fallback handler -- e_selection_model_toggle_single_row() -- which -unselects- the newly selected row, making it appear the next unread message was never selected. Several other ETable-related signals that return "handled" flags also lack GSignalAccumulator functions. I've made a note to myself to fix those as well. --- e-util/e-marshal.list | 2 ++ modules/mail/e-mail-shell-view-private.c | 2 +- widgets/table/e-table-item.c | 6 +++--- widgets/table/e-table-item.h | 2 +- widgets/table/e-tree.c | 6 +++--- widgets/table/e-tree.h | 2 +- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/e-util/e-marshal.list b/e-util/e-marshal.list index b0be6abe05..6b70a9e3fe 100644 --- a/e-util/e-marshal.list +++ b/e-util/e-marshal.list @@ -1,6 +1,8 @@ BOOLEAN:BOXED,STRING BOOLEAN:BOXED,POINTER,POINTER +BOOLEAN:INT,INT,BOXED BOOLEAN:INT,INT,OBJECT,INT,INT,UINT +BOOLEAN:INT,POINTER,INT,BOXED BOOLEAN:INT,POINTER,INT,OBJECT,INT,INT,UINT BOOLEAN:NONE BOOLEAN:OBJECT,DOUBLE,DOUBLE,BOOLEAN diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index 8f426e51d7..ab2e3a7444 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -179,7 +179,7 @@ mail_shell_view_key_press_event_cb (EMailShellView *mail_shell_view, return TRUE; } -static gint +static gboolean mail_shell_view_message_list_key_press_cb (EMailShellView *mail_shell_view, gint row, ETreePath path, diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index d6f0a45cf7..8fa9e2ad4e 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -2964,9 +2964,9 @@ eti_class_init (ETableItemClass *klass) G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableItemClass, key_press), - NULL, NULL, - e_marshal_INT__INT_INT_BOXED, - G_TYPE_INT, 3, G_TYPE_INT, + g_signal_accumulator_true_handled, NULL, + e_marshal_BOOLEAN__INT_INT_BOXED, + G_TYPE_BOOLEAN, 3, G_TYPE_INT, G_TYPE_INT, GDK_TYPE_EVENT); eti_signals [STYLE_SET] = diff --git a/widgets/table/e-table-item.h b/widgets/table/e-table-item.h index 08efae6183..15415ff88d 100644 --- a/widgets/table/e-table-item.h +++ b/widgets/table/e-table-item.h @@ -168,7 +168,7 @@ typedef struct { void (*double_click) (ETableItem *eti, gint row, gint col, GdkEvent *event); gint (*right_click) (ETableItem *eti, gint row, gint col, GdkEvent *event); gint (*click) (ETableItem *eti, gint row, gint col, GdkEvent *event); - gint (*key_press) (ETableItem *eti, gint row, gint col, GdkEvent *event); + gboolean (*key_press) (ETableItem *eti, gint row, gint col, GdkEvent *event); gint (*start_drag) (ETableItem *eti, gint row, gint col, GdkEvent *event); void (*style_set) (ETableItem *eti, GtkStyle *previous_style); void (*selection_model_removed) (ETableItem *eti, ESelectionModel *selection); diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index 5e173906df..ddfb85abe8 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -3201,9 +3201,9 @@ e_tree_class_init (ETreeClass *class) G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeClass, key_press), - NULL, NULL, - e_marshal_INT__INT_POINTER_INT_BOXED, - G_TYPE_INT, 4, G_TYPE_INT, G_TYPE_POINTER, + g_signal_accumulator_true_handled, NULL, + e_marshal_BOOLEAN__INT_POINTER_INT_BOXED, + G_TYPE_BOOLEAN, 4, G_TYPE_INT, G_TYPE_POINTER, G_TYPE_INT, GDK_TYPE_EVENT); et_signals [START_DRAG] = diff --git a/widgets/table/e-tree.h b/widgets/table/e-tree.h index 5657751111..fa2ab787ce 100644 --- a/widgets/table/e-tree.h +++ b/widgets/table/e-tree.h @@ -66,7 +66,7 @@ typedef struct { void (*double_click) (ETree *et, gint row, ETreePath path, gint col, GdkEvent *event); gint (*right_click) (ETree *et, gint row, ETreePath path, gint col, GdkEvent *event); gint (*click) (ETree *et, gint row, ETreePath path, gint col, GdkEvent *event); - gint (*key_press) (ETree *et, gint row, ETreePath path, gint col, GdkEvent *event); + gboolean (*key_press) (ETree *et, gint row, ETreePath path, gint col, GdkEvent *event); gint (*start_drag) (ETree *et, gint row, ETreePath path, gint col, GdkEvent *event); gint (*state_change) (ETree *et); gint (*white_space_event) (ETree *et, GdkEvent *event); -- cgit v1.2.3