diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | widgets/e-text/e-text.c | 21 | ||||
-rw-r--r-- | widgets/text/e-text.c | 21 |
3 files changed, 41 insertions, 6 deletions
@@ -1,5 +1,10 @@ 2000-02-11 Christopher James Lahey <clahey@helixcode.com> + * widgets/e-text/e-text.c (e_text_event): Made a click on a text + widget set the cursor properly. + +2000-02-11 Christopher James Lahey <clahey@helixcode.com> + * widgets/e-text/e-text.h: Removed some arguments from the .h that will never be implemented. diff --git a/widgets/e-text/e-text.c b/widgets/e-text/e-text.c index b33e99194d..8dde3bbaed 100644 --- a/widgets/e-text/e-text.c +++ b/widgets/e-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: 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: |