Exemplo n.º 1
0
void xf_event_adjust_coordinates(xfContext* xfc, int* x, int* y)
{
	rdpSettings* settings;

	if (!xfc || !xfc->context.settings || !y || !x)
		return;

	settings = xfc->context.settings;

	if (!xfc->remote_app)
	{
#ifdef WITH_XRENDER

		if (xf_picture_transform_required(xfc))
		{
			double xScalingFactor = settings->DesktopWidth / (double)xfc->scaledWidth;
			double yScalingFactor = settings->DesktopHeight / (double)xfc->scaledHeight;
			*x = (int)((*x - xfc->offset_x) * xScalingFactor);
			*y = (int)((*y - xfc->offset_y) * yScalingFactor);
		}

#endif
	}

	CLAMP_COORDINATES(*x, *y);
}
Exemplo n.º 2
0
void xf_draw_screen(xfContext* xfc, int x, int y, int w, int h)
{
	if (w == 0 || h == 0)
	{
		WLog_WARN(TAG, "invalid width and/or height specified: w=%d h=%d", w, h);
		return;
	}

#ifdef WITH_XRENDER
	if (xf_picture_transform_required(xfc)) {
		xf_draw_screen_scaled(xfc, x, y, w, h);
		return;
	}
#endif
	XCopyArea(xfc->display, xfc->primary, xfc->window->handle, xfc->gc, x, y, w, h, x, y);
}
Exemplo n.º 3
0
void xf_event_adjust_coordinates(xfContext* xfc, int* x, int *y)
{
	if (!xfc->remote_app)
	{
#ifdef WITH_XRENDER
		if (xf_picture_transform_required(xfc))
		{
			double xScalingFactor = xfc->width / (double)xfc->scaledWidth;
			double yScalingFactor = xfc->height / (double)xfc->scaledHeight;
			*x = (int)((*x - xfc->offset_x) * xScalingFactor);
			*y = (int)((*y - xfc->offset_y) * yScalingFactor);
		}
#endif
	}
	CLAMP_COORDINATES(*x, *y);
}