* Fix range of issues with ecore_fb and even ecore_evas where
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 29 Mar 2012 05:57:41 +0000 (05:57 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 29 Mar 2012 05:57:41 +0000 (05:57 +0000)
it didn't work right on the fb. (timestamps wrong, focus
handling etc.). This makes it work fully again.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@69715 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

ChangeLog
src/lib/ecore_evas/ecore_evas_fb.c
src/lib/ecore_fb/ecore_fb_kbd.c
src/lib/ecore_fb/ecore_fb_li.c
src/lib/ecore_fb/ecore_fb_ps2.c
src/lib/ecore_fb/ecore_fb_ts.c

index 9365222..05fb84e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
         * scim-immodule: fix bug candidate window covers the preedit string when preedit string appears in 2 line.
 
+2012-03-29 Carsten Haitzler (The Rasterman)
+
+        * Fix range of issues with ecore_fb and even ecore_evas where
+        it didn't work right on the fb. (timestamps wrong, focus
+        handling etc.). This makes it work fully again.
+
index 11e2ffd..b5c18cb 100644 (file)
@@ -378,6 +378,17 @@ _ecore_evas_show(Ecore_Evas *ee)
 }
 
 static void
+_ecore_evas_hide(Ecore_Evas *ee)
+{
+   if (ee->prop.focused)
+     {
+        ee->prop.focused = 0;
+        evas_focus_out(ee->evas);
+        if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
+     }
+}
+
+static void
 _ecore_evas_object_cursor_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
 {
    Ecore_Evas *ee;
@@ -516,7 +527,7 @@ static Ecore_Evas_Engine_Func _ecore_fb_engine_func =
      _ecore_evas_rotation_set,
      NULL,
      _ecore_evas_show,
-     NULL,
+     _ecore_evas_hide,
      NULL,
      NULL,
      NULL,
@@ -600,7 +611,7 @@ ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h)
    ee->prop.max.w = 0;
    ee->prop.max.h = 0;
    ee->prop.layer = 0;
-   ee->prop.focused = 1;
+   ee->prop.focused = 0;
    ee->prop.borderless = 1;
    ee->prop.override = 1;
    ee->prop.maximized = 1;
index 25d7aef..bf81e66 100644 (file)
@@ -190,6 +190,11 @@ _ecore_fb_kbd_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __U
                   free(e);
                   goto retry;
                }
+             e->window = 1;
+             e->event_window = e->window;
+             e->root_window = e->window; 
+             e->same_screen = 1;
+             e->timestamp = ecore_loop_time_get() * 1000.0;
              ecore_event_add(ECORE_FB_EVENT_KEY_DOWN, e, _ecore_fb_event_free_key_down, NULL);
              if (!strcmp(e->keyname, "Control_L"))
                 _ecore_fb_ctrl++;
@@ -248,6 +253,11 @@ _ecore_fb_kbd_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __U
                   free(e);
                   goto retry;
                }
+             e->window = 1;
+             e->event_window = e->window;
+             e->root_window = e->window; 
+             e->same_screen = 1;
+             e->timestamp = ecore_loop_time_get() * 1000.0;
              ecore_event_add(ECORE_FB_EVENT_KEY_UP, e, _ecore_fb_event_free_key_up, NULL);
              if (!strcmp(e->keyname, "Control_L"))
                 _ecore_fb_ctrl--;
