Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Previewer/Internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@ export default function Internal({
object_root[prop_name] = new_value;
}
}

// Toplevel windows returned by these functions will stay around
// until the user explicitly destroys them with gtk_window_destroy().
// https://docs.gtk.org/gtk4/class.Builder.html
if (object_preview instanceof Gtk.Window) {
object_preview.destroy();
}
}

if (!object_root.name) {
Expand Down
9 changes: 8 additions & 1 deletion src/Previewer/previewer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace Workbench {
var target = this.builder.get_object (target_id) as Gtk.Widget;
if (target == null) {
stderr.printf (@"Widget with target_id='$target_id' could not be found.\n");
return;
return;
}

if (original_id != "") {
Expand Down Expand Up @@ -75,6 +75,13 @@ namespace Workbench {
((Gtk.Window) target).child = null;
this.window.child = child;
}

// Toplevel windows returned by these functions will stay around
// until the user explicitly destroys them with gtk_window_destroy().
// https://docs.gtk.org/gtk4/class.Builder.html
if (target is Gtk.Window) {
((Gtk.Window) target).destroy();
}
}

public void update_css (string content) {
Expand Down