Example #1
0
BOOL xf_event_process(freerdp* instance, XEvent* event)
{
	BOOL status = TRUE;
	xfInfo* xfi = ((xfContext*) instance->context)->xfi;
	rdpRail* rail = ((rdpContext*) xfi->context)->rail;
	rdpWindow* window;

	if (xfi->remote_app)
	{
		window = window_list_get_by_extra_id(rail->list, (void*) event->xexpose.window);

		if (window) 
		{
			/* Update "current" window for cursor change orders */
			xfi->window = (xfWindow*) window->extra;

			if (xf_event_suppress_events(xfi, window, event))
				return TRUE;
		}
	}

	if (event->type != MotionNotify)
		DEBUG_X11("%s Event(%d): wnd=0x%04X", X11_EVENT_STRINGS[event->type], event->type, (UINT32) event->xany.window);

	switch (event->type)
	{
		case Expose:
			status = xf_event_Expose(xfi, event, xfi->remote_app);
			break;

		case VisibilityNotify:
			status = xf_event_VisibilityNotify(xfi, event, xfi->remote_app);
			break;

		case MotionNotify:
			status = xf_event_MotionNotify(xfi, event, xfi->remote_app);
			break;

		case ButtonPress:
			status = xf_event_ButtonPress(xfi, event, xfi->remote_app);
			break;

		case ButtonRelease:
			status = xf_event_ButtonRelease(xfi, event, xfi->remote_app);
			break;

		case KeyPress:
			status = xf_event_KeyPress(xfi, event, xfi->remote_app);
			break;

		case KeyRelease:
			status = xf_event_KeyRelease(xfi, event, xfi->remote_app);
			break;

		case FocusIn:
			status = xf_event_FocusIn(xfi, event, xfi->remote_app);
			break;

		case FocusOut:
			status = xf_event_FocusOut(xfi, event, xfi->remote_app);
			break;

		case EnterNotify:
			status = xf_event_EnterNotify(xfi, event, xfi->remote_app);
			break;

		case LeaveNotify:
			status = xf_event_LeaveNotify(xfi, event, xfi->remote_app);
			break;

		case NoExpose:
			break;

		case GraphicsExpose:
			break;

		case ConfigureNotify:
			status = xf_event_ConfigureNotify(xfi, event, xfi->remote_app);
			break;

		case MapNotify:
			status = xf_event_MapNotify(xfi, event, xfi->remote_app);
			break;

		case UnmapNotify:
			status = xf_event_UnmapNotify(xfi, event, xfi->remote_app);
			break;

		case ReparentNotify:
			break;

		case MappingNotify:
			status = xf_event_MappingNotify(xfi, event, xfi->remote_app);
			break;

		case ClientMessage:
			status = xf_event_ClientMessage(xfi, event, xfi->remote_app);
			break;

		case SelectionNotify:
			status = xf_event_SelectionNotify(xfi, event, xfi->remote_app);
			break;

		case SelectionRequest:
			status = xf_event_SelectionRequest(xfi, event, xfi->remote_app);
			break;

		case SelectionClear:
			status = xf_event_SelectionClear(xfi, event, xfi->remote_app);
			break;

		case PropertyNotify:
			status = xf_event_PropertyNotify(xfi, event, xfi->remote_app);
			break;
	}

	xf_input_handle_event(xfi, event);

	XSync(xfi->display, FALSE);

	return status;
}
Example #2
0
BOOL xf_event_process(freerdp* instance, XEvent* event)
{
	BOOL status = TRUE;
	xfAppWindow* appWindow;
	xfContext* xfc = (xfContext*) instance->context;

	if (xfc->remote_app)
	{
		appWindow = xf_AppWindowFromX11Window(xfc, event->xany.window);

		if (appWindow)
		{
			/* Update "current" window for cursor change orders */
			xfc->appWindow = appWindow;

			if (xf_event_suppress_events(xfc, appWindow, event))
				return TRUE;
		}
	}

	xf_event_execute_action_script(xfc, event);

	if (event->type != MotionNotify)
		DEBUG_X11("%s Event(%d): wnd=0x%08lX", X11_EVENT_STRINGS[event->type],
		          event->type, (unsigned long) event->xany.window);

	switch (event->type)
	{
		case Expose:
			status = xf_event_Expose(xfc, event, xfc->remote_app);
			break;

		case VisibilityNotify:
			status = xf_event_VisibilityNotify(xfc, event, xfc->remote_app);
			break;

		case MotionNotify:
			status = xf_event_MotionNotify(xfc, event, xfc->remote_app);
			break;

		case ButtonPress:
			status = xf_event_ButtonPress(xfc, event, xfc->remote_app);
			break;

		case ButtonRelease:
			status = xf_event_ButtonRelease(xfc, event, xfc->remote_app);
			break;

		case KeyPress:
			status = xf_event_KeyPress(xfc, event, xfc->remote_app);
			break;

		case KeyRelease:
			status = xf_event_KeyRelease(xfc, event, xfc->remote_app);
			break;

		case FocusIn:
			status = xf_event_FocusIn(xfc, event, xfc->remote_app);
			break;

		case FocusOut:
			status = xf_event_FocusOut(xfc, event, xfc->remote_app);
			break;

		case EnterNotify:
			status = xf_event_EnterNotify(xfc, event, xfc->remote_app);
			break;

		case LeaveNotify:
			status = xf_event_LeaveNotify(xfc, event, xfc->remote_app);
			break;

		case NoExpose:
			break;

		case GraphicsExpose:
			break;

		case ConfigureNotify:
			status = xf_event_ConfigureNotify(xfc, event, xfc->remote_app);
			break;

		case MapNotify:
			status = xf_event_MapNotify(xfc, event, xfc->remote_app);
			break;

		case UnmapNotify:
			status = xf_event_UnmapNotify(xfc, event, xfc->remote_app);
			break;

		case ReparentNotify:
			break;

		case MappingNotify:
			status = xf_event_MappingNotify(xfc, event, xfc->remote_app);
			break;

		case ClientMessage:
			status = xf_event_ClientMessage(xfc, event, xfc->remote_app);
			break;

		case PropertyNotify:
			status = xf_event_PropertyNotify(xfc, event, xfc->remote_app);
			break;
	}

	if (!xfc->remote_app)
	{
		xf_cliprdr_handle_xevent(xfc, event);
	}

	xf_input_handle_event(xfc, event);
	XSync(xfc->display, FALSE);
	return status;
}
Example #3
0
boolean xf_event_process(freerdp* instance, XEvent* event)
{
	boolean app = False;
	boolean status = True;
	xfInfo* xfi = GET_XFI(instance);

	if (xfi->remote_app == True)
	{
		app = True;
	}
	else
	{
		if (event->xany.window != xfi->window->handle)
			app = True;
	}


	if (event->type != MotionNotify)
		DEBUG_X11("%s Event: wnd=0x%04X", X11_EVENT_STRINGS[event->type], (uint32) event->xany.window);

	switch (event->type)
	{
		case Expose:
			status = xf_event_Expose(xfi, event, app);
			break;

		case VisibilityNotify:
			status = xf_event_VisibilityNotify(xfi, event, app);
			break;

		case MotionNotify:
			status = xf_event_MotionNotify(xfi, event, app);
			break;

		case ButtonPress:
			status = xf_event_ButtonPress(xfi, event, app);
			break;

		case ButtonRelease:
			status = xf_event_ButtonRelease(xfi, event, app);
			break;

		case KeyPress:
			status = xf_event_KeyPress(xfi, event, app);
			break;

		case KeyRelease:
			status = xf_event_KeyRelease(xfi, event, app);
			break;

		case FocusIn:
			status = xf_event_FocusIn(xfi, event, app);
			break;

		case FocusOut:
			status = xf_event_FocusOut(xfi, event, app);
			break;

		case EnterNotify:
			status = xf_event_EnterNotify(xfi, event, app);
			break;

		case LeaveNotify:
			status = xf_event_LeaveNotify(xfi, event, app);
			break;

		case NoExpose:
			break;

		case GraphicsExpose:
			break;

		case ConfigureNotify:
			status = xf_event_ConfigureNotify(xfi, event, app);
			break;

		case MapNotify:
			status = xf_event_MapNotify(xfi, event, app);
			break;

		case ReparentNotify:
			break;

		case MappingNotify:
			status = xf_event_MappingNotify(xfi, event, app);
			break;

		case ClientMessage:
			status = xf_event_ClientMessage(xfi, event, app);
			break;

		default:
			DEBUG_X11("xf_event_process unknown event %d", event->type);
			break;
	}

	return status;
}