From 78165c67e4a06cdb7e1e868bc9b43924b5719292 Mon Sep 17 00:00:00 2001 From: "Nickolay V. Shmyrev" Date: Tue, 27 Dec 2005 22:49:49 +0000 Subject: [PATCH] Bind context menu to keyboard also. Fix for the bug #325065. * shell/ev-view.c: (ev_view_popup_menu), (ev_view_class_init): Bind context menu to keyboard also. Fix for the bug #325065. --- ChangeLog | 7 +++++++ shell/ev-view.c | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index a1d1ed27..1adab92c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-12-28 Nickolay V. Shmyrev + + * shell/ev-view.c: (ev_view_popup_menu), (ev_view_class_init): + + Bind context menu to keyboard also. Fix for the bug + #325065. + 2005-12-27 Nickolay V. Shmyrev * shell/ev-view.c: (selection_scroll_timeout_cb): diff --git a/shell/ev-view.c b/shell/ev-view.c index 285d52bd..b1e97336 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -179,6 +179,7 @@ static gboolean ev_view_scroll_event (GtkWidget GdkEventScroll *event); static gboolean ev_view_expose_event (GtkWidget *widget, GdkEventExpose *event); +static gboolean ev_view_popup_menu (GtkWidget *widget); static gboolean ev_view_button_press_event (GtkWidget *widget, GdkEventButton *event); static gboolean ev_view_motion_notify_event (GtkWidget *widget, @@ -1622,6 +1623,19 @@ ev_view_expose_event (GtkWidget *widget, return FALSE; } +static gboolean +ev_view_popup_menu (GtkWidget *widget) +{ + gint x, y; + EvLink *link; + EvView *view = EV_VIEW (widget); + + gtk_widget_get_pointer (widget, &x, &y); + link = ev_view_get_link_at_location (view, x, y); + g_signal_emit (view, signals[SIGNAL_POPUP_MENU], 0, link); + return TRUE; +} + static gboolean ev_view_button_press_event (GtkWidget *widget, GdkEventButton *event) @@ -2386,6 +2400,7 @@ ev_view_class_init (EvViewClass *class) widget_class->leave_notify_event = ev_view_leave_notify_event; widget_class->style_set = ev_view_style_set; widget_class->drag_data_get = ev_view_drag_data_get; + widget_class->popup_menu = ev_view_popup_menu; gtk_object_class->destroy = ev_view_destroy; class->set_scroll_adjustments = ev_view_set_scroll_adjustments; -- 2.43.5