From: Marco Pesenti Gritti Date: Sun, 2 Jan 2005 15:27:31 +0000 (+0000) Subject: Grab focus on the view when clicking it X-Git-Tag: EVINCE_0_1_0~37 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=ad039deb64377ecf8bbc2c81155b6da9dbeb2a88;p=evince.git Grab focus on the view when clicking it 2005-01-02 Marco Pesenti Gritti * shell/ev-view.c: (ev_view_realize), (ev_view_button_press_event): Grab focus on the view when clicking it --- diff --git a/ChangeLog b/ChangeLog index db1caa87..8f75e58c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-01-02 Marco Pesenti Gritti + + * shell/ev-view.c: (ev_view_realize), (ev_view_button_press_event): + + Grab focus on the view when clicking it + 2005-01-02 Marco Pesenti Gritti * shell/ev-marshal.list: diff --git a/shell/ev-view.c b/shell/ev-view.c index 3a23cc3e..b9dda6ad 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -246,6 +246,7 @@ ev_view_realize (GtkWidget *widget) attributes.width = MAX (widget->allocation.width, widget->requisition.width); attributes.height = MAX (widget->allocation.height, widget->requisition.height); attributes.event_mask = GDK_EXPOSURE_MASK | + GDK_BUTTON_PRESS_MASK | GDK_SCROLL_MASK | GDK_KEY_PRESS_MASK; @@ -358,9 +359,13 @@ static gboolean ev_view_button_press_event (GtkWidget *widget, GdkEventButton *event) { - /* EvView *view = EV_VIEW (widget); */ + if (event->type == GDK_BUTTON_PRESS) { + if (!GTK_WIDGET_HAS_FOCUS (widget)) { + gtk_widget_grab_focus (widget); + } + } - return FALSE; + return TRUE; } static gboolean