]> www.fi.muni.cz Git - evince.git/commitdiff
Grab focus on the view when clicking it
authorMarco Pesenti Gritti <marco@gnome.org>
Sun, 2 Jan 2005 15:27:31 +0000 (15:27 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Sun, 2 Jan 2005 15:27:31 +0000 (15:27 +0000)
2005-01-02  Marco Pesenti Gritti  <marco@gnome.org>

        * shell/ev-view.c: (ev_view_realize), (ev_view_button_press_event):

        Grab focus on the view when clicking it

ChangeLog
shell/ev-view.c

index db1caa871ca73b52ddc48342241a12a04ab243da..8f75e58c5cdd90eab55381a6a8cca2f0aa929292 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-01-02  Marco Pesenti Gritti  <marco@gnome.org>
+
+       * 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  <marco@gnome.org>
 
        * shell/ev-marshal.list:
index 3a23cc3ee377c059b5dbb434d6aec701f21e3069..b9dda6ad573673b597829ec7d242f21a393787ec 100644 (file)
@@ -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