summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rwxr-xr-xmgaapplet22
2 files changed, 12 insertions, 12 deletions
diff --git a/NEWS b/NEWS
index 027a5c5c..aa541063 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- better fix for mga#12280 while fixing mgaapplet exiting reported by
+ Colin
- workaround gnome-shell not exiting message tray mode when clicking on actions
(bgo#706783)
diff --git a/mgaapplet b/mgaapplet
index 2ad9e441..8d4deaa2 100755
--- a/mgaapplet
+++ b/mgaapplet
@@ -223,7 +223,7 @@ $SIG{HUP} = \&restart_applet;
run_program::raw({ detach => 1 }, 'ionice', '-p', $$, '-n7');
-
+my $bubble = Gtk3::Notify::Notification->new('', '');
Gtk3->main;
ugtk3::exit(0);
@@ -616,6 +616,7 @@ sub go2State {
my ($state) = @_;
$menu->destroy if $menu;
$menu = setState($state);
+ warn ">> GOING FROM $state_global to $state\n";
$state_global = $state;
gtkflush();
}
@@ -667,34 +668,31 @@ sub setState {
gtkflush(); # so that bubbles are displayed on right icon
if ($state{$state}{tt}[0] && $icon->isa('Gtk3::StatusIcon') && !$state{$state}{do_not_use_bubble}) {
- my $bubble = Gtk3::Notify::Notification->new(N("Warning"), formatAlaTeX(translate($state{$state}{tt}[0])) . "\n",
+ $bubble->clear_actions;
+ $bubble->update(N("Warning"), formatAlaTeX(translate($state{$state}{tt}[0])) . "\n",
'/usr/share/icons/mgaonline.png');
if ($state eq 'new_distribution') {
- $bubble->add_action('upgrade', N("More Information"), sub { upgrade(); Gtk3->main_quit });
- $bubble->signal_connect('closed' => \&Gtk3::main_quit);
+ $bubble->add_action('upgrade', N("More Information"), sub { upgrade() });
if ($sub_state eq 'updates') {
push @arr, 'update';
}
} elsif ($state eq 'no_more_supported') {
- $bubble->add_action('no_more', N("More Information"), sub { no_more_supported(); Gtk3->main_quit });
- $bubble->signal_connect('closed' => \&Gtk3::main_quit);
+ $bubble->add_action('no_more', N("More Information"), sub { no_more_supported() });
if ($sub_state eq 'updates') {
push @arr, 'update';
}
} elsif ($state eq 'updates') {
unshift @arr, 'upgrade_distro' if $new_distro;
- $bubble->add_action('updates', N("Install updates"), sub { installUpdates(); Gtk3->main_quit });
- $bubble->signal_connect('closed' => \&Gtk3::main_quit);
+ $bubble->add_action('updates', N("Install updates"), sub { installUpdates() });
} elsif (member($state, qw(no_enabled_medium no_update_medium))) {
- $bubble->add_action('add_med', N("Add media"), sub { add_media(); Gtk3->main_quit });
- $bubble->signal_connect('closed' => \&Gtk3::main_quit);
+ $bubble->add_action('add_med', N("Add media"), sub { add_media() });
}
$bubble->set_urgency($state{$state}{urgency}) if $state{$state}{urgency};
my $timeout = 5000;
$bubble->set_timeout($timeout);
- Glib::Timeout->add($timeout, sub { Gtk3->main_quit; 0 });
- eval { $bubble->show; Gtk3->main };
+ Glib::Timeout->add($timeout, sub { $bubble->close; 0 });
+ eval { $bubble->show };
warn ">> ERR:$@" if $@;
}