From 88dec7a2580f336ae11d805839ce3204c67ac07a Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sat, 12 Feb 2000 01:07:15 +0000 Subject: Made a click on a text widget set the cursor properly. 2000-02-11 Christopher James Lahey * widgets/e-text/e-text.c (e_text_event): Made a click on a text widget set the cursor properly. svn path=/trunk/; revision=1740 --- widgets/text/e-text.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'widgets/text') diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index b33e99194d..8dde3bbaed 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -1898,6 +1898,24 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) break; case GDK_BUTTON_PRESS: /* Fall Through */ case GDK_BUTTON_RELEASE: + if ((!text->editing) + && text->editable + && event->type == GDK_BUTTON_RELEASE + && event->button.button == 1) { + GdkEventButton button = event->button; + + gnome_canvas_item_grab_focus (item); + + e_tep_event.type = GDK_BUTTON_PRESS; + e_tep_event.button.time = button.time; + e_tep_event.button.state = button.state; + e_tep_event.button.button = button.button; + e_tep_event.button.position = _get_position_from_xy(text, button.x, button.y); + _get_tep(text); + return_val = e_text_event_processor_handle_event (text->tep, + &e_tep_event); + e_tep_event.type = GDK_BUTTON_RELEASE; + } if (text->editing) { GdkEventButton button = event->button; e_tep_event.button.time = button.time; @@ -1916,9 +1934,6 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) text->lastx = button.x; text->lasty = button.y; text->last_state = button.state; - } else if (text->editable && event->type == GDK_BUTTON_RELEASE && event->button.button == 1) { - gnome_canvas_item_grab_focus (item); - return 1; } break; case GDK_MOTION_NOTIFY: -- cgit v1.2.3