diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-02-12 09:07:15 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-02-12 09:07:15 +0800 |
commit | 88dec7a2580f336ae11d805839ce3204c67ac07a (patch) | |
tree | db6d7e16fb92d9dde82ee389b56a129316e8bdc3 /widgets | |
parent | 04bb0a4fb01448394533a80850370448a2f3aadf (diff) | |
download | gsoc2013-evolution-88dec7a2580f336ae11d805839ce3204c67ac07a.tar gsoc2013-evolution-88dec7a2580f336ae11d805839ce3204c67ac07a.tar.gz gsoc2013-evolution-88dec7a2580f336ae11d805839ce3204c67ac07a.tar.bz2 gsoc2013-evolution-88dec7a2580f336ae11d805839ce3204c67ac07a.tar.lz gsoc2013-evolution-88dec7a2580f336ae11d805839ce3204c67ac07a.tar.xz gsoc2013-evolution-88dec7a2580f336ae11d805839ce3204c67ac07a.tar.zst gsoc2013-evolution-88dec7a2580f336ae11d805839ce3204c67ac07a.zip |
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.c (e_text_event): Made a click on a text
widget set the cursor properly.
svn path=/trunk/; revision=1740
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/e-text/e-text.c | 21 | ||||
-rw-r--r-- | widgets/text/e-text.c | 21 |
2 files changed, 36 insertions, 6 deletions
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: |