From: Nickolay V. Shmyrev Date: Tue, 27 Dec 2005 22:49:49 +0000 (+0000) Subject: Bind context menu to keyboard also. Fix for the bug #325065. X-Git-Tag: EVINCE_0_5_0~38 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=78165c67e4a06cdb7e1e868bc9b43924b5719292;p=evince.git 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. --- 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;