]> git.zerfleddert.de Git - snom-frontend/commitdiff
Only do Icon stuff if it works
authormorty <morty@cs.fau.de>
Wed, 17 Nov 2010 11:00:21 +0000 (12:00 +0100)
committermorty <morty@cs.fau.de>
Wed, 17 Nov 2010 11:00:21 +0000 (12:00 +0100)
snom.pl [changed mode: 0644->0755]

diff --git a/snom.pl b/snom.pl
old mode 100644 (file)
new mode 100755 (executable)
index bc0cdac..c6d0300
--- a/snom.pl
+++ b/snom.pl
@@ -246,19 +246,21 @@ sub minimize_to_try{
 }
 
 my $status_icon = Gtk2::StatusIcon->new_from_file($Bin.'/snom.ico');
-my $menu = Gtk2::Menu->new();
+if($status_icon->get_visible){
 
-my $menuItem = Gtk2::ImageMenuItem->new_from_stock('gtk-quit');
-$menuItem->signal_connect('activate', \&quit_cb, $status_icon);
-$menu->append($menuItem);
-
-$status_icon->set_tooltip('Snom Tray');
-$status_icon->signal_connect('activate', \&activate_icon_cb);
-$status_icon->signal_connect('popup-menu', \&popup_menu_cb, $menu);
-$status_icon->set_visible(1);
-
-$window->signal_connect('window-state-event',\&minimize_to_try);
+       my $menu = Gtk2::Menu->new();
+       
+       my $menuItem = Gtk2::ImageMenuItem->new_from_stock('gtk-quit');
+       $menuItem->signal_connect('activate', \&quit_cb, $status_icon);
+       $menu->append($menuItem);
+       
+       $status_icon->set_tooltip('Snom Tray');
+       $status_icon->signal_connect('activate', \&activate_icon_cb);
+       $status_icon->signal_connect('popup-menu', \&popup_menu_cb, $menu);
+       $status_icon->set_visible(1);
+       
+       $window->signal_connect('window-state-event',\&minimize_to_try);
+}
 ########################################################################333
 
 $window->add($mainbox);
Impressum, Datenschutz