Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/libview
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2009-07-12 14:56:22 (GMT)
committer Carlos Garcia Campos <carlosgc@gnome.org>2009-07-12 14:56:22 (GMT)
commit4b8d7a403800d654bc3e47abb8fd98c76b37d859 (patch)
tree7f6126de4b5e4d9b8e0890c8f06d512262e7a624 /libview
parentab09124515eeee70ecff9ad920b933c450a9ae09 (diff)
[libview] Compute selections on button press for word/line selections
Fixes bgo#562059.
Diffstat (limited to 'libview')
-rw-r--r--libview/ev-view.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/libview/ev-view.c b/libview/ev-view.c
index f69b7b0..6132363 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -3018,26 +3018,28 @@ static void
start_selection_for_event (EvView *view,
GdkEventButton *event)
{
- EvSelectionStyle style;
-
clear_selection (view);
-
+
view->selection_info.start.x = event->x + view->scroll_x;
view->selection_info.start.y = event->y + view->scroll_y;
switch (event->type) {
case GDK_2BUTTON_PRESS:
- style = EV_SELECTION_STYLE_WORD;
+ view->selection_info.style = EV_SELECTION_STYLE_WORD;
break;
case GDK_3BUTTON_PRESS:
- style = EV_SELECTION_STYLE_LINE;
+ view->selection_info.style = EV_SELECTION_STYLE_LINE;
break;
default:
- style = EV_SELECTION_STYLE_GLYPH;
- break;
+ view->selection_info.style = EV_SELECTION_STYLE_GLYPH;
+ return;
}
- view->selection_info.style = style;
+ /* In case of WORD or LINE, compute selections now */
+ compute_selections (view,
+ view->selection_info.style,
+ &(view->selection_info.start),
+ &(view->selection_info.start));
}
static gboolean
@@ -3520,14 +3522,6 @@ ev_view_button_release_event (GtkWidget *widget,
view->selection_update_id = 0;
}
- if (!view->selection_info.in_selection &&
- view->selection_info.style != EV_SELECTION_STYLE_GLYPH) {
- compute_selections (view,
- view->selection_info.style,
- &(view->selection_info.start),
- &(view->selection_info.start));
- }
-
if (view->selection_info.selections) {
clear_link_selected (view);
ev_view_update_primary_selection (view);