forked from AuroraMiddleware/gtk
Stop using gtk_widget_destroyed
Replace all internal use of gtk_widget_destroyed by g_object_add_weak_pointer.
This commit is contained in:
parent
9ce7b16dd8
commit
8f9c3ed44a
@ -178,8 +178,7 @@ do_assistant (GtkWidget *do_widget)
|
||||
|
||||
gtk_window_set_display (GTK_WINDOW (assistant),
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (assistant, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &assistant);
|
||||
g_object_add_weak_pointer (G_OBJECT (assistant), (gpointer *)&assistant);
|
||||
|
||||
create_page1 (assistant);
|
||||
create_page2 (assistant);
|
||||
|
@ -74,8 +74,7 @@ do_builder (GtkWidget *do_widget)
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
actions = (GActionGroup*)g_simple_action_group_new ();
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (actions),
|
||||
win_entries, G_N_ELEMENTS (win_entries),
|
||||
|
@ -108,9 +108,7 @@ do_clipboard (GtkWidget *do_widget)
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Clipboard");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_widget_set_margin_start (vbox, 8);
|
||||
|
@ -315,9 +315,7 @@ do_combobox (GtkWidget *do_widget)
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Combo Boxes");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
|
||||
gtk_widget_set_margin_start (vbox, 10);
|
||||
|
@ -263,8 +263,7 @@ do_constraints (GtkWidget *do_widget)
|
||||
header = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), FALSE);
|
||||
gtk_window_set_titlebar (GTK_WINDOW (window), header);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
|
||||
gtk_window_set_child (GTK_WINDOW (window), box);
|
||||
|
@ -219,8 +219,7 @@ do_constraints2 (GtkWidget *do_widget)
|
||||
header = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), FALSE);
|
||||
gtk_window_set_titlebar (GTK_WINDOW (window), header);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
|
||||
gtk_window_set_child (GTK_WINDOW (window), box);
|
||||
|
@ -139,8 +139,7 @@ do_constraints3 (GtkWidget *do_widget)
|
||||
header = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), FALSE);
|
||||
gtk_window_set_titlebar (GTK_WINDOW (window), header);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
|
||||
gtk_window_set_child (GTK_WINDOW (window), box);
|
||||
|
@ -28,8 +28,7 @@ do_css_accordion (GtkWidget *do_widget)
|
||||
gtk_window_set_title (GTK_WINDOW (window), "CSS Accordion");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 300);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_widget_set_halign (container, GTK_ALIGN_CENTER);
|
||||
|
@ -76,8 +76,7 @@ do_css_basics (GtkWidget *do_widget)
|
||||
gtk_window_set_title (GTK_WINDOW (window), "CSS Basics");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
text = gtk_text_buffer_new (NULL);
|
||||
gtk_text_buffer_create_tag (text,
|
||||
|
@ -125,7 +125,7 @@ do_css_blendmodes (GtkWidget *do_widget)
|
||||
|
||||
window = WID ("window");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
/* Setup the CSS provider for window */
|
||||
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
|
||||
|
@ -90,8 +90,7 @@ do_css_multiplebgs (GtkWidget *do_widget)
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Multiple Backgrounds");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
container = gtk_overlay_new ();
|
||||
gtk_window_set_child (GTK_WINDOW (window), container);
|
||||
|
@ -76,8 +76,7 @@ do_css_pixbufs (GtkWidget *do_widget)
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Animated Backgrounds");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
paned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
|
||||
gtk_window_set_child (GTK_WINDOW (window), paned);
|
||||
|
@ -95,8 +95,7 @@ do_css_shadows (GtkWidget *do_widget)
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Shadows");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
paned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
|
||||
gtk_window_set_child (GTK_WINDOW (window), paned);
|
||||
|
@ -109,9 +109,7 @@ do_dialog (GtkWidget *do_widget)
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Dialogs and Message Boxes");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
frame = gtk_frame_new ("Dialogs");
|
||||
gtk_widget_set_margin_start (frame, 8);
|
||||
|
@ -438,9 +438,7 @@ do_dnd (GtkWidget *do_widget)
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Drag-and-Drop");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 640, 480);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_window_set_child (GTK_WINDOW (window), box);
|
||||
|
@ -352,8 +352,7 @@ do_editable_cells (GtkWidget *do_widget)
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Editable Cells");
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
|
||||
gtk_widget_set_margin_start (vbox, 5);
|
||||
|
@ -50,9 +50,7 @@ do_entry_completion (GtkWidget *do_widget)
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Entry Completion");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
|
||||
gtk_widget_set_margin_start (vbox, 5);
|
||||
|
@ -25,8 +25,7 @@ do_entry_undo (GtkWidget *do_widget)
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Entry Undo");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
|
||||
gtk_widget_set_margin_start (vbox, 5);
|
||||
|
@ -125,8 +125,7 @@ do_filtermodel (GtkWidget *do_widget)
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
store = (GtkListStore*)gtk_builder_get_object (builder, "liststore1");
|
||||
|
||||
|
@ -273,15 +273,13 @@ do_fishbowl (GtkWidget *do_widget)
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/fishbowl/fishbowl.ui");
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
bowl = GTK_WIDGET (gtk_builder_get_object (builder, "bowl"));
|
||||
selected_widget_type = -1;
|
||||
set_widget_type (GTK_FISHBOWL (bowl), 0);
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
gtk_widget_realize (window);
|
||||
g_object_unref (builder);
|
||||
|
@ -724,9 +724,7 @@ do_flowbox (GtkWidget *do_widget)
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Flow Box");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 600);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
scrolled = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
|
||||
|
@ -1333,8 +1333,7 @@ do_font_features (GtkWidget *do_widget)
|
||||
|
||||
font_features_font_changed ();
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
g_object_unref (builder);
|
||||
|
||||
|
@ -85,7 +85,7 @@ do_gears (GtkWidget *do_widget)
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Gears");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 640, 640);
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
overlay = gtk_overlay_new ();
|
||||
gtk_widget_set_margin_start (overlay, 12);
|
||||
|
@ -149,8 +149,7 @@ do_gestures (GtkWidget *do_widget)
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 400);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Gestures");
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
drawing_area = gtk_drawing_area_new ();
|
||||
gtk_window_set_child (GTK_WINDOW (window), drawing_area);
|
||||
|
@ -25,8 +25,8 @@ do_headerbar (GtkWidget *do_widget)
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Welcome to Facebook - Log in, sign up or learn more");
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
|
||||
|
||||
header = gtk_header_bar_new ();
|
||||
|
@ -237,9 +237,7 @@ do_hypertext (GtkWidget *do_widget)
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 450, 450);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
view = gtk_text_view_new ();
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), GTK_WRAP_WORD);
|
||||
|
@ -209,12 +209,10 @@ do_iconscroll (GtkWidget *do_widget)
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/iconscroll/iconscroll.ui");
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
scrolledwindow = GTK_WIDGET (gtk_builder_get_object (builder, "scrolledwindow"));
|
||||
gtk_widget_realize (window);
|
||||
hadjustment = GTK_ADJUSTMENT (gtk_builder_get_object (builder, "hadjustment"));
|
||||
|
@ -111,9 +111,7 @@ do_iconview_edit (GtkWidget *do_widget)
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Editing and Drag-and-Drop");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
store = create_store ();
|
||||
fill_store (store);
|
||||
|
@ -335,9 +335,8 @@ do_images (GtkWidget *do_widget)
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Images");
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (cleanup_callback), NULL);
|
||||
|
||||
|
@ -58,8 +58,7 @@ do_infobar (GtkWidget *do_widget)
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Info Bars");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_widget_set_margin_start (vbox, 8);
|
||||
|
@ -59,8 +59,7 @@ do_links (GtkWidget *do_widget)
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Links");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
label = gtk_label_new ("Some <a href=\"http://en.wikipedia.org/wiki/Text\""
|
||||
"title=\"plain text\">text</a> may be marked up "
|
||||
|
@ -257,9 +257,7 @@ do_list_store (GtkWidget *do_widget)
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "List Store");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
|
||||
gtk_widget_set_margin_start (vbox, 8);
|
||||
|
@ -351,13 +351,8 @@ do_listbox (GtkWidget *do_widget)
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "List Box");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window),
|
||||
400, 600);
|
||||
|
||||
/* NULL window variable when window is closed */
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 600);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
|
||||
gtk_window_set_child (GTK_WINDOW (window), vbox);
|
||||
|
@ -58,8 +58,7 @@ do_markup (GtkWidget *do_widget)
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 450, 450);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
stack = gtk_stack_new ();
|
||||
gtk_widget_show (stack);
|
||||
|
@ -43,8 +43,7 @@ do_modelbutton (GtkWidget *do_widget)
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
actions = (GActionGroup*)g_simple_action_group_new ();
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (actions),
|
||||
|
@ -79,9 +79,7 @@ do_overlay (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (vbox), entry);
|
||||
|
||||
gtk_window_set_child (GTK_WINDOW (window), overlay);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
@ -60,9 +60,7 @@ do_overlay2 (GtkWidget *do_widget)
|
||||
gtk_window_set_child (GTK_WINDOW (window), overlay);
|
||||
gtk_overlay_set_child (GTK_OVERLAY (overlay), sw);
|
||||
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), text);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
image = gtk_picture_new_for_resource ("/overlay2/decor1.png");
|
||||
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), image);
|
||||
|
@ -22,7 +22,7 @@ do_pagesetup (GtkWidget *do_widget)
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_page_setup_unix_dialog_new ("Page Setup", GTK_WINDOW (do_widget));
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
g_signal_connect (window, "response", G_CALLBACK (done_cb), NULL);
|
||||
}
|
||||
|
||||
|
@ -405,10 +405,7 @@ do_paint (GtkWidget *toplevel)
|
||||
gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), colorbutton);
|
||||
gtk_window_set_titlebar (GTK_WINDOW (window), headerbar);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Paint");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
@ -152,9 +152,7 @@ do_panes (GtkWidget *do_widget)
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Paned Widgets");
|
||||
|
||||
|
@ -45,8 +45,7 @@ do_password_entry (GtkWidget *do_widget)
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Choose a Password");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
gtk_window_set_deletable (GTK_WINDOW (window), FALSE);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
|
||||
gtk_widget_set_margin_start (box, 18);
|
||||
|
@ -284,8 +284,7 @@ do_peg_solitaire (GtkWidget *do_widget)
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Peg Solitaire");
|
||||
gtk_window_set_titlebar (GTK_WINDOW (window), header);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
grid = gtk_grid_new ();
|
||||
gtk_widget_set_halign (grid, GTK_ALIGN_CENTER);
|
||||
|
@ -18,9 +18,7 @@ do_pickers (GtkWidget *do_widget)
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Pickers");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
table = gtk_grid_new ();
|
||||
gtk_widget_set_margin_start (table, 20);
|
||||
|
@ -179,9 +179,7 @@ do_pixbufs (GtkWidget *do_widget)
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Pixbufs");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
error = NULL;
|
||||
if (!load_pixbufs (&error))
|
||||
|
@ -180,8 +180,7 @@ do_rotated_text (GtkWidget *do_widget)
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Rotated Text");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 4 * RADIUS, 2 * RADIUS);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_box_set_homogeneous (GTK_BOX (box), TRUE);
|
||||
|
@ -21,8 +21,7 @@ do_scale (GtkWidget *do_widget)
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
g_object_unref (builder);
|
||||
}
|
||||
|
@ -73,9 +73,7 @@ do_search_entry2 (GtkWidget *do_widget)
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
|
||||
gtk_widget_set_size_request (window, 200, -1);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_window_set_child (GTK_WINDOW (window), vbox);
|
||||
|
@ -56,9 +56,7 @@ do_shortcut_triggers (GtkWidget *do_widget)
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Shortcuts");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
list = gtk_list_box_new ();
|
||||
gtk_widget_set_margin_top (list, 6);
|
||||
|
@ -89,8 +89,7 @@ do_shortcuts (GtkWidget *do_widget)
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
g_object_unref (builder);
|
||||
}
|
||||
|
@ -43,9 +43,7 @@ do_sidebar (GtkWidget *do_widget)
|
||||
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR(header), TRUE);
|
||||
gtk_window_set_titlebar (GTK_WINDOW(window), header);
|
||||
gtk_window_set_title (GTK_WINDOW(window), "Stack Sidebar");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
sidebar = gtk_stack_sidebar_new ();
|
||||
|
@ -104,8 +104,7 @@ do_sizegroup (GtkWidget *do_widget)
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Size Groups");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
|
||||
gtk_widget_set_margin_start (vbox, 5);
|
||||
|
@ -460,8 +460,7 @@ do_sliding_puzzle (GtkWidget *do_widget)
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Sliding Puzzle");
|
||||
gtk_window_set_titlebar (GTK_WINDOW (window), header);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
frame = gtk_aspect_frame_new (0.5, 0.5, (float) gdk_paintable_get_intrinsic_aspect_ratio (puzzle), FALSE);
|
||||
gtk_window_set_child (GTK_WINDOW (window), frame);
|
||||
|
@ -196,8 +196,7 @@ do_spinbutton (GtkWidget *do_widget)
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Spin Buttons");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
adj = GTK_ADJUSTMENT (gtk_builder_get_object (builder, "basic_adjustment"));
|
||||
label = GTK_WIDGET (gtk_builder_get_object (builder, "basic_label"));
|
||||
|
@ -46,8 +46,7 @@ do_spinner (GtkWidget *do_widget)
|
||||
|
||||
g_signal_connect (window, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
|
||||
|
||||
|
@ -21,8 +21,7 @@ do_stack (GtkWidget *do_widget)
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
g_object_unref (builder);
|
||||
}
|
||||
|
@ -23,9 +23,7 @@ do_tabs (GtkWidget *do_widget)
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 450, 450);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
view = gtk_text_view_new ();
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), GTK_WRAP_WORD);
|
||||
|
@ -72,8 +72,7 @@ do_tagged_entry (GtkWidget *do_widget)
|
||||
gtk_window_set_title (GTK_WINDOW (window), "A tagged entry");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
|
||||
gtk_window_set_deletable (GTK_WINDOW (window), FALSE);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
|
||||
gtk_widget_set_margin_start (box, 18);
|
||||
|
@ -63,9 +63,7 @@ do_textmask (GtkWidget *do_widget)
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
|
||||
gtk_widget_set_size_request (window, 400, 200);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Text Mask");
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
da = gtk_drawing_area_new ();
|
||||
|
||||
|
@ -182,8 +182,7 @@ do_textscroll (GtkWidget *do_widget)
|
||||
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Automatic Scrolling");
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
|
||||
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
||||
|
@ -26,11 +26,8 @@ do_textundo (GtkWidget *do_widget)
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window),
|
||||
450, 450);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 450, 450);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "TextView Undo");
|
||||
|
||||
|
@ -477,11 +477,8 @@ do_textview (GtkWidget *do_widget)
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window),
|
||||
450, 450);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 450, 450);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Multiple Views");
|
||||
|
||||
|
@ -178,12 +178,10 @@ do_themes (GtkWidget *do_widget)
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/themes/themes.ui");
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
header = GTK_WIDGET (gtk_builder_get_object (builder, "header"));
|
||||
gesture = gtk_gesture_click_new ();
|
||||
g_signal_connect (gesture, "pressed", G_CALLBACK (clicked), builder);
|
||||
|
@ -25,8 +25,7 @@ do_theming_style_classes (GtkWidget *do_widget)
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Style Classes");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
builder = gtk_builder_new_from_resource ("/theming_style_classes/theming.ui");
|
||||
|
||||
|
@ -22,9 +22,7 @@ do_transparent (GtkWidget *do_widget)
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 450, 450);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Transparency");
|
||||
|
||||
|
@ -394,8 +394,7 @@ do_tree_store (GtkWidget *do_widget)
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Tree Store");
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
|
||||
gtk_widget_set_margin_start (vbox, 8);
|
||||
|
@ -67,8 +67,7 @@ do_video_player (GtkWidget *do_widget)
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Video Player");
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
video = gtk_video_new ();
|
||||
gtk_window_set_child (GTK_WINDOW (window), video);
|
||||
|
@ -218,6 +218,13 @@ gtk_mount_operation_init (GtkMountOperation *operation)
|
||||
g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (operation->priv->handler), G_MAXINT);
|
||||
}
|
||||
|
||||
static void
|
||||
parent_destroyed (GtkWidget *parent,
|
||||
gpointer **pointer)
|
||||
{
|
||||
*pointer = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_mount_operation_finalize (GObject *object)
|
||||
{
|
||||
@ -230,7 +237,7 @@ gtk_mount_operation_finalize (GObject *object)
|
||||
if (priv->parent_window)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (priv->parent_window,
|
||||
gtk_widget_destroyed,
|
||||
parent_destroyed,
|
||||
&priv->parent_window);
|
||||
g_object_unref (priv->parent_window);
|
||||
}
|
||||
@ -1835,7 +1842,7 @@ gtk_mount_operation_set_parent (GtkMountOperation *op,
|
||||
if (priv->parent_window)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (priv->parent_window,
|
||||
gtk_widget_destroyed,
|
||||
parent_destroyed,
|
||||
&priv->parent_window);
|
||||
g_object_unref (priv->parent_window);
|
||||
}
|
||||
@ -1844,8 +1851,7 @@ gtk_mount_operation_set_parent (GtkMountOperation *op,
|
||||
{
|
||||
g_object_ref (priv->parent_window);
|
||||
g_signal_connect (priv->parent_window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&priv->parent_window);
|
||||
G_CALLBACK (parent_destroyed), &priv->parent_window);
|
||||
}
|
||||
|
||||
if (priv->dialog)
|
||||
|
124
gtk/gtkwindow.c
124
gtk/gtkwindow.c
@ -2410,41 +2410,20 @@ gtk_window_dispose (GObject *object)
|
||||
}
|
||||
|
||||
static void
|
||||
parent_destroyed_callback (GtkWindow *parent, GtkWindow *child)
|
||||
gtk_window_transient_parent_destroyed (GtkWindow *parent,
|
||||
GtkWindow *window)
|
||||
{
|
||||
gtk_widget_destroy (GTK_WIDGET (child));
|
||||
}
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (GTK_WINDOW (window));
|
||||
|
||||
static void
|
||||
connect_parent_destroyed (GtkWindow *window)
|
||||
{
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
|
||||
if (priv->transient_parent)
|
||||
{
|
||||
g_signal_connect (priv->transient_parent,
|
||||
"destroy",
|
||||
G_CALLBACK (parent_destroyed_callback),
|
||||
window);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
disconnect_parent_destroyed (GtkWindow *window)
|
||||
{
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
|
||||
if (priv->transient_parent)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (priv->transient_parent,
|
||||
parent_destroyed_callback,
|
||||
window);
|
||||
}
|
||||
if (priv->destroy_with_parent)
|
||||
gtk_widget_destroy (GTK_WIDGET (window));
|
||||
else
|
||||
priv->transient_parent = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_window_transient_parent_realized (GtkWidget *parent,
|
||||
GtkWidget *window)
|
||||
GtkWidget *window)
|
||||
{
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (GTK_WINDOW (window));
|
||||
GtkWindowPrivate *parent_priv = gtk_window_get_instance_private (GTK_WINDOW (parent));
|
||||
@ -2454,7 +2433,7 @@ gtk_window_transient_parent_realized (GtkWidget *parent,
|
||||
|
||||
static void
|
||||
gtk_window_transient_parent_unrealized (GtkWidget *parent,
|
||||
GtkWidget *window)
|
||||
GtkWidget *window)
|
||||
{
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (GTK_WINDOW (window));
|
||||
if (_gtk_widget_get_realized (window))
|
||||
@ -2462,7 +2441,7 @@ gtk_window_transient_parent_unrealized (GtkWidget *parent,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_window_transient_parent_display_changed (GtkWindow *parent,
|
||||
gtk_window_transient_parent_display_changed (GtkWindow *parent,
|
||||
GParamSpec *pspec,
|
||||
GtkWindow *window)
|
||||
{
|
||||
@ -2471,7 +2450,7 @@ gtk_window_transient_parent_display_changed (GtkWindow *parent,
|
||||
gtk_window_set_display (window, parent_priv->display);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
gtk_window_unset_transient_for (GtkWindow *window)
|
||||
{
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
@ -2479,29 +2458,25 @@ gtk_window_unset_transient_for (GtkWindow *window)
|
||||
if (priv->transient_parent)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (priv->transient_parent,
|
||||
gtk_window_transient_parent_realized,
|
||||
window);
|
||||
gtk_window_transient_parent_realized,
|
||||
window);
|
||||
g_signal_handlers_disconnect_by_func (priv->transient_parent,
|
||||
gtk_window_transient_parent_unrealized,
|
||||
window);
|
||||
gtk_window_transient_parent_unrealized,
|
||||
window);
|
||||
g_signal_handlers_disconnect_by_func (priv->transient_parent,
|
||||
gtk_window_transient_parent_display_changed,
|
||||
window);
|
||||
gtk_window_transient_parent_display_changed,
|
||||
window);
|
||||
g_signal_handlers_disconnect_by_func (priv->transient_parent,
|
||||
gtk_widget_destroyed,
|
||||
&priv->transient_parent);
|
||||
|
||||
if (priv->destroy_with_parent)
|
||||
disconnect_parent_destroyed (window);
|
||||
gtk_window_transient_parent_destroyed,
|
||||
window);
|
||||
|
||||
priv->transient_parent = NULL;
|
||||
|
||||
if (priv->transient_parent_group)
|
||||
{
|
||||
priv->transient_parent_group = FALSE;
|
||||
gtk_window_group_remove_window (priv->group,
|
||||
window);
|
||||
}
|
||||
{
|
||||
priv->transient_parent_group = FALSE;
|
||||
gtk_window_group_remove_window (priv->group, window);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2524,8 +2499,8 @@ gtk_window_unset_transient_for (GtkWindow *window)
|
||||
* much as the window manager would have done on X.
|
||||
*/
|
||||
void
|
||||
gtk_window_set_transient_for (GtkWindow *window,
|
||||
GtkWindow *parent)
|
||||
gtk_window_set_transient_for (GtkWindow *window,
|
||||
GtkWindow *parent)
|
||||
{
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
|
||||
@ -2538,9 +2513,8 @@ gtk_window_set_transient_for (GtkWindow *window,
|
||||
if (_gtk_widget_get_realized (GTK_WIDGET (window)) &&
|
||||
_gtk_widget_get_realized (GTK_WIDGET (priv->transient_parent)) &&
|
||||
(!parent || !_gtk_widget_get_realized (GTK_WIDGET (parent))))
|
||||
gtk_window_transient_parent_unrealized (GTK_WIDGET (priv->transient_parent),
|
||||
GTK_WIDGET (window));
|
||||
|
||||
gtk_window_transient_parent_unrealized (GTK_WIDGET (priv->transient_parent),
|
||||
GTK_WIDGET (window));
|
||||
gtk_window_unset_transient_for (window);
|
||||
}
|
||||
|
||||
@ -2549,34 +2523,27 @@ gtk_window_set_transient_for (GtkWindow *window,
|
||||
if (parent)
|
||||
{
|
||||
GtkWindowPrivate *parent_priv = gtk_window_get_instance_private (parent);
|
||||
g_signal_connect (parent, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&priv->transient_parent);
|
||||
g_signal_connect (parent, "realize",
|
||||
G_CALLBACK (gtk_window_transient_parent_realized),
|
||||
window);
|
||||
G_CALLBACK (gtk_window_transient_parent_realized), window);
|
||||
g_signal_connect (parent, "unrealize",
|
||||
G_CALLBACK (gtk_window_transient_parent_unrealized),
|
||||
window);
|
||||
G_CALLBACK (gtk_window_transient_parent_unrealized), window);
|
||||
g_signal_connect (parent, "notify::display",
|
||||
G_CALLBACK (gtk_window_transient_parent_display_changed),
|
||||
window);
|
||||
G_CALLBACK (gtk_window_transient_parent_display_changed), window);
|
||||
g_signal_connect (parent, "destroy",
|
||||
G_CALLBACK (gtk_window_transient_parent_destroyed), window);
|
||||
|
||||
gtk_window_set_display (window, parent_priv->display);
|
||||
|
||||
if (priv->destroy_with_parent)
|
||||
connect_parent_destroyed (window);
|
||||
|
||||
|
||||
if (_gtk_widget_get_realized (GTK_WIDGET (window)) &&
|
||||
_gtk_widget_get_realized (GTK_WIDGET (parent)))
|
||||
gtk_window_transient_parent_realized (GTK_WIDGET (parent),
|
||||
GTK_WIDGET (window));
|
||||
_gtk_widget_get_realized (GTK_WIDGET (parent)))
|
||||
gtk_window_transient_parent_realized (GTK_WIDGET (parent), GTK_WIDGET (window));
|
||||
|
||||
if (parent_priv->group)
|
||||
{
|
||||
gtk_window_group_add_window (parent_priv->group, window);
|
||||
priv->transient_parent_group = TRUE;
|
||||
}
|
||||
{
|
||||
gtk_window_group_add_window (parent_priv->group, window);
|
||||
priv->transient_parent_group = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
update_window_actions (window);
|
||||
@ -2710,8 +2677,8 @@ gtk_window_set_application (GtkWindow *window,
|
||||
* associated with, for example.
|
||||
**/
|
||||
void
|
||||
gtk_window_set_destroy_with_parent (GtkWindow *window,
|
||||
gboolean setting)
|
||||
gtk_window_set_destroy_with_parent (GtkWindow *window,
|
||||
gboolean setting)
|
||||
{
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
|
||||
@ -2720,15 +2687,6 @@ gtk_window_set_destroy_with_parent (GtkWindow *window,
|
||||
if (priv->destroy_with_parent == (setting != FALSE))
|
||||
return;
|
||||
|
||||
if (priv->destroy_with_parent)
|
||||
{
|
||||
disconnect_parent_destroyed (window);
|
||||
}
|
||||
else
|
||||
{
|
||||
connect_parent_destroyed (window);
|
||||
}
|
||||
|
||||
priv->destroy_with_parent = setting;
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_DESTROY_WITH_PARENT]);
|
||||
|
222
tests/testgtk.c
222
tests/testgtk.c
@ -227,10 +227,7 @@ create_alpha_window (GtkWidget *widget)
|
||||
g_signal_connect (display, "notify::composited", G_CALLBACK (on_composited_changed), label);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (vbox), build_alpha_widgets ());
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
g_signal_connect (window, "response",
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
@ -274,11 +271,8 @@ create_buttons (GtkWidget *widget)
|
||||
{
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "GtkButton");
|
||||
|
||||
@ -357,11 +351,8 @@ create_toggle_buttons (GtkWidget *widget)
|
||||
{
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "GtkToggleButton");
|
||||
|
||||
@ -476,11 +467,8 @@ create_check_buttons (GtkWidget *widget)
|
||||
NULL);
|
||||
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
g_signal_connect (window, "response",
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
NULL);
|
||||
@ -545,11 +533,8 @@ create_radio_buttons (GtkWidget *widget)
|
||||
NULL);
|
||||
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
g_signal_connect (window, "response",
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
NULL);
|
||||
@ -734,11 +719,8 @@ create_statusbar (GtkWidget *widget)
|
||||
{
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "statusbar");
|
||||
|
||||
@ -944,11 +926,8 @@ static void create_labels (GtkWidget *widget)
|
||||
window = gtk_window_new ();
|
||||
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Label");
|
||||
|
||||
@ -1187,8 +1166,7 @@ create_rotated_text (GtkWidget *widget)
|
||||
|
||||
g_signal_connect (window, "response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
|
||||
|
||||
@ -1239,11 +1217,8 @@ create_pixbuf (GtkWidget *widget)
|
||||
window = gtk_window_new ();
|
||||
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "GtkPixmap");
|
||||
gtk_widget_realize(window);
|
||||
@ -1426,9 +1401,7 @@ create_image (GtkWidget *widget)
|
||||
*/
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
|
||||
|
||||
@ -1549,7 +1522,7 @@ create_listbox (GtkWidget *widget)
|
||||
gtk_window_set_hide_on_close (GTK_WINDOW (window), TRUE);
|
||||
gtk_window_set_display (GTK_WINDOW (window), display);
|
||||
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "listbox");
|
||||
|
||||
@ -1649,7 +1622,6 @@ static void
|
||||
create_key_lookup (GtkWidget *widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
gpointer window_ptr;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
@ -1702,8 +1674,7 @@ create_key_lookup (GtkWidget *widget)
|
||||
button = accel_button_new ("Button 14", "<Meta>a");
|
||||
gtk_container_add (GTK_CONTAINER (box), button);
|
||||
|
||||
window_ptr = &window;
|
||||
g_object_add_weak_pointer (G_OBJECT (window), window_ptr);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
g_signal_connect (window, "response", G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
|
||||
gtk_widget_show (window);
|
||||
@ -1857,10 +1828,7 @@ make_message_dialog (GdkDisplay *display,
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
*dialog);
|
||||
|
||||
g_signal_connect (*dialog,
|
||||
"destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
dialog);
|
||||
g_object_add_weak_pointer (G_OBJECT (*dialog), (gpointer)dialog);
|
||||
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (*dialog), default_response);
|
||||
|
||||
@ -1982,11 +1950,8 @@ create_scrolled_windows (GtkWidget *widget)
|
||||
window = gtk_dialog_new ();
|
||||
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
|
||||
|
||||
@ -2132,11 +2097,8 @@ create_entry (GtkWidget *widget)
|
||||
{
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "entry");
|
||||
|
||||
@ -2238,11 +2200,8 @@ create_expander (GtkWidget *widget)
|
||||
{
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "expander");
|
||||
|
||||
@ -2419,21 +2378,15 @@ create_size_groups (GtkWidget *widget)
|
||||
if (!window1)
|
||||
{
|
||||
window1 = create_size_group_window (gtk_widget_get_display (widget),
|
||||
master_size_group);
|
||||
|
||||
g_signal_connect (window1, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window1);
|
||||
master_size_group);
|
||||
g_object_add_weak_pointer (G_OBJECT (window1), (gpointer *)&window1);
|
||||
}
|
||||
|
||||
if (!window2)
|
||||
{
|
||||
window2 = create_size_group_window (gtk_widget_get_display (widget),
|
||||
master_size_group);
|
||||
|
||||
g_signal_connect (window2, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window2);
|
||||
master_size_group);
|
||||
g_object_add_weak_pointer (G_OBJECT (window2), (gpointer *)&window2);
|
||||
}
|
||||
|
||||
if (gtk_widget_get_visible (window1) && gtk_widget_get_visible (window2))
|
||||
@ -2639,11 +2592,8 @@ create_spins (GtkWidget *widget)
|
||||
{
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "GtkSpinButton");
|
||||
|
||||
@ -3089,11 +3039,8 @@ create_cursors (GtkWidget *widget)
|
||||
{
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Cursors");
|
||||
|
||||
@ -3227,14 +3174,11 @@ create_color_selection (GtkWidget *widget)
|
||||
GtkWidget *picker;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *label;
|
||||
|
||||
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "GtkColorButton");
|
||||
|
||||
@ -3350,11 +3294,8 @@ create_flipping (GtkWidget *widget)
|
||||
window = gtk_dialog_new ();
|
||||
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
|
||||
|
||||
@ -3411,11 +3352,8 @@ create_font_selection (GtkWidget *widget)
|
||||
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "GtkFontButton");
|
||||
|
||||
@ -3496,12 +3434,8 @@ create_dialog (GtkWidget *widget)
|
||||
|
||||
dialog_window = gtk_dialog_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (dialog_window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (dialog_window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&dialog_window);
|
||||
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (dialog_window), (gpointer *)&dialog_window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (dialog_window), "GtkDialog");
|
||||
|
||||
@ -3683,11 +3617,8 @@ create_range_controls (GtkWidget *widget)
|
||||
window = gtk_window_new ();
|
||||
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "range controls");
|
||||
|
||||
@ -4046,11 +3977,8 @@ create_notebook (GtkWidget *widget)
|
||||
{
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "notebook");
|
||||
|
||||
@ -4246,11 +4174,8 @@ create_panes (GtkWidget *widget)
|
||||
window = gtk_window_new ();
|
||||
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Panes");
|
||||
|
||||
@ -4614,33 +4539,25 @@ create_paned_keyboard_navigation (GtkWidget *widget)
|
||||
if (!window1)
|
||||
{
|
||||
window1 = paned_keyboard_window1 (widget);
|
||||
g_signal_connect (window1, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window1);
|
||||
g_object_add_weak_pointer (G_OBJECT (window1), (gpointer *)&window1);
|
||||
}
|
||||
|
||||
if (!window2)
|
||||
{
|
||||
window2 = paned_keyboard_window2 (widget);
|
||||
g_signal_connect (window2, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window2);
|
||||
g_object_add_weak_pointer (G_OBJECT (window2), (gpointer *)&window2);
|
||||
}
|
||||
|
||||
if (!window3)
|
||||
{
|
||||
window3 = paned_keyboard_window3 (widget);
|
||||
g_signal_connect (window3, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window3);
|
||||
g_object_add_weak_pointer (G_OBJECT (window3), (gpointer *)&window3);
|
||||
}
|
||||
|
||||
if (!window4)
|
||||
{
|
||||
window4 = paned_keyboard_window4 (widget);
|
||||
g_signal_connect (window4, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window4);
|
||||
g_object_add_weak_pointer (G_OBJECT (window4), (gpointer *)&window4);
|
||||
}
|
||||
|
||||
if (gtk_widget_get_visible (window1))
|
||||
@ -4686,11 +4603,8 @@ create_wmhints (GtkWidget *widget)
|
||||
window = gtk_window_new ();
|
||||
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "WM Hints");
|
||||
|
||||
@ -4921,11 +4835,8 @@ create_surface_states (GtkWidget *widget)
|
||||
{
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (widget));
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
gtk_widget_get_display (widget));
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Surface states");
|
||||
|
||||
@ -5193,17 +5104,12 @@ create_window_sizing (GtkWidget *widget)
|
||||
gtk_label_set_markup (GTK_LABEL (label), "<span foreground=\"purple\"><big>Window being resized</big></span>\nBlah blah blah blah\nblah blah blah\nblah blah blah blah blah");
|
||||
gtk_window_set_child (GTK_WINDOW (target_window), label);
|
||||
gtk_widget_show (target_window);
|
||||
|
||||
g_signal_connect (target_window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&target_window);
|
||||
|
||||
g_object_add_weak_pointer (G_OBJECT (target_window), (gpointer *)&target_window);
|
||||
|
||||
window = window_controls (target_window);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (target_window), "Window to size");
|
||||
}
|
||||
|
||||
@ -5947,9 +5853,7 @@ create_native_dialogs (GtkWidget *widget)
|
||||
g_signal_connect (native, "notify::visible",
|
||||
G_CALLBACK (native_visible_notify_hide), hide_button);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed),
|
||||
&window);
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
Loading…
Reference in New Issue
Block a user