Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2007-01-28 16:43:22 (GMT)
committer Carlos Garcia Campos <carlosgc@src.gnome.org>2007-01-28 16:43:22 (GMT)
commit40bdbed8a127356fadf9790aa0b479854c1c1d22 (patch)
treef2311255cff914e8cd4d2c3dea7faa5f1689e862 /shell
parenta23410c308dc197b6e32ddd61b9160cdaf3a1df3 (diff)
Open links in new window when clicking with middle button.
2007-01-28 Carlos Garcia Campos <carlosgc@gnome.org> * shell/ev-window.c: (view_external_link_cb): * shell/ev-view.c: (ev_view_button_release_event): Open links in new window when clicking with middle button. svn path=/trunk/; revision=2263
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-view.c20
-rw-r--r--shell/ev-window.c10
2 files changed, 28 insertions, 2 deletions
diff --git a/shell/ev-view.c b/shell/ev-view.c
index 7275fb6..b722785 100644
--- a/shell/ev-view.c
+++ b/shell/ev-view.c
@@ -2314,7 +2314,7 @@ ev_view_button_release_event (GtkWidget *widget,
ev_view_set_cursor (view, EV_VIEW_CURSOR_NORMAL);
}
- if (view->document && view->pressed_button == 1) {
+ if (view->document && view->pressed_button != 3) {
link = ev_view_get_link_at_location (view, event->x, event->y);
} else {
link = NULL;
@@ -2343,7 +2343,23 @@ ev_view_button_release_event (GtkWidget *widget,
view->selection_info.in_drag = FALSE;
} else if (link) {
- ev_view_handle_link (view, link);
+ if (event->button == 2) {
+ EvLinkAction *action;
+ EvLinkActionType type;
+
+ action = ev_link_get_action (link);
+ if (!action)
+ return FALSE;
+
+ type = ev_link_action_get_action_type (action);
+ if (type == EV_LINK_ACTION_TYPE_GOTO_DEST) {
+ g_signal_emit (view,
+ signals[SIGNAL_EXTERNAL_LINK],
+ 0, action);
+ }
+ } else {
+ ev_view_handle_link (view, link);
+ }
} else if (view->presentation) {
switch (event->button) {
case 1:
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 1d36a12..8e414a5 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -4350,6 +4350,16 @@ static void
view_external_link_cb (EvView *view, EvLinkAction *action, EvWindow *window)
{
switch (ev_link_action_get_action_type (action)) {
+ case EV_LINK_ACTION_TYPE_GOTO_DEST: {
+ EvLinkDest *dest;
+
+ dest = ev_link_action_get_dest (action);
+ if (!dest)
+ return;
+
+ ev_window_cmd_file_open_copy_at_dest (window, dest);
+ }
+ break;
case EV_LINK_ACTION_TYPE_EXTERNAL_URI:
launch_external_uri (window, action);
break;