After splash would finish, evoke would ignore first request to run external command, althought

second and rest would be fine. That is hopefully fixed now.

Splash window still gets hidden by old eiconman; for other apps it is fine. Pending for revision.
This commit is contained in:
Sanel Zukan 2007-09-20 08:47:50 +00:00
parent 762ad9883d
commit 5284410840
5 changed files with 55 additions and 40 deletions

View File

@ -196,7 +196,7 @@ void service_watcher_cb(int pid, int signum) {
}
EvokeService::EvokeService() :
is_running(0), logfile(NULL), xsm(NULL), pidfile(NULL), lockfile(NULL), top_win(NULL) {
is_running(0), logfile(NULL), xsm(NULL), pidfile(NULL), lockfile(NULL) {
}
EvokeService::~EvokeService() {
@ -745,7 +745,10 @@ int EvokeService::handle(const XEvent* xev) {
EVOKE_LOG("XSETTINGS manager shutdown\n");
stop_xsettings_manager();
// return 1;
} else if(xev->type == MapNotify) {
}
#if 0
else if(xev->type == MapNotify) {
puts("=================");
if(top_win) {
// for splash to keep it at top (working in old edewm)
XRaiseWindow(fl_display, fl_xid(top_win));
@ -757,7 +760,9 @@ int EvokeService::handle(const XEvent* xev) {
XRaiseWindow(fl_display, fl_xid(top_win));
// return 1;
}
} else if(xev->type == PropertyNotify) {
}
#endif
else if(xev->type == PropertyNotify) {
if(xev->xproperty.atom == _ede_spawn) {
char buff[1024];
if(get_string_property_value(_ede_spawn, buff, sizeof(buff))) {

View File

@ -52,8 +52,6 @@ class EvokeService {
char* pidfile;
char* lockfile;
Fl_Double_Window* top_win;
Atom _ede_shutdown_all;
Atom _ede_spawn;
Atom _ede_evoke_quit;
@ -83,9 +81,6 @@ class EvokeService {
Log* log(void) { return logfile; }
void register_top(Fl_Double_Window* win) { top_win = win; }
void unregister_top(void) { top_win = NULL; }
void service_watcher(int pid, int signum);
void run_program(const char* cmd, bool enable_vars = 1);
//void heuristic_run_program(const char* cmd);

View File

@ -13,9 +13,17 @@ SubDir TOP evoke ;
# use SIGHUP for now as default
ObjectC++Flags evoke.cpp : -DUSE_SIGHUP ;
SOURCE = evoke.cpp EvokeService.cpp Xsm.cpp Spawn.cpp Splash.cpp Log.cpp Logout.cpp Crash.cpp Autostart.cpp ;
SOURCE = evoke.cpp
EvokeService.cpp
Xsm.cpp
Spawn.cpp
Splash.cpp
Log.cpp
Logout.cpp
Crash.cpp
Autostart.cpp ;
LinkAgainst evoke : -lao -lvorbis -lvorbisfile -lmad ;
LinkAgainst evoke : -lao -lvorbis -lvorbisfile ;
EdeProgram evoke : $(SOURCE) ;
FltkProgramBare test/evoke_test : test/evoke_test.cpp ;

View File

@ -56,18 +56,15 @@ int spawn_program(const char* cmd, SignalWatch wf, pid_t* child_pid_ret, const c
int nulldev = -1;
int status_ret = 0;
if(wf) {
struct sigaction sa;
sa.sa_handler = sigchld_handler;
sa.sa_flags = SA_NOCLDSTOP;
sigemptyset(&sa.sa_mask);
sigaction(SIGCHLD, &sa, (struct sigaction*)0);
struct sigaction sa;
sa.sa_handler = sigchld_handler;
sa.sa_flags = SA_NOCLDSTOP;
sigemptyset(&sa.sa_mask);
sigaction(SIGCHLD, &sa, (struct sigaction*)0);
global_watch = wf;
}
global_watch = wf;
pid_t pid = fork();
if(pid == -1)
return SPAWN_FORK_FAILED;

View File

@ -26,11 +26,21 @@
#define TIMEOUT_START 0.5 // timeout when splash is first time shown (also for first client)
#define TIMEOUT_CONTINUE 2.0 // timeout between starting rest of the cliens
#if 0
int splash_xmessage_handler(int ev) {
return EvokeService::instance()->handle(fl_xevent);
extern void service_watcher_cb(int pid, int signum);
Fl_Double_Window* splash_win = 0;
int splash_xmessage_handler(int e) {
if(fl_xevent->type == MapNotify || fl_xevent->type == ConfigureNotify) {
if(splash_win) {
XRaiseWindow(fl_display, fl_xid(splash_win));
return 1;
}
}
return 0;
}
#endif
/*
* repeatedly call runner() untill all clients are
@ -54,6 +64,7 @@ Splash::~Splash() {
EVOKE_LOG("Cleaning splash data\n");
// elements of icons cleans Fl_Group
delete [] icons;
Fl::remove_timeout(runner_cb);
}
@ -175,39 +186,36 @@ void Splash::run(void) {
int sh = DisplayHeight(fl_display, fl_screen);
position(sw/2 - w()/2, sh/2 - h()/2);
bool sound_loaded = false;
if(sound && !sound->empty())
edelib::SoundSystem::init();
sound_loaded = edelib::SoundSystem::init();
show();
Fl::add_timeout(TIMEOUT_START, runner_cb, this);
// FIXME: validate this again !
#if 0
/*
* Fl::wait() will block all events to EvokeService and it will not
* be able to keep this window at the top. So we again select event inputs
* and redirect them to EvokeService::handle().
* Force keeping splash window at the top of all. To do this, we will listen
* MappingNotify and ConfigureNotify events, and when they be triggered we will
* raise splash window.
*/
XSelectInput(fl_display, RootWindow(fl_display, fl_screen), SubstructureNotifyMask);
Fl::add_handler(splash_xmessage_handler);
#endif
splash_win = this;
// make sure MappingNotify keeps this window at the top
EvokeService::instance()->register_top(this);
//XSelectInput(fl_display, RootWindow(fl_display, fl_screen), SubstructureNotifyMask);
//Fl::add_handler(splash_xmessage_handler);
if(edelib::SoundSystem::inited())
if(sound_loaded)
edelib::SoundSystem::play(sound->c_str(), 0);
while(shown())
Fl::wait();
EvokeService::instance()->unregister_top();
if(edelib::SoundSystem::inited()) {
if(sound_loaded) {
edelib::SoundSystem::stop();
edelib::SoundSystem::shutdown();
}
splash_win = 0;
}
// called when splash option is on
@ -236,7 +244,8 @@ bool Splash::next_client(void) {
redraw();
if(!dry_run)
spawn_program(cmd);
spawn_program(cmd, service_watcher_cb);
//spawn_program(cmd);
++clist_it;
++counter;
@ -266,7 +275,8 @@ bool Splash::next_client_nosplash(void) {
printf("%s\n", buff);
if(!dry_run)
spawn_program(cmd);
spawn_program(cmd, service_watcher_cb);
//spawn_program(cmd);
++clist_it;
++counter;