Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Apr 07, 2012
@trinitum init Gtk2::Notify every time before showing notifies
xfce4-notifyd exits after 10 minutes of inactivity on my xubuntu.
As a result metacpan_notify.pl dies when trying to show notifies.
With this change xfce4-notifyd will be started again every time
if it is not running.
0dfdbf1
@trinitum bump version 0.04 41203d8
Showing with 8 additions and 2 deletions.
  1. +4 −0 Changes
  2. +4 −2 lib/App/MetaCPAN/Gtk2/Notify.pm
View
4 Changes
@@ -1,5 +1,9 @@
Revision history for App-MetaCPAN-Gtk2-Notify
+0.04 Sat Apr 7 2012 Pavel Shaydo <zwon@cpan.org>
+ * Reinitialize Gtk::Notify every time before sending notifications.
+ Fixes problem with xfce4-notifyd
+
0.03 Sun Dec 4 2011 Pavel Shaydo <zwon@cpan.org>
* Fix icons' urls, they were broken in my xfce with libnotify 0.7.4
* Add link to distribution page on metacpan into notification
View
6 lib/App/MetaCPAN/Gtk2/Notify.pm
@@ -3,11 +3,11 @@ package App::MetaCPAN::Gtk2::Notify;
use 5.006;
use strict;
use warnings;
-our $VERSION = '0.03';
+our $VERSION = '0.04';
use JSON;
use LWP::UserAgent;
-use Gtk2::Notify -init => 'MetaCPAN_recent';
+use Gtk2::Notify;
use File::Temp ();
use File::Spec;
use File::Slurp qw(write_file);
@@ -87,6 +87,7 @@ sub show_recent {
# skip notifying on a first run
if (%prev_id) {
+ Gtk2::Notify->init('MetaCPAN_recent');
for ( reverse @$recent ) {
next if $prev_id{ $_->{id} };
my ( $auth_name, $avatar ) = @{ get_author( $_->{author} ) };
@@ -94,6 +95,7 @@ sub show_recent {
Gtk2::Notify->new( "$auth_name ($_->{author})", "uploaded <a href='$url'>$_->{name}</a>", $avatar || () )
->show;
}
+ Gtk2::Notify->uninit;
}
%prev_id = map { $_ => 1 } map { $_->{id} } @$recent;
}

No commit comments for this range

Something went wrong with that request. Please try again.