reject x11 NotifyVirtual and NotifyInferior mouse in events more accurately
authorMike Blumenkrantz <zmike@osg.samsung.com>
Tue, 18 Aug 2015 21:11:01 +0000 (17:11 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Tue, 18 Aug 2015 21:23:07 +0000 (17:23 -0400)
these events are valid when moving from parent<->child window

fix T2674

src/bin/e_comp_x.c

index 4530bfe..1b4ca1a 100644 (file)
@@ -2178,11 +2178,22 @@ _e_comp_x_mouse_in(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_M
    E_Client *ec;
 
    if (e_comp->comp_type != E_PIXMAP_TYPE_X) return ECORE_CALLBACK_RENEW;
-   if ((ev->mode == ECORE_X_EVENT_MODE_NORMAL) &&
-       ((ev->detail == ECORE_X_EVENT_DETAIL_INFERIOR) || (ev->detail == ECORE_X_EVENT_DETAIL_VIRTUAL)))
-     return ECORE_CALLBACK_PASS_ON;
    ec = _e_comp_x_client_find_by_window(ev->win);
    if (!ec) return ECORE_CALLBACK_RENEW;
+   if (ev->mode == ECORE_X_EVENT_MODE_NORMAL)
+     {
+        if (ev->detail == ECORE_X_EVENT_DETAIL_INFERIOR)
+          {
+             if (ev->win != e_client_util_win_get(ec)) return ECORE_CALLBACK_RENEW;
+             if (ev->event_win != e_client_util_pwin_get(ec)) return ECORE_CALLBACK_RENEW;
+          }
+        if (ev->detail == ECORE_X_EVENT_DETAIL_VIRTUAL)
+          {
+             if (ev->win != e_client_util_pwin_get(ec)) return ECORE_CALLBACK_RENEW;
+             if (ev->event_win != e_client_util_win_get(ec)) return ECORE_CALLBACK_RENEW;
+          }
+        if (!evas_object_visible_get(ec->frame)) return ECORE_CALLBACK_RENEW;
+     }
    if (_e_comp_x_client_data_get(ec)->deleted) return ECORE_CALLBACK_RENEW;
    mouse_client = ec;
    e_client_mouse_in(ec, e_comp_canvas_x_root_adjust(ev->root.x), e_comp_canvas_x_root_adjust(ev->root.y));