static Window
_ecore_x_window_shadow_tree_at_xy_get(Window base,
                                      int bx,
                                      int by,
                                      int x,
                                      int y,
                                      Ecore_X_Window *skip,
                                      int skip_num)
{
   Shadow *s;

   if (!shadow_base)
     {
        _ecore_x_window_tree_shadow_populate();
        if (!shadow_base)
          return 0;
     }

   s = _ecore_x_window_shadow_tree_find(base);
   if (!s)
     return 0;

   return _ecore_x_window_shadow_tree_at_xy_get_shadow(s,
                                                       bx,
                                                       by,
                                                       x,
                                                       y,
                                                       skip,
                                                       skip_num);
}
/**
 * Retrieves the parent window a given window has. This uses the shadow window
 * tree.
 * @param   root The root window of @p win - if 0, this will be automatically determined with extra processing overhead
 * @param   win The window to get the parent window of
 * @return  The parent window of @p win
 * @ingroup Ecore_X_Window_Geometry_Group
 */
EAPI Ecore_X_Window
ecore_x_window_shadow_parent_get(Ecore_X_Window root EINA_UNUSED,
                                 Ecore_X_Window win)
{
   Shadow *s;
   int i = 0;

   if (!shadow_base)
     {
        _ecore_x_window_tree_shadow_populate();
        if (!shadow_base) return 0;
     }

   for (i = 0; i < shadow_num; i++)
     {
        if (!shadow_base[i]) continue;

        s = _ecore_x_window_shadow_tree_find_shadow(shadow_base[i], win);
        if (s)
          {
             if (!s->parent) return 0;
             return s->parent->win;
          }
     }
   return 0;
}
Example #3
0
/**
 * Retrieves the parent window a given window has. This uses the shadow window
 * tree.
 * @param   root The root window of @p win - if 0, this will be automatically determined with extra processing overhead
 * @param   win The window to get the parent window of
 * @return  The parent window of @p win
 * @ingroup Ecore_X_Window_Geometry_Group
 */
EAPI Ecore_X_Window
ecore_x_window_shadow_parent_get(Ecore_X_Window root __UNUSED__,
                                 Ecore_X_Window win)
{
   Shadow *s;
   int i;

   LOGFN(__FILE__, __LINE__, __FUNCTION__);
   if (!shadow_base)
     {
        _ecore_x_window_tree_shadow_populate();
        if (!shadow_base)
          return 0;
     }

   for (i = 0; i < shadow_num; i++)
     {
        if (!shadow_base[i])
          continue;

        s = _ecore_x_window_shadow_tree_find_shadow(shadow_base[i], win);
        if (s)
          {
             if (!s->parent)
               return 0;

             return s->parent->win;
          }
     }
   return 0;
} /* ecore_x_window_shadow_parent_get */