Reworked process handler due a large number of races. Now process reports

should not interfere with popped up message boxes. Still there is a issue
with childs during splash startup: when one of them crashes with core dump
crash dialog will not be shown, but the main process handler correctly returns crash flag.
This commit is contained in:
Sanel Zukan
2007-09-24 11:47:42 +00:00
parent 5284410840
commit 6170d43d19
7 changed files with 151 additions and 36 deletions

View File

@ -28,9 +28,15 @@
extern void service_watcher_cb(int pid, int signum);
Fl_Double_Window* splash_win = 0;
class AutoSound {
public:
AutoSound() { edelib::SoundSystem::init(); }
~AutoSound() { if(edelib::SoundSystem::inited()) edelib::SoundSystem::shutdown(); }
void play(const char* file) { if(edelib::SoundSystem::inited()) edelib::SoundSystem::play(file, 0); }
};
int splash_xmessage_handler(int e) {
if(fl_xevent->type == MapNotify || fl_xevent->type == ConfigureNotify) {
if(splash_win) {
@ -186,9 +192,12 @@ void Splash::run(void) {
int sh = DisplayHeight(fl_display, fl_screen);
position(sw/2 - w()/2, sh/2 - h()/2);
#if 0
bool sound_loaded = false;
if(sound && !sound->empty())
sound_loaded = edelib::SoundSystem::init();
#endif
AutoSound sound_play;
show();
@ -203,17 +212,20 @@ void Splash::run(void) {
//XSelectInput(fl_display, RootWindow(fl_display, fl_screen), SubstructureNotifyMask);
//Fl::add_handler(splash_xmessage_handler);
#if 0
if(sound_loaded)
edelib::SoundSystem::play(sound->c_str(), 0);
#endif
sound_play.play(sound->c_str());
while(shown())
Fl::wait();
#if 0
if(sound_loaded) {
edelib::SoundSystem::stop();
edelib::SoundSystem::shutdown();
}
#endif
splash_win = 0;
}