diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/ecore/src/lib/ecore_evas/ecore_evas_fb.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas_fb.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas_fb.c index 3ee913e..74caada 100644 --- a/libraries/ecore/src/lib/ecore_evas/ecore_evas_fb.c +++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas_fb.c | |||
@@ -2,6 +2,7 @@ | |||
2 | # include <config.h> | 2 | # include <config.h> |
3 | #endif | 3 | #endif |
4 | 4 | ||
5 | #include <stdlib.h> | ||
5 | #include <sys/types.h> | 6 | #include <sys/types.h> |
6 | #include <dirent.h> | 7 | #include <dirent.h> |
7 | 8 | ||
@@ -154,9 +155,9 @@ _ecore_evas_fb_render(Ecore_Evas *ee) | |||
154 | if (ee->visible) | 155 | if (ee->visible) |
155 | { | 156 | { |
156 | Eina_List *updates; | 157 | Eina_List *updates; |
157 | |||
158 | Eina_List *ll; | 158 | Eina_List *ll; |
159 | Ecore_Evas *ee2; | 159 | Ecore_Evas *ee2; |
160 | |||
160 | if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee); | 161 | if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee); |
161 | 162 | ||
162 | EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2) | 163 | EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2) |
@@ -184,31 +185,26 @@ _ecore_evas_fb_render(Ecore_Evas *ee) | |||
184 | static int | 185 | static int |
185 | _ecore_evas_fb_init(Ecore_Evas *ee, int w, int h) | 186 | _ecore_evas_fb_init(Ecore_Evas *ee, int w, int h) |
186 | { | 187 | { |
188 | Eina_File_Direct_Info *info; | ||
189 | Eina_Iterator *ls; | ||
187 | Ecore_Fb_Input_Device *device; | 190 | Ecore_Fb_Input_Device *device; |
188 | Ecore_Fb_Input_Device_Cap caps; | 191 | Ecore_Fb_Input_Device_Cap caps; |
189 | int mouse_handled = 0; | 192 | int mouse_handled = 0; |
190 | 193 | ||
191 | DIR *input_dir; | ||
192 | struct dirent *input_entry; | ||
193 | |||
194 | _ecore_evas_init_count++; | 194 | _ecore_evas_init_count++; |
195 | if (_ecore_evas_init_count > 1) return _ecore_evas_init_count; | 195 | if (_ecore_evas_init_count > 1) return _ecore_evas_init_count; |
196 | 196 | ||
197 | ecore_event_evas_init(); | 197 | ecore_event_evas_init(); |
198 | 198 | ||
199 | /* register all input devices */ | 199 | /* register all input devices */ |
200 | input_dir = opendir("/dev/input/"); | 200 | ls = eina_file_direct_ls("/dev/input/"); |
201 | if (!input_dir) return _ecore_evas_init_count; | ||
202 | 201 | ||
203 | while ((input_entry = readdir(input_dir))) | 202 | EINA_ITERATOR_FOREACH(ls, info) |
204 | { | 203 | { |
205 | char device_path[256]; | 204 | if (strncmp(info->path + info->name_start, "event", 5) != 0) |
206 | |||
207 | if (strncmp(input_entry->d_name, "event", 5) != 0) | ||
208 | continue; | 205 | continue; |
209 | 206 | ||
210 | snprintf(device_path, 256, "/dev/input/%s", input_entry->d_name); | 207 | if (!(device = ecore_fb_input_device_open(info->path))) |
211 | if (!(device = ecore_fb_input_device_open(device_path))) | ||
212 | continue; | 208 | continue; |
213 | ecore_fb_input_device_window_set(device, ee); | 209 | ecore_fb_input_device_window_set(device, ee); |
214 | 210 | ||
@@ -240,7 +236,7 @@ _ecore_evas_fb_init(Ecore_Evas *ee, int w, int h) | |||
240 | ecore_evas_input_devices = eina_list_append(ecore_evas_input_devices, device); | 236 | ecore_evas_input_devices = eina_list_append(ecore_evas_input_devices, device); |
241 | } | 237 | } |
242 | } | 238 | } |
243 | closedir(input_dir); | 239 | eina_iterator_free(ls); |
244 | 240 | ||
245 | if (!mouse_handled) | 241 | if (!mouse_handled) |
246 | { | 242 | { |