From 9de3a0976d62cdda33cb4d6ada32a6672346fad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Sun, 9 Jan 2011 05:52:27 +0100 Subject: Ensure that the canvas is focused. --- src/ld-window-main.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/ld-window-main.c b/src/ld-window-main.c index d22f400..2ea06b5 100644 --- a/src/ld-window-main.c +++ b/src/ld-window-main.c @@ -355,6 +355,8 @@ ld_window_main_init (LdWindowMain *self) action_set_sensitive (self, "Delete", FALSE); action_set_sensitive (self, "SelectAll", FALSE); + gtk_widget_grab_focus (GTK_WIDGET (priv->canvas)); + /* Realize the window. */ gtk_widget_show_all (GTK_WIDGET (self)); } @@ -499,6 +501,9 @@ load_category_cb (gpointer data, gpointer user_data) gtk_container_add (GTK_CONTAINER (button), img); gtk_container_add (GTK_CONTAINER (item), button); + /* Don't steal focus from the canvas. */ + g_object_set (button, "can-focus", FALSE, NULL); + /* Assign the category to the toggle button. */ g_object_ref (cat); g_object_set_data_full (G_OBJECT (button), -- cgit v1.2.3