int status;
XWindowAttributes attrs;
Window window;
+ int x, y;
+ Window child;
+ Bool coord_translated;
if (s->xid != 0) {
status = XGetWindowAttributes (s->xcontext->disp, s->xid, &attrs);
g_assert (s->xwindow != 0);
s->width = attrs.width;
s->height = attrs.height;
- GST_INFO_OBJECT (s, "Using default window size of %dx%d",
- s->width, s->height);
+
+ coord_translated = XTranslateCoordinates (s->xcontext->disp, s->xwindow,
+ s->xcontext->root, 0, 0, &x, &y, &child);
+ if (coord_translated) {
+ s->x = x;
+ s->y = y;
+ } else {
+ s->x = 0;
+ s->y = 0;
+ }
+
+ GST_INFO_OBJECT (s, "Using default window size of %dx%d at location %d,%d",
+ s->width, s->height, s->x, s->y);
}
use_root_window:
if (ximagesrc->cursor_image) {
gint x, y, width, height;
- x = ximagesrc->cursor_image->x - ximagesrc->cursor_image->xhot;
- y = ximagesrc->cursor_image->y - ximagesrc->cursor_image->yhot;
+ x = ximagesrc->cursor_image->x - ximagesrc->cursor_image->xhot -
+ ximagesrc->x;
+ y = ximagesrc->cursor_image->y - ximagesrc->cursor_image->yhot -
+ ximagesrc->y;
width = ximagesrc->cursor_image->width;
height = ximagesrc->cursor_image->height;
int startx, starty, iwidth, iheight;
gboolean cursor_in_image = TRUE;
- cx = ximagesrc->cursor_image->x - ximagesrc->cursor_image->xhot;
+ cx = ximagesrc->cursor_image->x - ximagesrc->cursor_image->xhot -
+ ximagesrc->x;
if (cx < 0)
cx = 0;
- cy = ximagesrc->cursor_image->y - ximagesrc->cursor_image->yhot;
+ cy = ximagesrc->cursor_image->y - ximagesrc->cursor_image->yhot -
+ ximagesrc->y;
if (cy < 0)
cy = 0;
count = ximagesrc->cursor_image->width * ximagesrc->cursor_image->height;