# HG changeset patch
# User Darren Salt <[EMAIL PROTECTED]>
# Date 1171845640 0
# Node ID c9f213bd5a16cd2eae79a44aa42249d5608f148d
# Parent f3c075dce68a9c77e739e4b71ae38d56c8e41142
Fix some problems with prefs window initialisation and redisplay.
Create it at startup, but don't prepare it for display until it's actually
needed; also, don't use gtk_widget_show_all to display it since that interferes
with the hiding of some config items.
diff -r c9f213bd5a16cd2eae79a44aa42249d5608f148d -r
f3c075dce68a9c77e739e4b71ae38d56c8e41142 ChangeLog
--- a/ChangeLog Mon Feb 19 00:40:40 2007 +0000
+++ b/ChangeLog Mon Feb 19 00:36:05 2007 +0000
@@ -50,6 +50,7 @@ 0.5.900:2007/??/??
such as radeon(4)'s "MergedNonRectangular" option.)
* Fixed a logic error which could cause full-screen focus grabbing to
be active even when Xinerama is active.
+ * Fixed some problems with prefs window initialisation and redisplay.
0.5.11: 2007/02/01
[dsalt]
diff -r c9f213bd5a16cd2eae79a44aa42249d5608f148d -r
f3c075dce68a9c77e739e4b71ae38d56c8e41142 src/preferences.c
--- a/src/preferences.c Mon Feb 19 00:40:40 2007 +0000
+++ b/src/preferences.c Mon Feb 19 00:36:05 2007 +0000
@@ -989,7 +989,7 @@ static JSBool js_preferences_show (JSCon
return JS_TRUE;
}
-static gpointer preferences_init_dbox (gpointer unused)
+static void preferences_init_dbox (void)
{
prefs_dialog = gtk_dialog_new_with_buttons (_("Preferences"), NULL, 0,
GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
@@ -1010,17 +1010,18 @@ static gpointer preferences_init_dbox (g
"gxine to be restarted to take effect."));
gtk_box_pack_end (GTK_BOX(GTK_DIALOG(prefs_dialog)->vbox), w,
FALSE, FALSE, 2);
-
- gtk_widget_show_all (prefs_notebook);
-
+}
+
+static gpointer preferences_first_show (gpointer unused)
+{
+ static int value = 0;
xine_cfg_entry_t entry;
+
+ gtk_widget_show_all (GTK_DIALOG (prefs_dialog)->vbox);
if (xine_config_lookup_entry (xine, "gui.experience_level", &entry))
- {
- static int value;
value = entry.num_value;
- select_show_pref_widgets (&value);
- }
-
+
+ select_show_pref_widgets (&value);
return NULL;
}
@@ -1035,8 +1036,8 @@ void preferences_show (void)
{
is_visible = TRUE;
static GOnce once = G_ONCE_INIT;
- g_once (&once, preferences_init_dbox, NULL);
- window_show (prefs_dialog, NULL);
+ g_once (&once, preferences_first_show, NULL);
+ window_present (prefs_dialog, NULL);
}
}
@@ -1046,6 +1047,8 @@ void preferences_init (void)
/* script engine functions */
se_defun (gse, NULL, "preferences_show", js_preferences_show, 0, 0,
SE_GROUP_DIALOGUE, NULL, NULL);
+
+ preferences_init_dbox ();
}
void preferences_update_entry (const xine_cfg_entry_t *entry)
diff -r c9f213bd5a16cd2eae79a44aa42249d5608f148d -r
f3c075dce68a9c77e739e4b71ae38d56c8e41142 src/utils.c
--- a/src/utils.c Mon Feb 19 00:40:40 2007 +0000
+++ b/src/utils.c Mon Feb 19 00:36:05 2007 +0000
@@ -211,6 +211,17 @@ void window_show (GtkWidget *const widge
gdk_window_raise (widget->window);
}
+void window_present (GtkWidget *const widget, GtkWidget *const parent)
+{
+ g_return_if_fail (widget != NULL);
+ g_return_if_fail (GTK_IS_WINDOW (widget));
+ g_return_if_fail (parent == NULL || GTK_IS_WINDOW (parent));
+ gtk_window_set_transient_for ((GtkWindow *)widget,
+ (GtkWindow *)(parent ? : app));
+ gtk_widget_show (widget);
+ gdk_window_raise (widget->window);
+}
+
static void response_cb (GtkWidget *dialog, gint response, gpointer data)
{
free (g_object_get_data (G_OBJECT (dialog), "msg"));
diff -r c9f213bd5a16cd2eae79a44aa42249d5608f148d -r
f3c075dce68a9c77e739e4b71ae38d56c8e41142 src/utils.h
--- a/src/utils.h Mon Feb 19 00:40:40 2007 +0000
+++ b/src/utils.h Mon Feb 19 00:36:05 2007 +0000
@@ -83,6 +83,7 @@ void get_mrl_from_filesystem (GtkWindow
void get_mrl_from_filesystem (GtkWindow *, GtkEntry *);
void window_show (GtkWidget *widget, GtkWidget *parent); /* NULL => app */
+void window_present (GtkWidget *widget, GtkWidget *parent); /* ditto */
/* attach to delete-event signal -> hide widget & set *visible = FALSE */
void hide_on_delete (GtkWidget *widget, gboolean *visible);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Xine-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xine-cvslog