Beispiel #1
0
static BOOL xf_event_Expose(xfContext* xfc, XEvent* event, BOOL app)
{
	int x, y;
	int w, h;
	
	x = event->xexpose.x;
	y = event->xexpose.y;
	w = event->xexpose.width;
	h = event->xexpose.height;

	if (xfc->gfx)
	{
		xf_OutputExpose(xfc, x, y, w, h);
		return TRUE;
	}

	if (!app)
	{
		if ((xfc->settings->ScalingFactor != 1.0) || (xfc->offset_x) || (xfc->offset_y))
		{
			xf_draw_screen_scaled(xfc, x - xfc->offset_x,
					      y - xfc->offset_y, w, h, FALSE);
		}
		else
		{
			XCopyArea(xfc->display, xfc->primary, xfc->window->handle, xfc->gc, x, y, w, h, x, y);
		}
	}
	else
	{
		xfWindow* xfw;
		rdpWindow* window;
		rdpRail* rail = ((rdpContext*) xfc)->rail;
		
		window = window_list_get_by_extra_id(rail->list,
						     (void*) event->xexpose.window);
		
		if (window)
		{
			xfw = (xfWindow*) window->extra;
			xf_UpdateWindowArea(xfc, xfw, x, y, w, h);
		}
	}
	
	return TRUE;
}
Beispiel #2
0
static BOOL xf_event_Expose(xfContext* xfc, XEvent* event, BOOL app)
{
	int x, y;
	int w, h;
	rdpSettings* settings = xfc->context.settings;

	if (!app && (settings->SmartSizing || settings->MultiTouchGestures))
	{
		x = 0;
		y = 0;
		w = settings->DesktopWidth;
		h = settings->DesktopHeight;
	}
	else
	{
		x = event->xexpose.x;
		y = event->xexpose.y;
		w = event->xexpose.width;
		h = event->xexpose.height;
	}

	if (xfc->gfx)
	{
		xf_OutputExpose(xfc, x, y, w, h);
		return TRUE;
	}

	if (!app)
	{
		xf_draw_screen(xfc, x, y, w, h);
	}
	else
	{
		xfAppWindow* appWindow;
		appWindow = xf_AppWindowFromX11Window(xfc, event->xany.window);

		if (appWindow)
		{
			xf_UpdateWindowArea(xfc, appWindow, x, y, w, h);
		}
	}

	return TRUE;
}