Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/ev-view.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2008-01-26 15:59:00 (GMT)
committer Carlos Garcia Campos <carlosgc@src.gnome.org>2008-01-26 15:59:00 (GMT)
commit8fdc90f6d511cd854fdfdf4c5d7066a2bbe00c94 (patch)
tree2f5d491d768578303fe6c66ea7b8a35f2bdaf219 /shell/ev-view.c
parenta3b05a8344813469eff149cd75c1cc088dc267f3 (diff)
Stop autoscroll when Escape key is pressed. Fixes bug #511635.
2008-01-26 Carlos Garcia Campos <carlosgc@gnome.org> * shell/ev-view.[ch]: (ev_view_button_release_event), (ev_view_autoscroll_start), (ev_view_autoscroll_stop): * shell/ev-window.c: (ev_window_cmd_view_autoscroll), (ev_window_cmd_escape): Stop autoscroll when Escape key is pressed. Fixes bug #511635. svn path=/trunk/; revision=2860
Diffstat (limited to 'shell/ev-view.c')
-rw-r--r--shell/ev-view.c43
1 files changed, 35 insertions, 8 deletions
diff --git a/shell/ev-view.c b/shell/ev-view.c
index 2863506..fa9fbd8 100644
--- a/shell/ev-view.c
+++ b/shell/ev-view.c
@@ -3135,12 +3135,7 @@ ev_view_button_release_event (GtkWidget *widget,
view->image_dnd_info.in_drag = FALSE;
if (view->scroll_info.autoscrolling) {
- view->scroll_info.autoscrolling = FALSE;
- if (view->scroll_info.timeout_id) {
- g_source_remove (view->scroll_info.timeout_id);
- view->scroll_info.timeout_id = 0;
- }
- ev_view_handle_cursor_over_xy (view, event->x, event->y);
+ ev_view_autoscroll_stop (view);
view->pressed_button = -1;
return TRUE;
@@ -4467,10 +4462,42 @@ ev_view_autoscroll_cb (EvView *view)
}
void
-ev_view_autoscroll (EvView *view)
+ev_view_autoscroll_start (EvView *view)
{
+ gint x, y;
+
+ g_return_if_fail (EV_IS_VIEW (view));
+
+ if (view->scroll_info.autoscrolling)
+ return;
+
view->scroll_info.autoscrolling = TRUE;
- view->scroll_info.timeout_id = g_timeout_add (20, (GSourceFunc)(ev_view_autoscroll_cb), view);
+ view->scroll_info.timeout_id =
+ g_timeout_add (20, (GSourceFunc)ev_view_autoscroll_cb,
+ view);
+
+ gtk_widget_get_pointer (GTK_WIDGET (view), &x, &y);
+ ev_view_handle_cursor_over_xy (view, x, y);
+}
+
+void
+ev_view_autoscroll_stop (EvView *view)
+{
+ gint x, y;
+
+ g_return_if_fail (EV_IS_VIEW (view));
+
+ if (!view->scroll_info.autoscrolling)
+ return;
+
+ view->scroll_info.autoscrolling = FALSE;
+ if (view->scroll_info.timeout_id) {
+ g_source_remove (view->scroll_info.timeout_id);
+ view->scroll_info.timeout_id = 0;
+ }
+
+ gtk_widget_get_pointer (GTK_WIDGET (view), &x, &y);
+ ev_view_handle_cursor_over_xy (view, x, y);
}
void