summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-08-17 03:21:06 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-08-17 03:21:06 +0000
commit0576da08a1af9926cf3d6aac3b61ccbed0ec9abc (patch)
treed616d3b8af6b409b0883ae277f77cb197ad4ec5a /src
parentaca951e7c35ac6560507bc9e87a5853c27a70375 (diff)
delay focusing on cmdbox entry a bit to make it reliable.
SVN revision: 75340
Diffstat (limited to 'src')
-rw-r--r--src/bin/main.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index 40ebd48..f5dcdea 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -21,6 +21,7 @@ static Ecore_Timer *flush_timer = NULL;
21static Eina_Bool focused = EINA_FALSE; 21static Eina_Bool focused = EINA_FALSE;
22static Eina_Bool hold = EINA_FALSE; 22static Eina_Bool hold = EINA_FALSE;
23static Eina_Bool cmdbox_up = EINA_FALSE; 23static Eina_Bool cmdbox_up = EINA_FALSE;
24static Ecore_Timer *_cmdbox_focus_timer = NULL;
24 25
25static void 26static void
26_cb_del(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__) 27_cb_del(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
@@ -149,6 +150,14 @@ _cb_popup(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUS
149 edje_object_signal_emit(bg, "popmedia,movie", "terminology"); 150 edje_object_signal_emit(bg, "popmedia,movie", "terminology");
150} 151}
151 152
153static Eina_Bool
154_cb_cmd_focus(void *data)
155{
156 _cmdbox_focus_timer = NULL;
157 elm_object_focus_set(data, EINA_TRUE);
158 return EINA_FALSE;
159}
160
152static void 161static void
153_cb_cmdbox(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__) 162_cb_cmdbox(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
154{ 163{
@@ -157,7 +166,8 @@ _cb_cmdbox(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNU
157 edje_object_signal_emit(bg, "cmdbox,show", "terminology"); 166 edje_object_signal_emit(bg, "cmdbox,show", "terminology");
158 elm_entry_entry_set(cmdbox, ""); 167 elm_entry_entry_set(cmdbox, "");
159 evas_object_show(cmdbox); 168 evas_object_show(cmdbox);
160 elm_object_focus_set(cmdbox, EINA_TRUE); 169 if (_cmdbox_focus_timer) ecore_timer_del(_cmdbox_focus_timer);
170 _cmdbox_focus_timer = ecore_timer_add(0.1, _cb_cmd_focus, cmdbox);
161} 171}
162 172
163static void 173static void
@@ -178,6 +188,11 @@ _cb_cmd_activated(void *data __UNUSED__, Evas_Object *obj, void *event __UNUSED_
178 free(cmd); 188 free(cmd);
179 } 189 }
180 } 190 }
191 if (_cmdbox_focus_timer)
192 {
193 ecore_timer_del(_cmdbox_focus_timer);
194 _cmdbox_focus_timer = NULL;
195 }
181 cmdbox_up = EINA_FALSE; 196 cmdbox_up = EINA_FALSE;
182} 197}
183 198
@@ -187,6 +202,11 @@ _cb_cmd_aborted(void *data __UNUSED__, Evas_Object *obj, void *event __UNUSED__)
187 elm_object_focus_set(obj, EINA_FALSE); 202 elm_object_focus_set(obj, EINA_FALSE);
188 edje_object_signal_emit(bg, "cmdbox,hide", "terminology"); 203 edje_object_signal_emit(bg, "cmdbox,hide", "terminology");
189 elm_object_focus_set(term, EINA_TRUE); 204 elm_object_focus_set(term, EINA_TRUE);
205 if (_cmdbox_focus_timer)
206 {
207 ecore_timer_del(_cmdbox_focus_timer);
208 _cmdbox_focus_timer = NULL;
209 }
190 cmdbox_up = EINA_FALSE; 210 cmdbox_up = EINA_FALSE;
191} 211}
192 212