[evolution/wip/webkit2] Bug 241050 - Can't focus message list by clicking in empty portions of it ][
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip/webkit2] Bug 241050 - Can't focus message list by clicking in empty portions of it ][
- Date: Wed, 2 Mar 2016 15:20:07 +0000 (UTC)
commit fef52ba7465f735105a2d7a6ed1de66484627578
Author: Milan Crha <mcrha redhat com>
Date: Wed Nov 11 11:43:44 2015 +0100
Bug 241050 - Can't focus message list by clicking in empty portions of it ][
e-util/e-canvas-background.c | 20 --------------------
e-util/e-table.c | 40 +++++++++++++++++++++-------------------
e-util/e-tree.c | 11 +++++++++--
3 files changed, 30 insertions(+), 41 deletions(-)
---
diff --git a/e-util/e-canvas-background.c b/e-util/e-canvas-background.c
index 93abb2f..b7612ca 100644
--- a/e-util/e-canvas-background.c
+++ b/e-util/e-canvas-background.c
@@ -170,25 +170,6 @@ ecb_get_property (GObject *object,
}
}
-static gboolean
-ecb_event (GnomeCanvasItem *item,
- GdkEvent *event)
-{
- guint event_button = 0;
-
- g_return_val_if_fail (E_IS_CANVAS_BACKGROUND (item), FALSE);
- g_return_val_if_fail (event != NULL, FALSE);
-
- gdk_event_get_button (event, &event_button);
-
- if (event->type == GDK_BUTTON_PRESS && (event_button == 1 || event_button == 2)) {
- e_canvas_item_grab_focus (item, TRUE);
- return TRUE;
- }
-
- return FALSE;
-}
-
static void
ecb_init (ECanvasBackground *ecb)
{
@@ -246,7 +227,6 @@ ecb_class_init (ECanvasBackgroundClass *ecb_class)
object_class->set_property = ecb_set_property;
object_class->get_property = ecb_get_property;
- item_class->event = ecb_event;
item_class->update = ecb_update;
item_class->draw = ecb_draw;
item_class->point = ecb_point;
diff --git a/e-util/e-table.c b/e-util/e-table.c
index 2525f2a..450810a 100644
--- a/e-util/e-table.c
+++ b/e-util/e-table.c
@@ -1283,24 +1283,39 @@ get_first_etable_item (ETableGroup *table_group)
return res;
}
+/* Finds the first descendant of the group that is an ETableItem and focuses it */
+static void
+focus_first_etable_item (ETableGroup *group)
+{
+ ETableItem *item;
+
+ item = get_first_etable_item (group);
+ if (item) {
+ e_table_item_set_cursor (item, 0, 0);
+ gnome_canvas_item_grab_focus (GNOME_CANVAS_ITEM (item));
+ }
+}
+
static gboolean
white_item_event (GnomeCanvasItem *white_item,
GdkEvent *event,
ETable *e_table)
{
- gboolean return_val = 0;
+ gboolean return_val = FALSE;
g_signal_emit (
e_table, et_signals[WHITE_SPACE_EVENT], 0,
event, &return_val);
- if (!return_val && e_table->group) {
- ETableItem *item;
+ if (!return_val && event && e_table->group) {
+ guint event_button = 0;
- item = get_first_etable_item (e_table->group);
+ gdk_event_get_button (event, &event_button);
- if (item)
- g_signal_emit_by_name (item, "event", event, &return_val);
+ if (event->type == GDK_BUTTON_PRESS && (event_button == 1 || event_button == 2)) {
+ focus_first_etable_item (e_table->group);
+ return_val = TRUE;
+ }
}
return return_val;
@@ -1341,19 +1356,6 @@ et_canvas_root_event (GnomeCanvasItem *root,
return FALSE;
}
-/* Finds the first descendant of the group that is an ETableItem and focuses it */
-static void
-focus_first_etable_item (ETableGroup *group)
-{
- ETableItem *item;
-
- item = get_first_etable_item (group);
- if (item) {
- e_table_item_set_cursor (item, 0, 0);
- gnome_canvas_item_grab_focus (GNOME_CANVAS_ITEM (item));
- }
-}
-
/* Handler for focus events in the table_canvas; we have to repaint ourselves
* always, and also give the focus to some ETableItem if we get focused.
*/
diff --git a/e-util/e-tree.c b/e-util/e-tree.c
index 83abbfe..19f83c5 100644
--- a/e-util/e-tree.c
+++ b/e-util/e-tree.c
@@ -1210,8 +1210,15 @@ white_item_event (GnomeCanvasItem *white_item,
signals[WHITE_SPACE_EVENT], 0,
event, &return_val);
- if (!return_val && tree->priv->item) {
- g_signal_emit_by_name (tree->priv->item, "event", event, &return_val);
+ if (!return_val && event && tree->priv->item) {
+ guint event_button = 0;
+
+ gdk_event_get_button (event, &event_button);
+
+ if (event->type == GDK_BUTTON_PRESS && (event_button == 1 || event_button == 2)) {
+ gnome_canvas_item_grab_focus (GNOME_CANVAS_ITEM (tree->priv->item));
+ return_val = TRUE;
+ }
}
return return_val;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]