return NULL;
} /* _ecore_x_window_shadow_tree_find */
+static int
+_inside_rects(Shadow *s, int x, int y, int bx, int by, Ecore_X_Rectangle *rects, int num)
+{
+ int i, inside;
+
+ if (!rects) return 0;
+ inside = 0;
+ for (i = 0; i < num; i++)
+ {
+ if ((x >= s->x + bx + rects[i].x) &&
+ (y >= s->y + by + rects[i].y) &&
+ (x < (int)(s->x + bx + rects[i].width)) &&
+ (y < (int)(s->y + by + rects[i].height)))
+ {
+ inside = 1;
+ break;
+ }
+ }
+ free(rects);
+ return inside;
+}
+
static Window
_ecore_x_window_shadow_tree_at_xy_get_shadow(Shadow *s,
int bx,
wy = s->y + by;
if (!((x >= wx) && (y >= wy) && (x < (wx + s->w)) && (y < (wy + s->h))))
return 0;
+
+ /* FIXME: get shape */
+ {
+ int num;
+ Ecore_X_Rectangle *rects;
+
+ num = 0;
+ rects = ecore_x_window_shape_rectangles_get(s->win, &num);
+ if (!_inside_rects(s, x, y, bx, by, rects, num)) return 0;
+ num = 0;
+ rects = ecore_x_window_shape_input_rectangles_get(s->win, &num);
+ if (!_inside_rects(s, x, y, bx, by, rects, num)) return 0;
+ }
if (s->children)
{
if (num_ret) *num_ret = num;
return rects;
#else
+ // have to return fake shape input rect of size of window
+ Window dw;
+ unsigned int di;
+
if (num_ret) *num_ret = 0;
- return NULL;
- win = 0;
+ rects = malloc(sizeof(Ecore_X_Rectangle));
+ if (!rects) return NULL;
+ if (!XGetGeometry(_ecore_x_disp, win, &dw,
+ &(rects[i].x), &(rects[i].y),
+ &(rects[i].width), &(rects[i].height),
+ &di, &di))
+ {
+ free(rects);
+ return NULL;
+ }
+ if (num_ret) *num_ret = 1;
+ return rects;
#endif
} /* ecore_x_window_shape_input_rectangles_get */