[Slideshow] Applying Open source patch r72492 to fix Switching in slideshow with...
[framework/uifw/elementary.git] / src / lib / elm_slideshow.c
index 52ef7c1..68549a4 100644 (file)
@@ -70,13 +70,15 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty
    if (!wd) return EINA_FALSE;
    if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
    if (elm_widget_disabled_get(obj)) return EINA_FALSE;
-   if ((!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left")))
+   if ((!strcmp(ev->keyname, "Left")) ||
+       ((!strcmp(ev->keyname, "KP_Left")) && (!ev->string)))
      {
         elm_slideshow_previous(obj);
         ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
         return EINA_TRUE;
      }
-   if ((!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right")))
+   if ((!strcmp(ev->keyname, "Right")) ||
+       ((!strcmp(ev->keyname, "KP_Right")) && (!ev->string)))
      {
         elm_slideshow_next(obj);
         ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
@@ -500,7 +502,11 @@ elm_slideshow_item_show(Elm_Object_Item *it)
      wd->timer = ecore_timer_add(wd->timeout, _timer_cb, WIDGET(item));
    _item_realize(next);
    edje_object_part_swallow(wd->slideshow, "elm.swallow.2", VIEW(next));
-   snprintf(buf, sizeof(buf), "%s,next", wd->transition);
+
+   if (!wd->transition)
+     sprintf(buf, "none,next");
+   else
+     snprintf(buf, sizeof(buf), "%s,next", wd->transition);
    edje_object_signal_emit(wd->slideshow, buf, "slideshow");
    wd->previous = wd->current;
    wd->current = next;
@@ -533,7 +539,10 @@ elm_slideshow_next(Evas_Object *obj)
 
    edje_object_part_swallow(wd->slideshow, "elm.swallow.2", VIEW(next));
 
-   snprintf(buf, sizeof(buf), "%s,next", wd->transition);
+   if (!wd->transition)
+     sprintf(buf, "none,next");
+   else
+     snprintf(buf, sizeof(buf), "%s,next", wd->transition);
    edje_object_signal_emit(wd->slideshow, buf, "slideshow");
 
    wd->previous = wd->current;
@@ -567,7 +576,10 @@ elm_slideshow_previous(Evas_Object *obj)
 
    edje_object_part_swallow(wd->slideshow, "elm.swallow.2", VIEW(prev));
 
-   snprintf(buf, 1024, "%s,previous", wd->transition);
+   if (!wd->transition)
+     sprintf(buf, "none,previous");
+   else
+     snprintf(buf, sizeof(buf), "%s,previous", wd->transition);
    edje_object_signal_emit(wd->slideshow, buf, "slideshow");
 
    wd->previous = wd->current;