… | |
… | |
2604 | ["Help Browser…\tF1" , sub { $HELP_WINDOW ->toggle_visibility }], |
2604 | ["Help Browser…\tF1" , sub { $HELP_WINDOW ->toggle_visibility }], |
2605 | ["Quit…" , sub { |
2605 | ["Quit…" , sub { |
2606 | if ($CONN) { |
2606 | if ($CONN) { |
2607 | open_quit_dialog; |
2607 | open_quit_dialog; |
2608 | } else { |
2608 | } else { |
2609 | EV::unloop EV::UNLOOP_ALL; |
2609 | EV::break EV::BREAK_ALL; |
2610 | } |
2610 | } |
2611 | }], |
2611 | }], |
2612 | ]); |
2612 | ]); |
2613 | |
2613 | |
2614 | $BUTTONBAR->add (new DC::UI::Button text => "Menu…", |
2614 | $BUTTONBAR->add (new DC::UI::Button text => "Menu…", |
… | |
… | |
2985 | delete $animate_object{$widget}; |
2985 | delete $animate_object{$widget}; |
2986 | } |
2986 | } |
2987 | |
2987 | |
2988 | $SDL_CB[DC::SDL_QUIT] = sub { |
2988 | $SDL_CB[DC::SDL_QUIT] = sub { |
2989 | crash "SDL_QUIT"; |
2989 | crash "SDL_QUIT"; |
2990 | EV::unloop EV::UNLOOP_ALL; |
2990 | EV::break EV::BREAK_ALL; |
2991 | }; |
2991 | }; |
2992 | $SDL_CB[DC::SDL_VIDEORESIZE] = sub { }; |
2992 | $SDL_CB[DC::SDL_VIDEORESIZE] = sub { }; |
2993 | $SDL_CB[DC::SDL_VIDEOEXPOSE] = sub { |
2993 | $SDL_CB[DC::SDL_VIDEOEXPOSE] = sub { |
2994 | DC::UI::full_refresh; |
2994 | DC::UI::full_refresh; |
2995 | }; |
2995 | }; |
… | |
… | |
3028 | }; |
3028 | }; |
3029 | |
3029 | |
3030 | ############################################################################# |
3030 | ############################################################################# |
3031 | |
3031 | |
3032 | $SIG{INT} = $SIG{TERM} = sub { |
3032 | $SIG{INT} = $SIG{TERM} = sub { |
3033 | EV::unloop; |
3033 | EV::break; |
3034 | #d# TODO calling exit here hangs the process in some futex |
3034 | #d# TODO calling exit here hangs the process in some futex |
3035 | }; |
3035 | }; |
3036 | |
3036 | |
3037 | # due to mac os x + sdl combined braindamage, we need this contortion |
3037 | # due to mac os x + sdl combined braindamage, we need this contortion |
3038 | sub DC::Main::run { |
3038 | sub DC::Main::run { |
… | |
… | |
3155 | }; |
3155 | }; |
3156 | |
3156 | |
3157 | debug_toggle 0; |
3157 | debug_toggle 0; |
3158 | |
3158 | |
3159 | delete $SIG{__DIE__}; |
3159 | delete $SIG{__DIE__}; |
3160 | EV::loop; |
3160 | EV::run; |
3161 | |
3161 | |
3162 | DC::save_cfg if $CFG->{config_autosave}; |
3162 | DC::save_cfg if $CFG->{config_autosave}; |
3163 | |
3163 | |
3164 | #video_shutdown; |
3164 | #video_shutdown; |
3165 | #audio_shutdown; |
3165 | #audio_shutdown; |