Ejemplo n.º 1
0
static BOOL xf_event_FocusIn(xfContext* xfc, XEvent* event, BOOL app)
{
	if (event->xfocus.mode == NotifyGrab)
		return TRUE;

	xfc->focused = TRUE;

	if (xfc->mouse_active && !app)
		XGrabKeyboard(xfc->display, xfc->window->handle, TRUE, GrabModeAsync,
		              GrabModeAsync, CurrentTime);

	if (app)
	{
		xfAppWindow* appWindow;
		xf_rail_send_activate(xfc, event->xany.window, TRUE);
		appWindow = xf_AppWindowFromX11Window(xfc, event->xany.window);

		/* Update the server with any window changes that occurred while the window was not focused. */
		if (appWindow)
		{
			xf_rail_adjust_position(xfc, appWindow);
		}
	}

	xf_keyboard_focus_in(xfc);
	return TRUE;
}
Ejemplo n.º 2
0
static BOOL xf_event_FocusIn(xfInfo* xfi, XEvent* event, BOOL app)
{
	if (event->xfocus.mode == NotifyGrab)
		return TRUE;

	xfi->focused = TRUE;

	if (xfi->mouse_active && (!app))
		XGrabKeyboard(xfi->display, xfi->window->handle, TRUE, GrabModeAsync, GrabModeAsync, CurrentTime);

	if (app)
	{
	       xf_rail_send_activate(xfi, event->xany.window, TRUE);
		
       	       rdpWindow* window;
               rdpRail* rail = ((rdpContext*) xfi->context)->rail;
               
               window = window_list_get_by_extra_id(rail->list, (void*) event->xany.window);
       
               /* Update the server with any window changes that occured while the window was not focused. */
               if (window != NULL)
                       xf_rail_adjust_position(xfi, window);
	}

	xf_kbd_focus_in(xfi);

	if (!app)
		xf_cliprdr_check_owner(xfi);

	return TRUE;
}
Ejemplo n.º 3
0
boolean xf_event_ConfigureNotify(xfInfo* xfi, XEvent* event, boolean app)
{
        rdpWindow* window;
        rdpRail* rail = ((rdpContext*) xfi->context)->rail;

        window = window_list_get_by_extra_id(rail->list, (void*) event->xconfigure.window);

        if (window != NULL)
        {
                xfWindow* xfw;
                Window childWindow;
                xfw = (xfWindow*) window->extra;

                /*
                 * ConfigureNotify coordinates are expressed relative to the window parent.
                 * Translate these to root window coordinates.
                 */

                XTranslateCoordinates(xfi->display, xfw->handle, 
			RootWindowOfScreen(xfi->screen),
                        0, 0, &xfw->left, &xfw->top, &childWindow);

                xfw->width = event->xconfigure.width;
                xfw->height = event->xconfigure.height;
                xfw->right = xfw->left + xfw->width - 1;
                xfw->bottom = xfw->top + xfw->height - 1;

		DEBUG_X11_LMS("window=0x%X rc={l=%d t=%d r=%d b=%d} w=%u h=%u send_event=%d",
			(uint32) xfw->handle, xfw->left, xfw->top, xfw->right, xfw->bottom,
			xfw->width, xfw->height, event->xconfigure.send_event);

		if (app && ! event->xconfigure.send_event)
			xf_rail_adjust_position(xfi, window);
        }

        return True;
}
Ejemplo n.º 4
0
static BOOL xf_event_ConfigureNotify(xfContext* xfc, XEvent* event, BOOL app)
{
	Window childWindow;
	xfAppWindow* appWindow;
	rdpSettings* settings = xfc->context.settings;

	if (!app)
	{
		if (xfc->window->left != event->xconfigure.x)
			xfc->window->left = event->xconfigure.x;

		if (xfc->window->top != event->xconfigure.y)
			xfc->window->top = event->xconfigure.y;

		if (xfc->window->width != event->xconfigure.width ||
		    xfc->window->height != event->xconfigure.height)
		{
			xfc->window->width = event->xconfigure.width;
			xfc->window->height = event->xconfigure.height;
#ifdef WITH_XRENDER
			xfc->offset_x = 0;
			xfc->offset_y = 0;

			if (xfc->context.settings->SmartSizing
			    || xfc->context.settings->MultiTouchGestures)
			{
				xfc->scaledWidth = xfc->window->width;
				xfc->scaledHeight = xfc->window->height;
				xf_draw_screen(xfc, 0, 0, settings->DesktopWidth, settings->DesktopHeight);
			}
			else
			{
				xfc->scaledWidth = settings->DesktopWidth;
				xfc->scaledHeight = settings->DesktopHeight;
			}

#endif
		}

		return TRUE;
	}

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

	if (appWindow)
	{
		/*
		 * ConfigureNotify coordinates are expressed relative to the window parent.
		 * Translate these to root window coordinates.
		 */
		XTranslateCoordinates(xfc->display, appWindow->handle,
		                      RootWindowOfScreen(xfc->screen),
		                      0, 0, &appWindow->x, &appWindow->y, &childWindow);
		appWindow->width = event->xconfigure.width;
		appWindow->height = event->xconfigure.height;

		/*
		 * Additional checks for not in a local move and not ignoring configure to send
		 * position update to server, also should the window not be focused then do not
		 * send to server yet (i.e. resizing using window decoration).
		 * The server will be updated when the window gets refocused.
		 */
		if (appWindow->decorations)
		{
			/* moving resizing using window decoration */
			xf_rail_adjust_position(xfc, appWindow);
		}
		else
		{
			if ((!event->xconfigure.send_event
			     || appWindow->local_move.state == LMS_NOT_ACTIVE)
			    && !appWindow->rail_ignore_configure && xfc->focused)
				xf_rail_adjust_position(xfc, appWindow);
		}
	}

	return TRUE;
}
Ejemplo n.º 5
0
static BOOL xf_event_ConfigureNotify(xfInfo* xfi, XEvent* event, BOOL app)
{
        rdpWindow* window;
        rdpRail* rail = ((rdpContext*) xfi->context)->rail;

	if (xfi->width != event->xconfigure.width)
	{
		xfi->scale = (double) event->xconfigure.width / (double) xfi->originalWidth;
		xfi->currentWidth = event->xconfigure.width;
		xfi->currentHeight = event->xconfigure.width;

		xf_draw_screen_scaled(xfi);
	}

        window = window_list_get_by_extra_id(rail->list, (void*) event->xconfigure.window);

        if (window != NULL)
        {
                xfWindow* xfw;
                Window childWindow;
                xfw = (xfWindow*) window->extra;

                /*
                 * ConfigureNotify coordinates are expressed relative to the window parent.
                 * Translate these to root window coordinates.
                 */

                XTranslateCoordinates(xfi->display, xfw->handle, 
			RootWindowOfScreen(xfi->screen),
                        0, 0, &xfw->left, &xfw->top, &childWindow);

                xfw->width = event->xconfigure.width;
                xfw->height = event->xconfigure.height;
                xfw->right = xfw->left + xfw->width - 1;
                xfw->bottom = xfw->top + xfw->height - 1;

		DEBUG_X11_LMS("window=0x%X rc={l=%d t=%d r=%d b=%d} w=%u h=%u send_event=%d",
			(UINT32) xfw->handle, xfw->left, xfw->top, xfw->right, xfw->bottom,
			xfw->width, xfw->height, event->xconfigure.send_event);

		/*
		 * Additonal checks for not in a local move and not ignoring configure to send
		 * position update to server, also should the window not be focused then do not
		 * send to server yet(ie. resizing using window decoration).
		 * The server will be updated when the window gets refocused.
		 */
		if (app && xfw->decorations)
		{
			/* moving resizing using window decoration */
			xf_rail_adjust_position(xfi, window);
			window->windowOffsetX = xfw->left;
			window->visibleOffsetX = window->windowOffsetX;
			window->windowOffsetY = xfw->top;
			window->visibleOffsetY = window->windowOffsetY;
			window->windowWidth = xfw->width;
			window->windowHeight = xfw->height;
		}
		else
		{
			if (app && (!event->xconfigure.send_event || xfi->window->local_move.state == LMS_NOT_ACTIVE) 
				&& !xfw->rail_ignore_configure && xfi->focused)
				xf_rail_adjust_position(xfi, window);
		}

        }

        return True;
}