Hey there,

I put together an example that reveils unexpected elm behavior here on
my T60 (Intel T2500).

I'm mentioning my cpu, because - according to ecore_thread's docs -
the number of maximum threads is limited to 2n | n = |processors|.
For some reason though the default number of threads equals my # of cpus.

So anybody who has a more recent machine please extend the number of
events emited/threads generated to the number of your maximum threads
- 1 to make elm_fileselector show nothing.


I hope I'm doing something wrong here.

-- 
Leif
#include <Ecore.h>
#include <Elementary.h>

void _blocking1(void *data, Ecore_Thread *th)
{
   ecore_thread_reschedule(th);
}

void create_thread1(void)
{
   ecore_thread_run(_blocking1, NULL, NULL, NULL);
}

Eina_Bool _event_1(void *data, int type, void *event)
{
   create_thread1();
   return ECORE_CALLBACK_RENEW;
}


void _blocking2(void *data, Ecore_Thread *th)
{
   ecore_thread_reschedule(th);
}

void create_thread2(void)
{
   ecore_thread_run(_blocking2, NULL, NULL, NULL);
}

Eina_Bool _event_2(void *data, int type, void *event)
{
   create_thread2();
   return ECORE_CALLBACK_RENEW;
}


void _blocking3(void *data, Ecore_Thread *th)
{
   ecore_thread_reschedule(th);
}

void create_thread3(void)
{
   ecore_thread_run(_blocking3, NULL, NULL, NULL);
}

Eina_Bool _event_3(void *data, int type, void *event)
{
   create_thread3();
   return ECORE_CALLBACK_RENEW;
}

static void /* hook on the sole smart callback */
_file_chosen(void *data, Evas_Object *obj, void *event_info)
{
   const char *file = event_info;
   if (file)
     printf("File chosen: %s\n", file);
   else
     printf("File selection canceled.\n");
}

EAPI_MAIN int elm_main(int argc, char **argv)
{
   Evas_Object *win, *bg, *btn;

   win = elm_win_add(NULL, "layout", ELM_WIN_BASIC);
   elm_win_title_set(win, "Layout");
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
   elm_win_autodel_set(win, EINA_TRUE);

   bg = elm_bg_add(win);
   elm_bg_color_set(bg, 255, 255, 255);
   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   elm_win_resize_object_add(win, bg);
   evas_object_show(bg);
   evas_object_size_hint_min_set(bg, 160, 160);
   evas_object_size_hint_max_set(bg, 640, 640);

   btn = elm_fileselector_button_add(bg);
   elm_object_text_set(btn, "Select a file");
   evas_object_smart_callback_add(btn, "file,chosen", _file_chosen, NULL);
   evas_object_resize(btn, 100, 50);
   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(bg, 0.5, 0.5);
   evas_object_show(btn);

   evas_object_resize(win, 320, 320);
   evas_object_show(win);

   //add event handlers
   ecore_event_handler_add(1, _event_1, NULL);
   ecore_event_handler_add(2, _event_2, NULL);
   ecore_event_handler_add(3, _event_3, NULL);

   //one extra thread: no problem
   ecore_event_add(1, NULL, NULL, NULL);
   //This second event/thread will lead no an empty/buggy fileselector
   ecore_event_add(2, NULL, NULL, NULL);
   //This third event/thread will lead to no UI at all/crashing app.
   ecore_event_add(3, NULL, NULL, NULL);

   elm_run();
   elm_shutdown();

   return 0;
}

ELM_MAIN()
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to