aaah fix non quicklaunch mode too.

SVN revision: 53703
This commit is contained in:
Carsten Haitzler 2010-10-21 04:05:35 +00:00
parent ebf05b3c57
commit e05bdd09d7
3 changed files with 105 additions and 79 deletions

View File

@ -177,6 +177,7 @@ main(int argc, char **argv)
CRITICAL("listen(sock=%d, 4096): %s", sock, strerror(errno));
exit(-1);
}
elm_quicklaunch_mode_set(EINA_TRUE);
elm_quicklaunch_init(argc, argv);
restart_time = ecore_time_get();

View File

@ -294,6 +294,7 @@ extern "C" {
EAPI void elm_run(void);
EAPI void elm_exit(void);
EAPI void elm_quicklaunch_mode_set(Eina_Bool ql_on);
EAPI int elm_quicklaunch_init(int argc, char **argv);
EAPI int elm_quicklaunch_sub_init(int argc, char **argv);
EAPI int elm_quicklaunch_sub_shutdown(void);

View File

@ -15,7 +15,7 @@
#include <Elementary.h>
#include "elm_priv.h"
#define SEMI_BROKEN_QUICKLANCH 1
#define SEMI_BROKEN_QUICKLAUNCH 1
static Elm_Version _version = { VMAJ, VMIN, VMIC, VREV };
EAPI Elm_Version *elm_version = &_version;
@ -300,6 +300,7 @@ static int _elm_sub_init_count = 0;
static int _elm_ql_init_count = 0;
static int _elm_policies[ELM_POLICY_LAST];
static Ecore_Event_Handler *_elm_exit_handler = NULL;
static Eina_Bool quicklaunch_on = 0;
static Eina_Bool
_elm_signal_exit(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__)
@ -425,6 +426,12 @@ _elm_unneed_efreet(void)
#endif
}
EAPI void
elm_quicklaunch_mode_set(Eina_Bool ql_on)
{
quicklaunch_on = ql_on;
}
EAPI int
elm_quicklaunch_init(int argc, char **argv)
{
@ -533,7 +540,14 @@ elm_quicklaunch_sub_init(int argc, char **argv)
{
_elm_sub_init_count++;
if (_elm_sub_init_count > 1) return _elm_sub_init_count;
#ifndef SEMI_BROKEN_QUICKLANCH
if (quicklaunch_on)
{
#ifdef SEMI_BROKEN_QUICKLAUNCH
return _elm_sub_init_count;
#endif
}
if (!quicklaunch_on)
{
ecore_app_args_set(argc, (const char **)argv);
evas_init();
edje_init();
@ -550,10 +564,7 @@ elm_quicklaunch_sub_init(int argc, char **argv)
ecore_evas_init(); // FIXME: check errors
ecore_imf_init();
_elm_module_init();
#else
(void) argc;
(void) argv;
#endif
}
return _elm_sub_init_count;
}
@ -562,7 +573,14 @@ elm_quicklaunch_sub_shutdown(void)
{
_elm_sub_init_count--;
if (_elm_sub_init_count > 0) return _elm_sub_init_count;
#ifndef SEMI_BROKEN_QUICKLANCH
if (quicklaunch_on)
{
#ifdef SEMI_BROKEN_QUICKLAUNCH
return _elm_sub_init_count;
#endif
}
if (!quicklaunch_on)
{
_elm_win_shutdown();
_elm_module_shutdown();
ecore_imf_shutdown();
@ -588,7 +606,7 @@ elm_quicklaunch_sub_shutdown(void)
evas_cserve_disconnect();
edje_shutdown();
evas_shutdown();
#endif
}
return _elm_sub_init_count;
}
@ -633,7 +651,9 @@ elm_quicklaunch_shutdown(void)
EAPI void
elm_quicklaunch_seed(void)
{
#ifndef SEMI_BROKEN_QUICKLANCH
#ifndef SEMI_BROKEN_QUICKLAUNCH
if (quicklaunch_on)
{
Evas_Object *win, *bg, *bt;
win = elm_win_add(NULL, "seed", ELM_WIN_BASIC);
@ -656,6 +676,7 @@ elm_quicklaunch_seed(void)
# endif
}
ecore_main_loop_iterate();
}
#endif
}
@ -789,7 +810,9 @@ elm_quicklaunch_fork(int argc, char **argv, char *cwd, void (postfork_func) (voi
}
if (postfork_func) postfork_func(postfork_data);
#ifdef SEMI_BROKEN_QUICKLANCH
if (quicklaunch_on)
{
#ifdef SEMI_BROKEN_QUICKLAUNCH
ecore_app_args_set(argc, (const char **)argv);
evas_init();
edje_init();
@ -807,6 +830,7 @@ elm_quicklaunch_fork(int argc, char **argv, char *cwd, void (postfork_func) (voi
ecore_imf_init();
_elm_module_init();
#endif
}
setsid();
if (chdir(cwd) != 0)