gnome-games r7132 - trunk/mahjongg



Author: chpe
Date: Fri Jan 11 10:17:25 2008
New Revision: 7132
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7132&view=rev

Log:
2008-01-11  Christian Persch  <chpe gnome org>

	* drawing.c: (create_mahjongg_board): Make the board focusable.
	* mahjongg.c: (main): Grab focus on the board, so it doesn't stay on
	the New button in the toolbar. Bug #503857.

Modified:
   trunk/mahjongg/ChangeLog
   trunk/mahjongg/drawing.c
   trunk/mahjongg/mahjongg.c

Modified: trunk/mahjongg/drawing.c
==============================================================================
--- trunk/mahjongg/drawing.c	(original)
+++ trunk/mahjongg/drawing.c	Fri Jan 11 10:17:25 2008
@@ -422,6 +422,8 @@
 create_mahjongg_board (void)
 {
   board = gtk_drawing_area_new ();
+  GTK_WIDGET_SET_FLAGS (board, GTK_CAN_FOCUS);
+
   gtk_widget_set_size_request (board, MINWIDTH, MINHEIGHT);
 
   gtk_widget_add_events (board, GDK_BUTTON_PRESS_MASK);

Modified: trunk/mahjongg/mahjongg.c
==============================================================================
--- trunk/mahjongg/mahjongg.c	(original)
+++ trunk/mahjongg/mahjongg.c	Fri Jan 11 10:17:25 2008
@@ -1552,9 +1552,11 @@
   init_game ();
   update_score_state ();
 
+  /* Don't leave the keyboard focus on the toolbar */
+  gtk_widget_grab_focus (board);
+
   /* Note: we have to have a layout loaded before here so that the
    * window knows how big to make the tiles. */
-
   gtk_widget_show_all (window);
 
   if (!games_conf_get_boolean (NULL, KEY_SHOW_TOOLBAR, NULL))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]