work around edbus issues by forcing the mainloop to run at least one

cycle with some dummy things... in ipc launch mode.

also make selection jump to end if a newline is there - as disussed on
ml.



SVN revision: 81775
This commit is contained in:
Carsten Haitzler 2012-12-28 02:28:39 +00:00
parent e401e87660
commit b5aff77833
2 changed files with 66 additions and 3 deletions

View File

@ -822,6 +822,26 @@ main_ipc_new(Ipc_Instance *inst)
(ecore_evas_ecore_evas_get(evas_object_evas_get(wn->win)), 1);
}
static void
_dummy_exit3(void *data __UNUSED__)
{
elm_exit();
}
static Eina_Bool
_dummy_exit2(void *data __UNUSED__)
{
ecore_job_add(_dummy_exit3, NULL);
return EINA_FALSE;
}
static Eina_Bool
_dummy_exit(void *data __UNUSED__)
{
ecore_idler_add(_dummy_exit2, NULL);
return EINA_FALSE;
}
static const char *emotion_choices[] = {
"auto", "gstreamer", "xine", "generic",
NULL
@ -1223,7 +1243,12 @@ elm_main(int argc, char **argv)
inst.maximized = maximized;
inst.hold = hold;
inst.nowm = nowm;
if (ipc_instance_add(&inst)) goto end;
if (ipc_instance_add(&inst))
{
ecore_timer_add(0.1, _dummy_exit, NULL);
elm_run();
goto end;
}
}
if ((!single) && (config->multi_instance))
{
@ -1291,7 +1316,7 @@ elm_main(int argc, char **argv)
// efreet/edbus... you are being bad! :( disable shutdown for now
// to avoid segs.
// elm_shutdown();
elm_shutdown();
return retval;
}
ELM_MAIN()

View File

@ -1617,6 +1617,43 @@ _selection_dbl_fix(Evas_Object *obj)
}
#endif
static void
_selection_newline_extend_fix(Evas_Object *obj)
{
Termio *sd;
sd = evas_object_smart_data_get(obj);
if ((!sd->top_left) && (sd->cur.sel2.y >= sd->cur.sel1.y))
{
if (((sd->cur.sel1.y == sd->cur.sel2.y) &&
(sd->cur.sel1.x <= sd->cur.sel2.x)) ||
(sd->cur.sel1.y < sd->cur.sel2.y))
{
char *lastline;
int x1, y1, x2, y2;
if (sd->cur.sel1.y == sd->cur.sel2.y) x1 = sd->cur.sel1.x;
else x1 = 0;
x2 = sd->cur.sel2.x;
y1 = y2 = sd->cur.sel2.y;
lastline = termio_selection_get(obj, x1, y1, x2, y2);
if (lastline)
{
int len = strlen(lastline);
if ((len > 0) && (lastline[len - 1] == '\n'))
{
sd->cur.sel2.x = sd->grid.w - 1;
#if defined(SUPPORT_DBLWIDTH)
_selection_dbl_fix(obj);
#endif
}
free(lastline);
}
}
}
}
static void
_smart_cb_mouse_move_job(void *data)
{
@ -1794,12 +1831,12 @@ _smart_cb_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
#if defined(SUPPORT_DBLWIDTH)
_selection_dbl_fix(data);
#endif
_selection_newline_extend_fix(data);
_smart_update_queue(data, sd);
_take_selection(data, ELM_SEL_TYPE_PRIMARY);
}
}
}
static void
_smart_cb_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event)
{
@ -1836,6 +1873,7 @@ _smart_cb_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__
#if defined(SUPPORT_DBLWIDTH)
_selection_dbl_fix(data);
#endif
_selection_newline_extend_fix(data);
_smart_update_queue(data, sd);
}
if (mc_change)