[evolution/wip/webkit2] Bug 241050 - Can't focus message list by clicking in empty portions of it



commit 6b22b7dfd5099277b9bbc23c367e83f1226b6f5a
Author: Milan Crha <mcrha redhat com>
Date:   Fri Aug 28 08:55:03 2015 +0200

    Bug 241050 - Can't focus message list by clicking in empty portions of it

 e-util/e-canvas-background.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/e-util/e-canvas-background.c b/e-util/e-canvas-background.c
index b7612ca..93abb2f 100644
--- a/e-util/e-canvas-background.c
+++ b/e-util/e-canvas-background.c
@@ -170,6 +170,25 @@ 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)
 {
@@ -227,6 +246,7 @@ 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]