index 3850792..6a29d63 100644 (file)
@@ -120,7 +120,7 @@ _ecore_fb_li_device_event_key(Ecore_Fb_Input_Device *dev, struct input_event *ie
         if (dev->keyboard.alt) e->modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
         if (dev->keyboard.lock) e->modifiers |= ECORE_EVENT_LOCK_CAPS;
 
-        e->timestamp = ecore_time_get();
+        e->timestamp = ecore_loop_time_get() * 1000.0;
         e->window = (Ecore_Window)dev->window;
         e->event_window = (Ecore_Window)dev->window;
         e->root_window = (Ecore_Window)dev->window;
@@ -136,7 +136,7 @@ _ecore_fb_li_device_event_key(Ecore_Fb_Input_Device *dev, struct input_event *ie
      {
         int button;
         Ecore_Event_Mouse_Button *e;
-        double current = ecore_time_get();
+        double current = ecore_loop_time_get();
 
         button = ((iev->code & 0x00F) + 1);
         if (iev->value)
@@ -168,7 +168,7 @@ _ecore_fb_li_device_event_key(Ecore_Fb_Input_Device *dev, struct input_event *ie
         if (!e)
           return;
 
-        e->timestamp = current;
+        e->timestamp = current * 1000.0;
         e->window = (Ecore_Window)dev->window;
         e->event_window = (Ecore_Window)dev->window;
         e->root_window = (Ecore_Window)dev->window;
@@ -247,7 +247,7 @@ _ecore_fb_li_device_event_rel(Ecore_Fb_Input_Device *dev, struct input_event *ie
              e->root.x = e->x;
              e->root.y = e->y;
 
-             e->timestamp = ecore_time_get();
+             e->timestamp = ecore_loop_time_get() * 1000.0;
 
              ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
 
@@ -280,7 +280,7 @@ _ecore_fb_li_device_event_rel(Ecore_Fb_Input_Device *dev, struct input_event *ie
              if (dev->keyboard.alt) e->modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
              if (dev->keyboard.lock) e->modifiers |= ECORE_EVENT_LOCK_CAPS;
 
-             e->timestamp = ecore_time_get();
+             e->timestamp = ecore_loop_time_get() * 1000.0;
 
              ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, e, NULL, NULL);
 
@@ -356,7 +356,7 @@ _ecore_fb_li_device_event_syn(Ecore_Fb_Input_Device *dev, struct input_event *ie
         ev->y = dev->mouse.y;
         ev->root.x = ev->x;
         ev->root.y = ev->y;
-        ev->timestamp = ecore_time_get();
+        ev->timestamp = ecore_loop_time_get() * 1000.0;
      }
    else if (dev->mouse.event == ECORE_EVENT_MOUSE_BUTTON_DOWN)
      {
@@ -367,7 +367,7 @@ _ecore_fb_li_device_event_syn(Ecore_Fb_Input_Device *dev, struct input_event *ie
         ev->root.x = ev->x;
         ev->root.y = ev->y;
         ev->buttons = 1;
-        ev->timestamp = ecore_time_get();
+        ev->timestamp = ecore_loop_time_get() * 1000.0;
         ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL);
      }
    else if (dev->mouse.event == ECORE_EVENT_MOUSE_BUTTON_UP)
@@ -379,7 +379,7 @@ _ecore_fb_li_device_event_syn(Ecore_Fb_Input_Device *dev, struct input_event *ie
         ev->root.x = ev->x;
         ev->root.y = ev->y;
         ev->buttons = 1;
-        ev->timestamp = ecore_time_get();
+        ev->timestamp = ecore_loop_time_get() * 1000.0;
         ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
      }
 }
index c43a71a..fdff3a8 100644 (file)
@@ -64,7 +64,7 @@ _ecore_fb_ps2_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __U
         if (v < 0) return EINA_TRUE;
         _ecore_fb_ps2_event_byte_count += v;
         if (v < num) return EINA_TRUE;
-        t = ecore_time_get();
+        t = ecore_loop_time_get();
         _ecore_fb_ps2_event_byte_count = 0;
         if (_ecore_fb_ps2_event.button & 0x10)
            x = prev_x + (0xffffff00 | _ecore_fb_ps2_event.x);
@@ -84,13 +84,20 @@ _ecore_fb_ps2_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __U
         if (1)
           {
              /* MOVE: mouse is down and was */
-             Ecore_Fb_Event_Mouse_Move *e;
+             Ecore_Event_Mouse_Move *e;
 
              e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Move));
              if (!e) goto retry;
              e->x = x;
              e->y = y;
-             ecore_event_add(ECORE_FB_EVENT_MOUSE_MOVE, e, NULL, NULL);
+             e->root.x = e->x;
+             e->root.y = e->y;
+             e->window = 1;
+             e->event_window = e->window;
+             e->root_window = e->window;
+             e->same_screen = 1;
+             e->timestamp = ecore_loop_time_get() * 1000.0;
+             ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
           }
         for (i = 1; i <= 3; i++)
           {
@@ -100,13 +107,19 @@ _ecore_fb_ps2_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __U
              if (((button & mask)) && (!(prev_button & mask)))
                {
                   /* DOWN: mouse is down, but was not now */
-                  Ecore_Fb_Event_Mouse_Button_Down *e;
+                  Ecore_Event_Mouse_Button *e;
 
-                  e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Button_Down));
+                  e = calloc(1, sizeof(Ecore_Event_Mouse_Button));
                   if (!e) goto retry;
                   e->x = x;
                   e->y = y;
+                  e->root.x = e->x;
+                  e->root.y = e->y;
                   e->button = i;
+                  e->window = 1;
+                  e->event_window = e->window;
+                  e->root_window = e->window;
+                  e->same_screen = 1;
                   if ((t - last_time) <= _ecore_fb_double_click_time)
                     {
                        e->double_click = 1;
@@ -126,23 +139,31 @@ _ecore_fb_ps2_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __U
                     {
                        did_triple = 0;
                     }
-                  ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL);
+                  e->timestamp = ecore_loop_time_get() * 1000.0;
+                  ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL);
                }
              else if ((!(button & mask)) && ((prev_button & mask)))
                {
                   /* UP: mouse was down, but is not now */
-                  Ecore_Fb_Event_Mouse_Button_Up *e;
+                  Ecore_Event_Mouse_Button *e;
 
-                  e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Button_Up));
+                  e = calloc(1, sizeof(Ecore_Event_Mouse_Button));
                   if (!e) goto retry;
                   e->x = x;
                   e->y = y;
