From 02e5a6a3bb6cdeb5f16f2dd3a3cb6353b06aaaa8 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sat, 26 Nov 2022 21:51:45 +0000 Subject: Install callback routine whilst waiting for sub-programs to terminate. This allows us to respond to window events and check-alive pings (mga#31105) --- draklive-install | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'draklive-install') diff --git a/draklive-install b/draklive-install index c084713..3b8224c 100755 --- a/draklive-install +++ b/draklive-install @@ -37,6 +37,21 @@ my $logfile = '/tmp/draklive-install.log'; } } +my $child_pid; +END { + run_program::terminate($child_pid) if $child_pid; +} + +sub wait_loop_callback { + my ($pid) = @_; + $child_pid = $pid; + while (Gtk3::events_pending()) { + Gtk3::main_iteration(); + } + $child_pid = undef; +} +run_program::set_wait_loop_callback(\&wait_loop_callback, 50); + ($::rootwidth, $::rootheight) = (Gtk3::Gdk::Screen::width, Gtk3::Gdk::Screen::height); $::real_windowwidth = $::rootwidth > 800 ? 750 : 600; $::real_windowheight = $::rootheight > 600 ? 500 : 400; -- cgit v1.2.1