e-comp-wl: Release keys on key_up regardless if client has focus
authorChris Michael <cp.michael@samsung.com>
Tue, 30 Jun 2015 19:58:10 +0000 (15:58 -0400)
committerChris Michael <cp.michael@samsung.com>
Tue, 30 Jun 2015 19:58:41 +0000 (15:58 -0400)
Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/bin/e_comp_wl.c

index ef395c2..29eecdb 100644 (file)
@@ -917,6 +917,9 @@ _e_comp_wl_cb_key_up(void *event)
    E_Comp_Wl_Data *cdata;
    Ecore_Event_Key *ev;
    uint32_t serial, *end, *k, keycode;
+   struct wl_client *wc = NULL;
+   struct wl_resource *res;
+   Eina_List *l;
 
    ev = event;
    keycode = (ev->keycode - 8);
@@ -931,25 +934,24 @@ _e_comp_wl_cb_key_up(void *event)
    /* update modifier state */
    e_comp_wl_input_keyboard_state_update(keycode, EINA_FALSE);
 
-   if ((ec = e_client_focused_get()))
+   ec = e_client_focused_get();
+   if ((ec) && (ec->comp_data->surface))
      {
-        if (ec->comp_data->surface)
-          {
-             struct wl_client *wc;
-             struct wl_resource *res;
-             Eina_List *l;
+        wc = wl_resource_get_client(ec->comp_data->surface);
+     }
 
-             if (eina_list_count(cdata->kbd.resources))
+   if (eina_list_count(cdata->kbd.resources))
+     {
+        serial = wl_display_next_serial(cdata->wl.disp);
+        EINA_LIST_FOREACH(cdata->kbd.resources, l, res)
+          {
+             if (wc)
                {
-                  wc = wl_resource_get_client(ec->comp_data->surface);
-                  serial = wl_display_next_serial(cdata->wl.disp);
-                  EINA_LIST_FOREACH(cdata->kbd.resources, l, res)
-                    {
-                       if (wl_resource_get_client(res) != wc) continue;
-                       wl_keyboard_send_key(res, serial, ev->timestamp,
-                                       keycode, WL_KEYBOARD_KEY_STATE_RELEASED);
-                    }
-              }
+                  if (wl_resource_get_client(res) != wc) continue;
+               }
+
+             wl_keyboard_send_key(res, serial, ev->timestamp,
+                                  keycode, WL_KEYBOARD_KEY_STATE_RELEASED);
           }
      }