diff options
-rw-r--r-- | NEWS | 2 | ||||
-rwxr-xr-x | mgaapplet | 22 |
2 files changed, 12 insertions, 12 deletions
@@ -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) @@ -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 $@; } |