Ensure that the canvas is focused.

This commit is contained in:
Přemysl Eric Janouch 2011-01-09 05:52:27 +01:00
parent 800a381129
commit 9de3a0976d

View File

@ -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),