diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2003-02-24 07:36:49 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2003-02-24 07:36:49 +0000 |
commit | 2fa0eb2fdd102857aa5446f63f04bb2e72d94a41 (patch) | |
tree | 11c3cf344e698d0ee282f30d98c96c235fe7a593 | |
parent | 544401f79c9b2a76edd3818e04183e914db8034e (diff) | |
download | control-center-2fa0eb2fdd102857aa5446f63f04bb2e72d94a41.tar control-center-2fa0eb2fdd102857aa5446f63f04bb2e72d94a41.tar.gz control-center-2fa0eb2fdd102857aa5446f63f04bb2e72d94a41.tar.bz2 control-center-2fa0eb2fdd102857aa5446f63f04bb2e72d94a41.tar.xz control-center-2fa0eb2fdd102857aa5446f63f04bb2e72d94a41.zip |
clean up embedding: since socket get automatically destroyed on child exit and
since they emit plug-removed at that moment, it's just cleaner to
centralize/consolidate the child exit in mcc:
- (sig_usr1) rename it child_just_exited()
- move the child exit managment from USR1 signal handler to "plug-removed"
gtk+ signal
what's more, it allows to remove the somewhat mythical "$::isEmbedded and kill
'USR1', $::CCPID;" in drakxtools
-rwxr-xr-x | control-center | 30 | ||||
-rw-r--r-- | drakconf.spec | 6 |
2 files changed, 18 insertions, 18 deletions
diff --git a/control-center b/control-center index 7749fe19..295a3c9f 100755 --- a/control-center +++ b/control-center @@ -309,7 +309,7 @@ my ($menu, $factory) = create_factory_menu($window_global, # embedded app must be killed kill_children(); kill_logdrake(); - sig_usr1(); + child_just_exited(); exec "$0 --theme $name"; }; } @@ -355,7 +355,7 @@ gtkadd($window_global, 0, Gtk2::Label->new(N("Please wait...")), 1, Gtk2::HBox->new(0, 0), 0, gtkadd(gtkset_layout(gtkset_border_width(Gtk2::HButtonBox->new, 10), 'end'), - gtksignal_connect(Gtk2::Button->new(N("Cancel")), clicked => sub { Gtk2->timeout_remove($timeout) if $timeout; &sig_usr1() }), + gtksignal_connect(Gtk2::Button->new(N("Cancel")), clicked => sub { Gtk2->timeout_remove($timeout) if $timeout; &child_just_exited() }), ) ) ), @@ -509,7 +509,7 @@ foreach (@tree) { if ($pending_app) { return if !splash_warning(N("The modifications done in the current module won't be saved."), 1); kill_children(); - sig_usr1(); + child_just_exited(); } # deselect previously selected darea @@ -602,7 +602,7 @@ $window_global->show_all; $exp_frame->hide; $emb_box->hide; -$SIG{USR1} = \&sig_usr1; +$SIG{USR1} = 'IGNORE'; $SIG{USR2} = \&sig_usr2; $SIG{TERM} = \&quit_global; $SIG{CHLD} = \&sig_child; @@ -618,6 +618,16 @@ Gtk2->main; #------------------------------------------------------------- # socket/plug managment +# when child properly exited +sub child_just_exited { + $pending_app = 0; + $left_locked = 0; + clean_socket(); + gtkset_mousecursor_normal(); + $notebook_global->show; + Gtk2->timeout_remove($timeout) if $timeout; +} + sub hide_socket_and_clean { $emb_box->hide; $pending_app = 0; @@ -632,7 +642,7 @@ sub clean_socket { sub create_hidden_socket_if_needed { hide_socket_and_clean(); # clean_socket(); - gtkpack($emb_box, $emb_socket = Gtk2::Socket->new) unless $emb_socket; + gtkpack($emb_box, gtksignal_connect($emb_socket = Gtk2::Socket->new, 'plug-removed' => \&child_just_exited)) unless $socket; $emb_box->set_focus_child($emb_socket); $emb_socket->hide; $emb_wait->hide; @@ -662,16 +672,6 @@ sub sig_child { splash_warning(N("This program has exited abnormally")); } -# got when child properly exited -sub sig_usr1 { - $pending_app = 0; - $left_locked = 0; - clean_socket(); - gtkset_mousecursor_normal(); - $notebook_global->show; - Gtk2->timeout_remove($timeout) if $timeout; -} - # got when apps begin to draw sub sig_usr2 { $left_locked = 0; diff --git a/drakconf.spec b/drakconf.spec index e7a63b43..ab9d57a7 100644 --- a/drakconf.spec +++ b/drakconf.spec @@ -17,9 +17,9 @@ Url: http://www.mandrakelinux.com/en/cvs.php3 Obsoletes: DrakConf Provides: DrakConf BuildRequires: gettext -Requires: mandrake-release, drakxtools >= 9.1-0.35mdk -Requires: harddrake-ui >= 9.1-0.35mdk, popt >= 1.6.4-24mdk, usermode -Requires: perl-GTK2 >= 0.0.cvs.2003.02.12.1-3mdk, XFree86-100dpi-fonts +Requires: mandrake-release, drakxtools >= 9.1-3mdk +Requires: harddrake-ui >= 9.1-3mdk, popt >= 1.6.4-24mdk, usermode +Requires: perl-GTK2 >= 0.0.cvs.2003.02.12.1-4mdk, XFree86-100dpi-fonts Requires: gtk+2.0 >= 2.2.0-3mdk, perl-MDK-Common => 1.0.4-16mdk Requires: drakcronat >= 0.1.3-1mdk, menudrake >= 0.7.2-1mdk, rxvt, userdrake BuildRoot: %_tmppath/%name-%version-buildroot |