Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Coudoin <bcoudoin@src.gnome.org>2006-10-16 23:01:32 (GMT)
committer Bruno Coudoin <bcoudoin@src.gnome.org>2006-10-16 23:01:32 (GMT)
commit036ed53e7bf193f4c85226ddd6d41e176d9e2de0 (patch)
tree7e37c0fe0907076a25f860ab1b8dde788b7cc616
parent921af30d081af8274fbe57dd5eeb5de2531376f5 (diff)
- Aplied patch from Hans de Goede
- gcompris-8.0-warn.patch This patch fixes a warning (which is turned into an error due to -Werror) when compiling gcompris with the latest gcc. And it fixes a GTK critical error message due to passing a gtk window instead of a gdk window to gdk_grab_pointer. This also means that when a configuration dialog is shown the mouse is no longer constrained to the fullscreen window. - gcompris-8.0-fullscreen.patch One of my latest fixes to the fullscreen code was to leave fullscreen mode when loosing focus, this is nescesarry to play nice with the screensaver and allows alt-tabbing away from gcompris with certain windowmanagers. However when one tries to configure an activity then a new gtk-window is created for the config dialog, causing the main window to loose focus. Thus currently when trying to configure an activity, fullscreen mode is exited which looks rather silly. This patches fixes this. - gcompris-8.0-silence.patch: removed printf * src/boards/chess.c: (engine_local_cb): * src/gcompris/board_config.c: (gc_board_config_window_display): * src/gcompris/gcompris.c: (gc_ignore_next_focus_out), (xf86_vidmode_set_fullscreen), (xf86_window_configured), (xf86_focus_changed): * src/gcompris/gcompris.h: * src/gcompris/gcompris_db.c: added a copy in board_dir pointer to avoid a crash on gcompris exit in gc_menu_board_free
-rw-r--r--ChangeLog32
-rw-r--r--src/boards/chess.c2
-rw-r--r--src/gcompris/board_config.c7
-rw-r--r--src/gcompris/gcompris.c19
-rw-r--r--src/gcompris/gcompris.h1
-rw-r--r--src/gcompris/gcompris_db.c4
6 files changed, 53 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 75032b8..b1ba856 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,35 @@
+2006-10-17 Bruno coudoin <bruno.coudoin@free.fr>
+
+ - Aplied patch from Hans de Goede
+ - gcompris-8.0-warn.patch
+ This patch fixes a warning (which is turned into an error due to
+ -Werror) when compiling gcompris with the latest gcc. And it fixes a GTK
+ critical error message due to passing a gtk window instead of a gdk
+ window to gdk_grab_pointer. This also means that when a configuration
+ dialog is shown the mouse is no longer constrained to the fullscreen
+ window.
+
+ - gcompris-8.0-fullscreen.patch
+ One of my latest fixes to the fullscreen code was to leave fullscreen
+ mode when loosing focus, this is nescesarry to play nice with the
+ screensaver and allows alt-tabbing away from gcompris with certain
+ windowmanagers. However when one tries to configure an activity then a
+ new gtk-window is created for the config dialog, causing the main window
+ to loose focus. Thus currently when trying to configure an activity,
+ fullscreen mode is exited which looks rather silly. This patches fixes this.
+
+ - gcompris-8.0-silence.patch: removed printf
+
+ * src/boards/chess.c: (engine_local_cb):
+ * src/gcompris/board_config.c: (gc_board_config_window_display):
+ * src/gcompris/gcompris.c: (gc_ignore_next_focus_out),
+ (xf86_vidmode_set_fullscreen), (xf86_window_configured),
+ (xf86_focus_changed):
+ * src/gcompris/gcompris.h:
+
+ * src/gcompris/gcompris_db.c: added a copy in board_dir pointer to avoid
+ a crash on gcompris exit in gc_menu_board_free
+
2006-10-16 Bruno coudoin <bruno.coudoin@free.fr>
- Applied patch from Miguel DE IZARRA that removes memory leaks
diff --git a/src/boards/chess.c b/src/boards/chess.c
index 28da4f1..76e974b 100644
--- a/src/boards/chess.c
+++ b/src/boards/chess.c
@@ -1001,7 +1001,7 @@ engine_local_cb (GIOChannel *source,
&len,
&err);
- g_warning("g_io_channel_read_line len=%d", len);
+ g_warning("g_io_channel_read_line len=%d", (int)len);
if(status == G_IO_STATUS_ERROR)
{
g_warning("g_io_channel_read_chars error=%s",
diff --git a/src/gcompris/board_config.c b/src/gcompris/board_config.c
index 1e1b09b..e9421ba 100644
--- a/src/gcompris/board_config.c
+++ b/src/gcompris/board_config.c
@@ -161,6 +161,11 @@ gc_board_config_window_display(gchar *label, GcomprisConfCallback callback)
/* init static values or callbacks */
Confcallback = callback;
hash_conf = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+
+ /* Creating a config window will cause our main window to loose focus,
+ this tells the main window to ignore the next focus out event (and thus
+ stay in fullscreen mode if we're fullscreen). */
+ gc_ignore_next_focus_out();
/* main configuration window */
conf_window = \
@@ -194,7 +199,7 @@ gc_board_config_window_display(gchar *label, GcomprisConfCallback callback)
GcomprisProperties *properties = gc_prop_get();
if (properties->fullscreen && !properties->noxf86vm)
if (gdk_pointer_grab(gc_get_window()->window, TRUE, 0,
- GDK_WINDOW(gc_get_window()), NULL, GDK_CURRENT_TIME) !=
+ gc_get_window()->window, NULL, GDK_CURRENT_TIME) !=
GDK_GRAB_SUCCESS)
g_warning("Pointer grab failed");
diff --git a/src/gcompris/gcompris.c b/src/gcompris/gcompris.c
index 3f4aef5..270eb1e 100644
--- a/src/gcompris/gcompris.c
+++ b/src/gcompris/gcompris.c
@@ -247,7 +247,8 @@ static struct
int window_x;
int window_y;
gboolean fullscreen_active;
-} XF86VidModeData = { { 0 }, { 0 }, 0, 0, 0, 0, FALSE };
+ int ignore_focus_out;
+} XF86VidModeData = { { 0 }, { 0 }, 0, 0, 0, 0, FALSE, 0 };
static void xf86_vidmode_init( void );
static void xf86_vidmode_set_fullscreen( int state );
@@ -394,6 +395,12 @@ GtkWidget *gc_get_window()
return window;
}
+void gc_ignore_next_focus_out()
+{
+#ifdef XF86_VIDMODE
+ XF86VidModeData.ignore_focus_out++;
+#endif
+}
GnomeCanvasItem *gc_set_background(GnomeCanvasGroup *parent, gchar *file)
{
@@ -1274,8 +1281,6 @@ xf86_vidmode_set_fullscreen ( int state )
if (properties->noxf86vm || XF86VidModeData.fullscreen_active == state)
return;
- printf("setfullscreen %d\n", state);
-
if (state)
{
if (!XF86VidModeSwitchToMode(GDK_DISPLAY(), GDK_SCREEN_XNUMBER(
@@ -1323,9 +1328,6 @@ static gint xf86_window_configured(GtkWindow *window,
XF86VidModeData.window_x = event->x;
XF86VidModeData.window_y = event->y;
- printf("configure: %dx%d, fullscreen_active: %d\n", event->x, event->y,
- (int)XF86VidModeData.fullscreen_active);
-
if(XF86VidModeData.fullscreen_active) {
if (gdk_pointer_grab(event->window, TRUE, 0, event->window, NULL,
GDK_CURRENT_TIME) != GDK_GRAB_SUCCESS)
@@ -1341,8 +1343,9 @@ static gint xf86_window_configured(GtkWindow *window,
static gint xf86_focus_changed(GtkWindow *window,
GdkEventFocus *event, gpointer param)
{
- printf("focus change %d\n", (int)event->in);
- if (properties->fullscreen)
+ if (!event->in && XF86VidModeData.ignore_focus_out)
+ XF86VidModeData.ignore_focus_out--;
+ else if (properties->fullscreen)
xf86_vidmode_set_fullscreen(event->in);
/* Act as if we aren't there / aren't hooked up */
return FALSE;
diff --git a/src/gcompris/gcompris.h b/src/gcompris/gcompris.h
index 64b7fc7..77f4f52 100644
--- a/src/gcompris/gcompris.h
+++ b/src/gcompris/gcompris.h
@@ -114,6 +114,7 @@ void gc_bar_hide (gboolean hide);
/* General */
GnomeCanvas *gc_get_canvas(void);
GtkWidget *gc_get_window(void);
+void gc_ignore_next_focus_out(void);
const gchar *gc_locale_get(void);
void gc_locale_set(gchar *locale);
diff --git a/src/gcompris/gcompris_db.c b/src/gcompris/gcompris_db.c
index 0ed42ec..c7f1207 100644
--- a/src/gcompris/gcompris_db.c
+++ b/src/gcompris/gcompris_db.c
@@ -644,7 +644,7 @@ GList *gc_menu_load_db(GList *boards_list)
gcomprisBoard->gmodule_file = NULL;
/* From DB we have only package_data_dir. */
- gcomprisBoard->board_dir = properties->package_data_dir;
+ gcomprisBoard->board_dir = g_strdup(properties->package_data_dir);
/* Fixed since I use the canvas own pixel_per_unit scheme */
gcomprisBoard->width = BOARDWIDTH;
@@ -1686,7 +1686,7 @@ GcomprisBoard *gc_db_get_board_from_id(int board_id)
gcomprisBoard->gmodule_file = NULL;
/* From DB we have only package_data_dir. */
- gcomprisBoard->board_dir = properties->package_data_dir;
+ gcomprisBoard->board_dir = g_strdup_printf(properties->package_data_dir);
/* Fixed since I use the canvas own pixel_per_unit scheme */
gcomprisBoard->width = BOARDWIDTH;