Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2005-01-02 15:27:31 (GMT)
committer Marco Pesenti Gritti <marco@src.gnome.org>2005-01-02 15:27:31 (GMT)
commitad039deb64377ecf8bbc2c81155b6da9dbeb2a88 (patch)
treef22bc2794fc141d3c9fac9b08cf59a8d1b5bc4e1 /shell
parentf950c38c30956005c718b86dd9fe19b39340f4cd (diff)
Grab focus on the view when clicking it
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
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-view.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/shell/ev-view.c b/shell/ev-view.c
index 3a23cc3..b9dda6a 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