title: How can I add touch to a watch face (EFL)
body: <p>
  I am trying to add touch events to my watch face that I am developing with the EFL libraries. But the touch layer is either not working or, when it is, it is fully covering my watch face, although it should be transparent.</p>
  
  <p>My code that creates the watch window is:</p>
  
  <pre class="lang-c prettyprint-override"><code>Evas_Object *win = NULL;
  int ret = EINA_FALSE;
  
  /*
   * Get watch window object
   */
  ret = watch_app_get_elm_win(&amp;win);
  if (ret != APP_ERROR_NONE) {
      dlog_print(DLOG_ERROR, LOG_TAG, "failed to get watch window. err = %d", ret);
      return NULL;
  }
  evas_object_resize(win, width, height);
  
  /* &lt;Variant A or B here&gt; */
  
  evas_object_show(win);
  </code></pre>
  
  <p>Then I try to create a transparent gesture layer and touch callbacks (like described on <a href="https://docs.tizen.org/application/native/guides/ui/efl/touch-gesture" rel="nofollow noreferrer">https://docs.tizen.org/application/native/guides/ui/efl/touch-gesture</a>). I have tried two variants.</p>
  
  <p>Variant A - I use the same window that I created for the watch (win). No errors, but it doesn't work, no touch events:</p>
  
  <pre class="lang-c prettyprint-override"><code>/* Variant A */
  /* Gesture layer transparent object */
  Evas_Object *r;
  /* Gesture layer object */
  Evas_Object *g;
  
  win = elm_win_util_standard_add("gesture_layer", "Gesture Layer");
  elm_win_autodel_set(win, EINA_TRUE);
  
  /* Gesture layer transparent object */  
  r = evas_object_rectangle_add(evas_object_evas_get(win));
  evas_object_move(r, 0, 0);
  evas_object_color_set(r, 0, 0, 255, 128);
  elm_win_resize_object_add(win, r);
  
  /* Gesture layer object */
  g = elm_gesture_layer_add(win);
  elm_gesture_layer_attach(g, r);
  evas_object_show(r);
  
  /* Set callbacks */
  elm_gesture_layer_cb_set(g, ELM_GESTURE_N_TAPS, ELM_GESTURE_STATE_START, n_finger_tap_start, NULL);
  </code></pre>
  
  <p>Variant B - I use a separate object winTouch for the touch layer. It works, but the layer appears fully opaque and the watch face cannot be seen:</p>
  
  <pre class="lang-c prettyprint-override"><code>/* Variant B */    
  Evas_Object *winTouch;
  
  /* Gesture layer transparent object */
  Evas_Object *r;
  /* Gesture layer object */
  Evas_Object *g;
  
  winTouch = elm_win_util_standard_add("gesture_layer", "Gesture Layer");
  elm_win_autodel_set(winTouch, EINA_TRUE);
  
  /* Gesture layer transparent object */
  r = evas_object_rectangle_add(evas_object_evas_get(winTouch));
  evas_object_move(r, 0, 0);
  evas_object_color_set(r, 0, 0, 255, 0);
  elm_win_resize_object_add(winTouch, r);
  
  /* Gesture layer object */
  g = elm_gesture_layer_add(winTouch);
  elm_gesture_layer_attach(g, r);
  evas_object_show(r);
  evas_object_show(winTouch); // &lt;--- Without this line, Variant B behaves like Variant A
  
  /* Set callbacks */
  elm_gesture_layer_cb_set(g, ELM_GESTURE_N_TAPS, ELM_GESTURE_STATE_START, n_finger_tap_start, NULL);
  // and other callbacks
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>My project is based on the SDK sample "Chronograph Watch". There are actually 4 different Evas_Object's:</p>
  
  <ol>
  <li>evas_object_resize(win, width, height);  </li>
  <li>evas_object_resize(bg, width, height);  </li>
  <li>evas_object_resize(chronograph_layout, DIAM_SCREEN, DIAM_SCREEN);  </li>
  <li>evas_object_resize(parts, size_w, size_h);  </li>
  </ol>
  
  <p>Where should I add the gesture layer? When I add it on 1, Variant A does nothing, Variant B works but covers the watch face. If I do it on one of the others, both Variants work but cover the watch face. I don't understand why, since I am specifying a transparent color.</p>
  
  <p>EDIT: One new thought: could it be that the touch gesture layer does only work on apps, not on watch faces? </p>