+                  e->root.x = e->x;
+                  e->root.y = e->y;
                   e->button = i;
+                  e->window = 1;
+                  e->event_window = e->window;
+                  e->root_window = e->window;
+                  e->same_screen = 1;
                   if (did_double)
                      e->double_click = 1;
                   if (did_triple)
                      e->triple_click = 1;
-                  ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL);
+                  e->timestamp = ecore_loop_time_get() * 1000.0;
+                  ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL);
                }
           }
         if (did_triple)
index 395e768..a33bb36 100644 (file)
@@ -238,7 +238,6 @@ _ecore_fb_ts_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UN
         y = _ecore_fb_tslib_event.y;
         pressure = _ecore_fb_tslib_event.pressure;
         v = 1; /* loop, there might be more samples */
-        t = ecore_time_get();
 #else
         ptr = (char *)&(_ecore_fb_ts_event);
         ptr += _ecore_fb_ts_event_byte_count;
@@ -260,6 +259,7 @@ _ecore_fb_ts_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UN
           }
         pressure = _ecore_fb_ts_event.pressure;
 #endif
+        t = ecore_loop_time_get();
         /* add event to queue */
         /* always add a move event */
         if ((pressure) || (prev_pressure))
@@ -271,12 +271,13 @@ _ecore_fb_ts_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UN
              if (!e) goto retry;
              e->x = x;
              e->y = y;
-             e->root.x = x;
-             e->root.y = y;
-             e->window = (Ecore_Window)_ecore_fb_ts_event_window;
+             e->root.x = e->x;
+             e->root.y = e->y;
+             e->window = 1;
              e->event_window = e->window;
              e->root_window = e->window;
              e->same_screen = 1;
+             e->timestamp = ecore_loop_time_get() * 1000.0;
              ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
           }
         if ((pressure) && (!prev_pressure))
@@ -288,6 +289,8 @@ _ecore_fb_ts_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UN
              if (!e) goto retry;
              e->x = x;
              e->y = y;
+             e->root.x = e->x;
+             e->root.y = e->y;
              e->buttons = 1;
              if ((t - last_time) <= _ecore_fb_double_click_time)
                {
@@ -308,10 +311,11 @@ _ecore_fb_ts_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UN
                {
                   did_triple = 0;
                }
-             e->window = (Ecore_Window)_ecore_fb_ts_event_window;
+             e->window = 1;
              e->event_window = e->window;
              e->root_window = e->window;
              e->same_screen = 1;
+             e->timestamp = ecore_loop_time_get() * 1000.0;
              ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL);
           }
         else if ((!pressure) && (prev_pressure))
@@ -323,15 +327,18 @@ _ecore_fb_ts_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UN
              if (!e) goto retry;
              e->x = prev_x;
              e->y = prev_y;
+             e->root.x = e->x;
+             e->root.y = e->y;
              e->buttons = 1;
              if (did_double)
                 e->double_click = 1;
              if (did_triple)
                 e->triple_click = 1;
-             e->window = (Ecore_Window)_ecore_fb_ts_event_window;
+             e->window = 1;
              e->event_window = e->window;
              e->root_window = e->window;
              e->same_screen = 1;
+             e->timestamp = ecore_loop_time_get() * 1000.0;
              ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL);
           }
         if (did_triple)