[evolution] Add the GdkDevice to ETextEventProcessorCommand.



commit 4bc40f6663d6a809dda4dcbeae27902b5883cad1
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed Nov 28 19:01:30 2012 -0500

    Add the GdkDevice to ETextEventProcessorCommand.
    
    Will be needed for grabs in response to button events.

 e-util/e-text-event-processor-emacs-like.c |    1 +
 e-util/e-text-event-processor-types.h      |    2 ++
 widgets/table/e-cell-text.c                |    4 ++++
 widgets/text/e-text.c                      |    2 ++
 4 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/e-util/e-text-event-processor-emacs-like.c b/e-util/e-text-event-processor-emacs-like.c
index fa724a2..2a42ae9 100644
--- a/e-util/e-text-event-processor-emacs-like.c
+++ b/e-util/e-text-event-processor-emacs-like.c
@@ -133,6 +133,7 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
 	case GDK_BUTTON_PRESS:
 		if (event->button.button == 1 || event->button.button == 2) {
 			command.action = E_TEP_GRAB;
+			command.device = event->button.device;
 			command.time = event->button.time;
 			g_signal_emit_by_name (tep, "command", &command);
 			if (event->button.button == 1 && event->button.state & GDK_SHIFT_MASK)
diff --git a/e-util/e-text-event-processor-types.h b/e-util/e-text-event-processor-types.h
index 6e9d155..d7d0bb3 100644
--- a/e-util/e-text-event-processor-types.h
+++ b/e-util/e-text-event-processor-types.h
@@ -85,6 +85,7 @@ typedef struct {
 	ETextEventProcessorCommandAction action;
 	gint value;
 	const gchar *string;
+	GdkDevice *device;
 	guint32 time;
 } ETextEventProcessorCommand;
 
@@ -94,6 +95,7 @@ typedef struct {
 	guint state;
 	guint button;
 	gint position;
+	GdkDevice *device;
 } ETextEventProcessorEventButton;
 
 typedef struct {
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index f1d852a..4d685ae 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -970,6 +970,8 @@ ect_event (ECellView *ecell_view,
 			e_tep_event.button.state = button.state;
 			e_tep_event.button.button = button.button;
 			e_tep_event.button.position = get_position_from_xy (edit, event->button.x, event->button.y);
+			e_tep_event.button.device =
+				gdk_event_get_device (event);
 			_get_tep (edit);
 			edit->actions = 0;
 			return_val = e_text_event_processor_handle_event (
@@ -993,6 +995,8 @@ ect_event (ECellView *ecell_view,
 			e_tep_event.button.state = button.state;
 			e_tep_event.button.button = button.button;
 			e_tep_event.button.position = get_position_from_xy (edit, event->button.x, event->button.y);
+			e_tep_event.button.device =
+				gdk_event_get_device (event);
 			_get_tep (edit);
 			edit->actions = 0;
 			return_val = e_text_event_processor_handle_event (
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c
index 1a56f9a..cb97e8e 100644
--- a/widgets/text/e-text.c
+++ b/widgets/text/e-text.c
@@ -1785,6 +1785,8 @@ e_text_event (GnomeCanvasItem *item,
 			e_tep_event.button.position =
 				get_position_from_xy (
 				text, button.x, button.y);
+			e_tep_event.button.device =
+				gdk_event_get_device (event);
 			_get_tep (text);
 			return_val = e_text_event_processor_handle_event (
 				text->tep, &e_tep_event);



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