mirror of https://github.com/GNOME/gimp.git
don't try to reparent the children of GtkInputDialog but simply pop up the
2003-04-14 Sven Neumann <sven@gimp.org> * app/gui/preferences-dialog.c: don't try to reparent the children of GtkInputDialog but simply pop up the dialog as provided by GTK+. Looks ugly but shouldn't crash any longer. Fixes bug #104423.
This commit is contained in:
parent
de3220695c
commit
b7cf188359
|
@ -1,3 +1,9 @@
|
||||||
|
2003-04-14 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/gui/preferences-dialog.c: don't try to reparent the children
|
||||||
|
of GtkInputDialog but simply pop up the dialog as provided by
|
||||||
|
GTK+. Looks ugly but shouldn't crash any longer. Fixes bug #104423.
|
||||||
|
|
||||||
2003-04-14 Simon Budig <simon@gimp.org>
|
2003-04-14 Simon Budig <simon@gimp.org>
|
||||||
|
|
||||||
* app/vectors/gimpstroke.[ch]
|
* app/vectors/gimpstroke.[ch]
|
||||||
|
|
|
@ -73,6 +73,7 @@ static void prefs_res_source_callback (GtkWidget *widget,
|
||||||
GObject *config);
|
GObject *config);
|
||||||
static void prefs_resolution_calibrate_callback (GtkWidget *widget,
|
static void prefs_resolution_calibrate_callback (GtkWidget *widget,
|
||||||
GtkWidget *sizeentry);
|
GtkWidget *sizeentry);
|
||||||
|
static void prefs_input_devices_dialog (GtkWidget *widget);
|
||||||
static void prefs_input_dialog_able_callback (GtkWidget *widget,
|
static void prefs_input_dialog_able_callback (GtkWidget *widget,
|
||||||
GdkDevice *device,
|
GdkDevice *device,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
@ -409,6 +410,43 @@ prefs_resolution_calibrate_callback (GtkWidget *widget,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
prefs_input_devices_dialog (GtkWidget *widget)
|
||||||
|
{
|
||||||
|
static GtkWidget *input_dialog = NULL;
|
||||||
|
|
||||||
|
if (input_dialog)
|
||||||
|
{
|
||||||
|
gtk_window_present (GTK_WINDOW (input_dialog));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
input_dialog = gtk_input_dialog_new ();
|
||||||
|
|
||||||
|
g_object_add_weak_pointer (G_OBJECT (input_dialog),
|
||||||
|
(gpointer *) &input_dialog);
|
||||||
|
|
||||||
|
gtk_window_set_transient_for (GTK_WINDOW (input_dialog),
|
||||||
|
GTK_WINDOW (prefs_dialog));
|
||||||
|
gtk_window_set_destroy_with_parent (GTK_WINDOW (input_dialog), TRUE);
|
||||||
|
|
||||||
|
gtk_widget_hide (GTK_INPUT_DIALOG (input_dialog)->save_button);
|
||||||
|
|
||||||
|
g_signal_connect_swapped (GTK_INPUT_DIALOG (input_dialog)->close_button,
|
||||||
|
"clicked",
|
||||||
|
G_CALLBACK (gtk_widget_destroy),
|
||||||
|
input_dialog);
|
||||||
|
|
||||||
|
g_signal_connect (input_dialog, "enable_device",
|
||||||
|
G_CALLBACK (prefs_input_dialog_able_callback),
|
||||||
|
NULL);
|
||||||
|
g_signal_connect (input_dialog, "disable_device",
|
||||||
|
G_CALLBACK (prefs_input_dialog_able_callback),
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
gtk_widget_show (input_dialog);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
prefs_input_dialog_able_callback (GtkWidget *widget,
|
prefs_input_dialog_able_callback (GtkWidget *widget,
|
||||||
GdkDevice *device,
|
GdkDevice *device,
|
||||||
|
@ -1281,41 +1319,19 @@ prefs_dialog_new (Gimp *gimp,
|
||||||
page_index++);
|
page_index++);
|
||||||
|
|
||||||
/* Input Device Settings */
|
/* Input Device Settings */
|
||||||
vbox2 = prefs_frame_new (_("Input Device Settings"),
|
hbox = gtk_hbox_new (FALSE, 2);
|
||||||
GTK_CONTAINER (vbox), FALSE);
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
|
||||||
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (hbox);
|
||||||
|
|
||||||
{
|
button = gtk_button_new_with_label (_("Configure Input Devices"));
|
||||||
GtkWidget *input_dialog;
|
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0);
|
||||||
GtkWidget *input_vbox;
|
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
||||||
GList *input_children;
|
gtk_widget_show (button);
|
||||||
|
|
||||||
input_dialog = gtk_input_dialog_new ();
|
g_signal_connect (button, "clicked",
|
||||||
|
G_CALLBACK (prefs_input_devices_dialog),
|
||||||
input_children = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (input_dialog)->vbox));
|
NULL);
|
||||||
|
|
||||||
input_vbox = GTK_WIDGET (input_children->data);
|
|
||||||
|
|
||||||
g_list_free (input_children);
|
|
||||||
|
|
||||||
g_object_ref (input_vbox);
|
|
||||||
|
|
||||||
gtk_container_remove (GTK_CONTAINER (GTK_DIALOG (input_dialog)->vbox),
|
|
||||||
input_vbox);
|
|
||||||
gtk_box_pack_start (GTK_BOX (vbox2), input_vbox, TRUE, TRUE, 0);
|
|
||||||
|
|
||||||
g_object_unref (input_vbox);
|
|
||||||
|
|
||||||
g_object_weak_ref (G_OBJECT (input_vbox),
|
|
||||||
(GWeakNotify) gtk_widget_destroy,
|
|
||||||
input_dialog);
|
|
||||||
|
|
||||||
g_signal_connect (input_dialog, "enable_device",
|
|
||||||
G_CALLBACK (prefs_input_dialog_able_callback),
|
|
||||||
NULL);
|
|
||||||
g_signal_connect (input_dialog, "disable_device",
|
|
||||||
G_CALLBACK (prefs_input_dialog_able_callback),
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
prefs_check_button_add (config, "save-device-status",
|
prefs_check_button_add (config, "save-device-status",
|
||||||
_("Save Input Device Settings on Exit"),
|
_("Save Input Device Settings on Exit"),
|
||||||
|
|
|
@ -73,6 +73,7 @@ static void prefs_res_source_callback (GtkWidget *widget,
|
||||||
GObject *config);
|
GObject *config);
|
||||||
static void prefs_resolution_calibrate_callback (GtkWidget *widget,
|
static void prefs_resolution_calibrate_callback (GtkWidget *widget,
|
||||||
GtkWidget *sizeentry);
|
GtkWidget *sizeentry);
|
||||||
|
static void prefs_input_devices_dialog (GtkWidget *widget);
|
||||||
static void prefs_input_dialog_able_callback (GtkWidget *widget,
|
static void prefs_input_dialog_able_callback (GtkWidget *widget,
|
||||||
GdkDevice *device,
|
GdkDevice *device,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
@ -409,6 +410,43 @@ prefs_resolution_calibrate_callback (GtkWidget *widget,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
prefs_input_devices_dialog (GtkWidget *widget)
|
||||||
|
{
|
||||||
|
static GtkWidget *input_dialog = NULL;
|
||||||
|
|
||||||
|
if (input_dialog)
|
||||||
|
{
|
||||||
|
gtk_window_present (GTK_WINDOW (input_dialog));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
input_dialog = gtk_input_dialog_new ();
|
||||||
|
|
||||||
|
g_object_add_weak_pointer (G_OBJECT (input_dialog),
|
||||||
|
(gpointer *) &input_dialog);
|
||||||
|
|
||||||
|
gtk_window_set_transient_for (GTK_WINDOW (input_dialog),
|
||||||
|
GTK_WINDOW (prefs_dialog));
|
||||||
|
gtk_window_set_destroy_with_parent (GTK_WINDOW (input_dialog), TRUE);
|
||||||
|
|
||||||
|
gtk_widget_hide (GTK_INPUT_DIALOG (input_dialog)->save_button);
|
||||||
|
|
||||||
|
g_signal_connect_swapped (GTK_INPUT_DIALOG (input_dialog)->close_button,
|
||||||
|
"clicked",
|
||||||
|
G_CALLBACK (gtk_widget_destroy),
|
||||||
|
input_dialog);
|
||||||
|
|
||||||
|
g_signal_connect (input_dialog, "enable_device",
|
||||||
|
G_CALLBACK (prefs_input_dialog_able_callback),
|
||||||
|
NULL);
|
||||||
|
g_signal_connect (input_dialog, "disable_device",
|
||||||
|
G_CALLBACK (prefs_input_dialog_able_callback),
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
gtk_widget_show (input_dialog);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
prefs_input_dialog_able_callback (GtkWidget *widget,
|
prefs_input_dialog_able_callback (GtkWidget *widget,
|
||||||
GdkDevice *device,
|
GdkDevice *device,
|
||||||
|
@ -1281,41 +1319,19 @@ prefs_dialog_new (Gimp *gimp,
|
||||||
page_index++);
|
page_index++);
|
||||||
|
|
||||||
/* Input Device Settings */
|
/* Input Device Settings */
|
||||||
vbox2 = prefs_frame_new (_("Input Device Settings"),
|
hbox = gtk_hbox_new (FALSE, 2);
|
||||||
GTK_CONTAINER (vbox), FALSE);
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
|
||||||
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (hbox);
|
||||||
|
|
||||||
{
|
button = gtk_button_new_with_label (_("Configure Input Devices"));
|
||||||
GtkWidget *input_dialog;
|
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0);
|
||||||
GtkWidget *input_vbox;
|
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
||||||
GList *input_children;
|
gtk_widget_show (button);
|
||||||
|
|
||||||
input_dialog = gtk_input_dialog_new ();
|
g_signal_connect (button, "clicked",
|
||||||
|
G_CALLBACK (prefs_input_devices_dialog),
|
||||||
input_children = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (input_dialog)->vbox));
|
NULL);
|
||||||
|
|
||||||
input_vbox = GTK_WIDGET (input_children->data);
|
|
||||||
|
|
||||||
g_list_free (input_children);
|
|
||||||
|
|
||||||
g_object_ref (input_vbox);
|
|
||||||
|
|
||||||
gtk_container_remove (GTK_CONTAINER (GTK_DIALOG (input_dialog)->vbox),
|
|
||||||
input_vbox);
|
|
||||||
gtk_box_pack_start (GTK_BOX (vbox2), input_vbox, TRUE, TRUE, 0);
|
|
||||||
|
|
||||||
g_object_unref (input_vbox);
|
|
||||||
|
|
||||||
g_object_weak_ref (G_OBJECT (input_vbox),
|
|
||||||
(GWeakNotify) gtk_widget_destroy,
|
|
||||||
input_dialog);
|
|
||||||
|
|
||||||
g_signal_connect (input_dialog, "enable_device",
|
|
||||||
G_CALLBACK (prefs_input_dialog_able_callback),
|
|
||||||
NULL);
|
|
||||||
g_signal_connect (input_dialog, "disable_device",
|
|
||||||
G_CALLBACK (prefs_input_dialog_able_callback),
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
prefs_check_button_add (config, "save-device-status",
|
prefs_check_button_add (config, "save-device-status",
|
||||||
_("Save Input Device Settings on Exit"),
|
_("Save Input Device Settings on Exit"),
|
||||||
|
|
Loading…
Reference in New Issue