$window->set_title("snom");
$window->signal_connect(delete_event => \&CloseAppWindow);
$window->signal_connect(destroy => sub { Gtk2->main_quit; });
+
+
my $kphandler = $window->signal_connect(key_press_event => \&KBDInput);
$window->set_border_width(15);
$window->set_resizable(FALSE);
}
}
+sub minimize_to_try{
+ my ($w, $event) = @_;
+ if ($event->changed_mask & [ 'iconified', ]){
+ $window->hide();
+ # Needs to be deiconified after hiding, otherwise show will not behave as expected.
+ $window->deiconify();
+ }
+}
+
my $status_icon = Gtk2::StatusIcon->new_from_file($Bin.'/snom.ico');
my $menu = Gtk2::Menu->new();
$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);