2011-08-16 08:22:00 +04:00
|
|
|
/**
|
2012-10-09 07:02:04 +04:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
2011-08-16 08:22:00 +04:00
|
|
|
* X11 RAIL
|
|
|
|
*
|
|
|
|
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2012-08-15 01:20:53 +04:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2011-10-27 21:29:16 +04:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xutil.h>
|
|
|
|
|
2011-08-18 05:33:22 +04:00
|
|
|
#include <freerdp/utils/event.h>
|
2012-12-14 08:54:54 +04:00
|
|
|
#include <winpr/print.h>
|
2011-08-22 03:04:21 +04:00
|
|
|
#include <freerdp/utils/rail.h>
|
2011-08-17 10:14:02 +04:00
|
|
|
#include <freerdp/rail/rail.h>
|
|
|
|
|
2011-08-20 02:46:10 +04:00
|
|
|
#include "xf_window.h"
|
2011-08-16 08:22:00 +04:00
|
|
|
#include "xf_rail.h"
|
|
|
|
|
2013-04-02 23:13:10 +04:00
|
|
|
#ifdef WITH_DEBUG_X11_LOCAL_MOVESIZE
|
|
|
|
#define DEBUG_X11_LMS(fmt, ...) DEBUG_CLASS(X11_LMS, fmt, ## __VA_ARGS__)
|
|
|
|
#else
|
|
|
|
#define DEBUG_X11_LMS(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
|
|
|
#endif
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_rail_enable_remoteapp_mode(xfContext* xfc)
|
2012-01-02 13:27:04 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
if (!xfc->remote_app)
|
2012-01-02 13:27:04 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc->remote_app = TRUE;
|
|
|
|
xfc->drawable = DefaultRootWindow(xfc->display);
|
|
|
|
xf_DestroyWindow(xfc, xfc->window);
|
|
|
|
xfc->window = NULL;
|
2012-01-02 13:27:04 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_rail_disable_remoteapp_mode(xfContext* xfc)
|
2012-08-04 02:35:17 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
if (xfc->remote_app)
|
2012-08-14 23:59:11 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc->remote_app = FALSE;
|
|
|
|
xf_create_window(xfc);
|
2012-08-14 23:59:11 +04:00
|
|
|
}
|
2012-08-04 02:35:17 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_rail_paint(xfContext* xfc, rdpRail* rail, INT32 uleft, INT32 utop, UINT32 uright, UINT32 ubottom)
|
2011-08-17 10:14:02 +04:00
|
|
|
{
|
2012-05-08 00:07:34 +04:00
|
|
|
xfWindow* xfw;
|
2012-05-18 01:34:52 +04:00
|
|
|
rdpWindow* window;
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL intersect;
|
2012-10-09 11:26:39 +04:00
|
|
|
UINT32 iwidth, iheight;
|
|
|
|
INT32 ileft, itop;
|
|
|
|
UINT32 iright, ibottom;
|
|
|
|
INT32 wleft, wtop;
|
|
|
|
UINT32 wright, wbottom;
|
2011-08-19 20:43:44 +04:00
|
|
|
|
2011-08-17 10:14:02 +04:00
|
|
|
window_list_rewind(rail->list);
|
|
|
|
|
|
|
|
while (window_list_has_next(rail->list))
|
|
|
|
{
|
|
|
|
window = window_list_get_next(rail->list);
|
|
|
|
xfw = (xfWindow*) window->extra;
|
|
|
|
|
2012-11-19 22:26:56 +04:00
|
|
|
/* RDP can have zero width or height windows. X cannot, so we ignore these. */
|
2012-01-14 04:07:27 +04:00
|
|
|
|
2012-11-19 22:26:56 +04:00
|
|
|
if ((window->windowWidth == 0) || (window->windowHeight == 0))
|
2012-01-14 04:07:27 +04:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2012-08-04 02:35:17 +04:00
|
|
|
wleft = window->visibleOffsetX;
|
|
|
|
wtop = window->visibleOffsetY;
|
|
|
|
wright = window->visibleOffsetX + window->windowWidth - 1;
|
|
|
|
wbottom = window->visibleOffsetY + window->windowHeight - 1;
|
2011-08-19 20:43:44 +04:00
|
|
|
|
2011-09-23 05:23:01 +04:00
|
|
|
ileft = MAX(uleft, wleft);
|
|
|
|
itop = MAX(utop, wtop);
|
|
|
|
iright = MIN(uright, wright);
|
|
|
|
ibottom = MIN(ubottom, wbottom);
|
2011-08-17 10:14:02 +04:00
|
|
|
|
2011-09-23 05:23:01 +04:00
|
|
|
iwidth = iright - ileft + 1;
|
|
|
|
iheight = ibottom - itop + 1;
|
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
intersect = ((iright > ileft) && (ibottom > itop)) ? TRUE : FALSE;
|
2011-08-17 10:14:02 +04:00
|
|
|
|
2011-08-19 20:43:44 +04:00
|
|
|
if (intersect)
|
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_UpdateWindowArea(xfc, xfw, ileft - wleft, itop - wtop, iwidth, iheight);
|
2011-08-19 20:43:44 +04:00
|
|
|
}
|
2011-08-17 10:14:02 +04:00
|
|
|
}
|
2011-09-23 05:23:01 +04:00
|
|
|
}
|
2011-08-19 20:43:44 +04:00
|
|
|
|
2012-08-04 02:35:17 +04:00
|
|
|
void xf_rail_DesktopNonMonitored(rdpRail *rail, rdpWindow* window)
|
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
xfContext* xfc;
|
2013-03-29 06:26:28 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc = (xfContext*) rail->extra;
|
|
|
|
xf_rail_disable_remoteapp_mode(xfc);
|
2012-08-04 02:35:17 +04:00
|
|
|
}
|
|
|
|
|
2012-05-25 20:00:13 +04:00
|
|
|
static void xf_rail_CreateWindow(rdpRail* rail, rdpWindow* window)
|
2011-08-17 10:14:02 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
xfContext* xfc;
|
2011-08-17 10:14:02 +04:00
|
|
|
xfWindow* xfw;
|
2011-08-17 22:13:44 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc = (xfContext*) rail->extra;
|
2011-08-18 07:26:12 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_rail_enable_remoteapp_mode(xfc);
|
2012-01-02 13:27:04 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xfw = xf_CreateWindow(xfc, window,
|
2011-08-23 05:22:05 +04:00
|
|
|
window->windowOffsetX, window->windowOffsetY,
|
2013-06-13 02:57:25 +04:00
|
|
|
window->windowWidth, window->windowHeight, window->windowId);
|
2011-08-22 07:54:02 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_SetWindowStyle(xfc, xfw, window->style, window->extendedStyle);
|
2011-08-25 01:16:57 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_SetWindowText(xfc, xfw, window->title);
|
2011-08-30 23:06:50 +04:00
|
|
|
|
2011-08-17 10:14:02 +04:00
|
|
|
window->extra = (void*) xfw;
|
2011-08-18 00:45:09 +04:00
|
|
|
window->extraId = (void*) xfw->handle;
|
2011-08-17 10:14:02 +04:00
|
|
|
}
|
|
|
|
|
2012-05-25 20:00:13 +04:00
|
|
|
static void xf_rail_MoveWindow(rdpRail* rail, rdpWindow* window)
|
2011-08-18 06:50:49 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
xfContext* xfc;
|
2011-08-18 06:50:49 +04:00
|
|
|
xfWindow* xfw;
|
2011-08-18 07:26:12 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc = (xfContext*) rail->extra;
|
2011-08-18 06:50:49 +04:00
|
|
|
xfw = (xfWindow*) window->extra;
|
|
|
|
|
2012-11-19 22:26:56 +04:00
|
|
|
/*
|
|
|
|
* The rail server like to set the window to a small size when it is minimized even though it is hidden
|
|
|
|
* in some cases this can cause the window not to restore back to its original size. Therefore we don't
|
|
|
|
* update our local window when that rail window state is minimized
|
|
|
|
*/
|
2012-08-04 02:35:17 +04:00
|
|
|
if (xfw->rail_state == WINDOW_SHOW_MINIMIZED)
|
|
|
|
return;
|
|
|
|
|
2012-11-19 22:26:56 +04:00
|
|
|
/* Do nothing if window is already in the correct position */
|
2012-08-04 02:35:17 +04:00
|
|
|
if ( xfw->left == window->visibleOffsetX &&
|
|
|
|
xfw->top == window->visibleOffsetY &&
|
|
|
|
xfw->width == window->windowWidth &&
|
|
|
|
xfw->height == window->windowHeight)
|
|
|
|
{
|
2012-11-19 22:26:56 +04:00
|
|
|
/*
|
|
|
|
* Just ensure entire window area is updated to handle cases where we
|
|
|
|
* have drawn locally before getting new bitmap from the server
|
|
|
|
*/
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_UpdateWindowArea(xfc, xfw, 0, 0, window->windowWidth, window->windowHeight);
|
2012-08-04 02:35:17 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_MoveWindow(xfc, xfw,
|
2012-08-04 02:35:17 +04:00
|
|
|
window->visibleOffsetX, window->visibleOffsetY,
|
2012-05-08 00:07:34 +04:00
|
|
|
window->windowWidth, window->windowHeight);
|
2011-08-18 06:50:49 +04:00
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
static void xf_rail_ShowWindow(rdpRail* rail, rdpWindow* window, BYTE state)
|
2011-08-22 07:15:19 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
xfContext* xfc;
|
2011-08-22 07:15:19 +04:00
|
|
|
xfWindow* xfw;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc = (xfContext*) rail->extra;
|
2011-08-22 07:15:19 +04:00
|
|
|
xfw = (xfWindow*) window->extra;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_ShowWindow(xfc, xfw, state);
|
2011-08-22 07:15:19 +04:00
|
|
|
}
|
|
|
|
|
2012-05-25 20:00:13 +04:00
|
|
|
static void xf_rail_SetWindowText(rdpRail* rail, rdpWindow* window)
|
2011-08-20 06:21:09 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
xfContext* xfc;
|
2011-08-20 06:21:09 +04:00
|
|
|
xfWindow* xfw;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc = (xfContext*) rail->extra;
|
2011-08-20 06:21:09 +04:00
|
|
|
xfw = (xfWindow*) window->extra;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_SetWindowText(xfc, xfw, window->title);
|
2011-08-20 06:21:09 +04:00
|
|
|
}
|
|
|
|
|
2012-05-25 20:00:13 +04:00
|
|
|
static void xf_rail_SetWindowIcon(rdpRail* rail, rdpWindow* window, rdpIcon* icon)
|
2011-08-22 01:32:18 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
xfContext* xfc;
|
2011-08-22 01:32:18 +04:00
|
|
|
xfWindow* xfw;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc = (xfContext*) rail->extra;
|
2011-08-22 01:32:18 +04:00
|
|
|
xfw = (xfWindow*) window->extra;
|
|
|
|
|
2011-09-14 03:03:06 +04:00
|
|
|
icon->extra = freerdp_icon_convert(icon->entry->bitsColor, NULL, icon->entry->bitsMask,
|
2011-08-22 06:30:49 +04:00
|
|
|
icon->entry->width, icon->entry->height, icon->entry->bpp, rail->clrconv);
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_SetWindowIcon(xfc, xfw, icon);
|
2011-08-22 01:32:18 +04:00
|
|
|
}
|
|
|
|
|
2012-05-25 20:00:13 +04:00
|
|
|
static void xf_rail_SetWindowRects(rdpRail* rail, rdpWindow* window)
|
2011-08-23 00:06:12 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
xfContext* xfc;
|
2011-08-23 00:06:12 +04:00
|
|
|
xfWindow* xfw;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc = (xfContext*) rail->extra;
|
2011-08-23 00:06:12 +04:00
|
|
|
xfw = (xfWindow*) window->extra;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_SetWindowRects(xfc, xfw, window->windowRects, window->numWindowRects);
|
2011-08-23 00:06:12 +04:00
|
|
|
}
|
|
|
|
|
2012-05-25 20:00:13 +04:00
|
|
|
static void xf_rail_SetWindowVisibilityRects(rdpRail* rail, rdpWindow* window)
|
2011-08-30 22:21:16 +04:00
|
|
|
{
|
|
|
|
xfWindow* xfw;
|
2013-06-13 02:57:25 +04:00
|
|
|
xfContext* xfc;
|
2011-08-30 22:21:16 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc = (xfContext*) rail->extra;
|
2011-08-30 22:21:16 +04:00
|
|
|
xfw = (xfWindow*) window->extra;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_SetWindowVisibilityRects(xfc, xfw, window->windowRects, window->numWindowRects);
|
2011-08-30 22:21:16 +04:00
|
|
|
}
|
|
|
|
|
2012-05-25 20:00:13 +04:00
|
|
|
static void xf_rail_DestroyWindow(rdpRail* rail, rdpWindow* window)
|
2011-08-18 06:31:27 +04:00
|
|
|
{
|
|
|
|
xfWindow* xfw;
|
2013-06-13 02:57:25 +04:00
|
|
|
xfContext* xfc;
|
|
|
|
|
|
|
|
xfc = (xfContext*) rail->extra;
|
2011-08-18 06:31:27 +04:00
|
|
|
xfw = (xfWindow*) window->extra;
|
2013-06-13 02:57:25 +04:00
|
|
|
|
|
|
|
xf_DestroyWindow(xfc, xfw);
|
2011-08-18 06:31:27 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_rail_register_callbacks(xfContext* xfc, rdpRail* rail)
|
2011-08-17 10:14:02 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
rail->extra = (void*) xfc;
|
2011-08-31 10:01:49 +04:00
|
|
|
rail->rail_CreateWindow = xf_rail_CreateWindow;
|
|
|
|
rail->rail_MoveWindow = xf_rail_MoveWindow;
|
|
|
|
rail->rail_ShowWindow = xf_rail_ShowWindow;
|
|
|
|
rail->rail_SetWindowText = xf_rail_SetWindowText;
|
|
|
|
rail->rail_SetWindowIcon = xf_rail_SetWindowIcon;
|
|
|
|
rail->rail_SetWindowRects = xf_rail_SetWindowRects;
|
|
|
|
rail->rail_SetWindowVisibilityRects = xf_rail_SetWindowVisibilityRects;
|
|
|
|
rail->rail_DestroyWindow = xf_rail_DestroyWindow;
|
2012-08-04 02:35:17 +04:00
|
|
|
rail->rail_DesktopNonMonitored = xf_rail_DesktopNonMonitored;
|
2011-08-17 10:14:02 +04:00
|
|
|
}
|
|
|
|
|
2013-03-29 05:13:56 +04:00
|
|
|
static void xf_on_free_rail_client_event(wMessage* event)
|
2011-08-22 03:04:21 +04:00
|
|
|
{
|
2013-03-29 05:13:56 +04:00
|
|
|
rail_free_cloned_order(GetMessageType(event->id), event->wParam);
|
2011-08-22 03:04:21 +04:00
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
static void xf_send_rail_client_event(rdpChannels* channels, UINT16 event_type, void* param)
|
2011-08-22 03:04:21 +04:00
|
|
|
{
|
2013-03-29 05:13:56 +04:00
|
|
|
wMessage* out_event = NULL;
|
2012-11-19 22:26:56 +04:00
|
|
|
void* payload = NULL;
|
2011-08-22 03:04:21 +04:00
|
|
|
|
|
|
|
payload = rail_clone_order(event_type, param);
|
2012-11-19 22:26:56 +04:00
|
|
|
|
2011-08-22 03:04:21 +04:00
|
|
|
if (payload != NULL)
|
|
|
|
{
|
2013-03-29 03:33:31 +04:00
|
|
|
out_event = freerdp_event_new(RailChannel_Class, event_type,
|
2011-08-22 03:04:21 +04:00
|
|
|
xf_on_free_rail_client_event, payload);
|
2013-03-29 02:29:57 +04:00
|
|
|
|
2011-10-17 04:10:09 +04:00
|
|
|
freerdp_channels_send_event(channels, out_event);
|
2011-08-22 03:04:21 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_rail_send_activate(xfContext* xfc, Window xwindow, BOOL enabled)
|
2011-08-25 02:22:06 +04:00
|
|
|
{
|
2011-10-16 08:50:10 +04:00
|
|
|
rdpRail* rail;
|
2011-10-17 04:10:09 +04:00
|
|
|
rdpChannels* channels;
|
2011-08-25 02:22:06 +04:00
|
|
|
rdpWindow* rail_window;
|
|
|
|
RAIL_ACTIVATE_ORDER activate;
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
rail = ((rdpContext*) xfc)->rail;
|
|
|
|
channels = ((rdpContext*) xfc)->channels;
|
2011-08-25 02:22:06 +04:00
|
|
|
|
2011-10-16 08:50:10 +04:00
|
|
|
rail_window = window_list_get_by_extra_id(rail->list, (void*) xwindow);
|
|
|
|
|
|
|
|
if (rail_window == NULL)
|
|
|
|
return;
|
2011-08-25 02:22:06 +04:00
|
|
|
|
|
|
|
activate.windowId = rail_window->windowId;
|
|
|
|
activate.enabled = enabled;
|
|
|
|
|
2013-03-29 04:23:16 +04:00
|
|
|
xf_send_rail_client_event(channels, RailChannel_ClientActivate, &activate);
|
2011-08-25 02:22:06 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_rail_send_client_system_command(xfContext* xfc, UINT32 windowId, UINT16 command)
|
2011-08-22 07:39:56 +04:00
|
|
|
{
|
2011-10-17 04:10:09 +04:00
|
|
|
rdpChannels* channels;
|
2011-08-22 20:14:11 +04:00
|
|
|
RAIL_SYSCOMMAND_ORDER syscommand;
|
2011-08-22 07:39:56 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
channels = ((rdpContext*) xfc)->channels;
|
2011-08-22 07:39:56 +04:00
|
|
|
|
2011-08-22 20:14:11 +04:00
|
|
|
syscommand.windowId = windowId;
|
|
|
|
syscommand.command = command;
|
2011-08-22 07:39:56 +04:00
|
|
|
|
2013-03-29 04:23:16 +04:00
|
|
|
xf_send_rail_client_event(channels, RailChannel_ClientSystemCommand, &syscommand);
|
2011-08-22 07:39:56 +04:00
|
|
|
}
|
|
|
|
|
2011-12-03 02:51:30 +04:00
|
|
|
/**
|
|
|
|
* The position of the X window can become out of sync with the RDP window
|
|
|
|
* if the X window is moved locally by the window manager. In this event
|
|
|
|
* send an update to the RDP server informing it of the new window position
|
|
|
|
* and size.
|
|
|
|
*/
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_rail_adjust_position(xfContext* xfc, rdpWindow* window)
|
2011-12-03 02:51:30 +04:00
|
|
|
{
|
|
|
|
xfWindow* xfw;
|
|
|
|
rdpChannels* channels;
|
|
|
|
RAIL_WINDOW_MOVE_ORDER window_move;
|
|
|
|
|
|
|
|
xfw = (xfWindow*) window->extra;
|
2013-06-13 02:57:25 +04:00
|
|
|
channels = ((rdpContext*) xfc)->channels;
|
2011-12-03 02:51:30 +04:00
|
|
|
|
|
|
|
if (! xfw->is_mapped || xfw->local_move.state != LMS_NOT_ACTIVE)
|
|
|
|
return;
|
|
|
|
|
2012-11-19 22:26:56 +04:00
|
|
|
/* If current window position disagrees with RDP window position, send update to RDP server */
|
2012-08-04 02:35:17 +04:00
|
|
|
if ( xfw->left != window->visibleOffsetX ||
|
|
|
|
xfw->top != window->visibleOffsetY ||
|
2011-12-03 02:51:30 +04:00
|
|
|
xfw->width != window->windowWidth ||
|
|
|
|
xfw->height != window->windowHeight)
|
|
|
|
{
|
2012-11-19 22:26:56 +04:00
|
|
|
/*
|
|
|
|
* Although the rail server can give negative window coordinates when updating windowOffsetX and windowOffsetY,
|
|
|
|
* we can only send unsigned integers to the rail server. Therefore, we always bring negative coordinates up to 0
|
|
|
|
* when attempting to adjust the rail window.
|
|
|
|
*/
|
2012-10-09 11:26:39 +04:00
|
|
|
UINT32 offsetX = 0;
|
|
|
|
UINT32 offsetY = 0;
|
2012-08-04 02:35:17 +04:00
|
|
|
|
|
|
|
if (window->windowOffsetX < 0)
|
|
|
|
offsetX = offsetX - window->windowOffsetX;
|
|
|
|
|
|
|
|
if (window->windowOffsetY < 0)
|
|
|
|
offsetY = offsetY - window->windowOffsetY;
|
2012-11-19 22:26:56 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* windowOffset corresponds to the window location on the rail server
|
|
|
|
* but our local window is based on the visibleOffset since using the windowOffset
|
|
|
|
* can result in blank areas for a maximized window
|
|
|
|
*/
|
2011-12-03 02:51:30 +04:00
|
|
|
window_move.windowId = window->windowId;
|
2012-08-04 02:35:17 +04:00
|
|
|
|
2012-11-19 22:26:56 +04:00
|
|
|
/*
|
|
|
|
* Calculate new offsets for the rail server window
|
|
|
|
* Negative offset correction + rail server window offset + (difference in visibleOffset and new window local offset)
|
|
|
|
*/
|
2012-08-04 02:35:17 +04:00
|
|
|
window_move.left = offsetX + window->windowOffsetX + (xfw->left - window->visibleOffsetX);
|
|
|
|
window_move.top = offsetY + window->windowOffsetY + (xfw->top - window->visibleOffsetY);
|
|
|
|
|
|
|
|
window_move.right = window_move.left + xfw->width;
|
|
|
|
window_move.bottom = window_move.top + xfw->height;
|
2011-12-03 02:51:30 +04:00
|
|
|
|
2011-12-08 01:49:37 +04:00
|
|
|
DEBUG_X11_LMS("window=0x%X rc={l=%d t=%d r=%d b=%d} w=%u h=%u"
|
|
|
|
" RDP=0x%X rc={l=%d t=%d} w=%d h=%d",
|
2012-10-09 11:26:39 +04:00
|
|
|
(UINT32) xfw->handle, window_move.left, window_move.top,
|
2012-08-04 02:35:17 +04:00
|
|
|
window_move.right, window_move.bottom, xfw->width, xfw->height,
|
2011-12-08 01:49:37 +04:00
|
|
|
window->windowId,
|
|
|
|
window->windowOffsetX, window->windowOffsetY,
|
|
|
|
window->windowWidth, window->windowHeight);
|
|
|
|
|
2013-03-29 04:23:16 +04:00
|
|
|
xf_send_rail_client_event(channels, RailChannel_ClientWindowMove, &window_move);
|
2011-12-03 02:51:30 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_rail_end_local_move(xfContext* xfc, rdpWindow *window)
|
2011-12-03 02:51:30 +04:00
|
|
|
{
|
|
|
|
xfWindow* xfw;
|
|
|
|
rdpChannels* channels;
|
|
|
|
RAIL_WINDOW_MOVE_ORDER window_move;
|
2013-06-13 02:57:25 +04:00
|
|
|
rdpInput* input = xfc->instance->input;
|
2012-05-26 02:37:38 +04:00
|
|
|
int x,y;
|
|
|
|
Window root_window;
|
|
|
|
Window child_window;
|
|
|
|
unsigned int mask;
|
|
|
|
int child_x;
|
|
|
|
int child_y;
|
2011-12-03 02:51:30 +04:00
|
|
|
|
|
|
|
xfw = (xfWindow*) window->extra;
|
2013-06-13 02:57:25 +04:00
|
|
|
channels = ((rdpContext*) xfc)->channels;
|
2011-12-03 02:51:30 +04:00
|
|
|
|
2011-12-17 01:09:21 +04:00
|
|
|
DEBUG_X11_LMS("window=0x%X rc={l=%d t=%d r=%d b=%d} w=%d h=%d",
|
2012-10-09 11:26:39 +04:00
|
|
|
(UINT32) xfw->handle,
|
2011-12-17 01:09:21 +04:00
|
|
|
xfw->left, xfw->top, xfw->right, xfw->bottom,
|
|
|
|
xfw->width, xfw->height);
|
2011-12-03 02:51:30 +04:00
|
|
|
|
2012-11-19 22:26:56 +04:00
|
|
|
/*
|
|
|
|
* Although the rail server can give negative window coordinates when updating windowOffsetX and windowOffsetY,
|
|
|
|
* we can only send unsigned integers to the rail server. Therefore, we always bring negative coordinates up to 0 when
|
|
|
|
* attempting to adjust the rail window.
|
|
|
|
*/
|
2012-10-09 11:26:39 +04:00
|
|
|
UINT32 offsetX = 0;
|
|
|
|
UINT32 offsetY = 0;
|
2012-08-04 02:35:17 +04:00
|
|
|
|
|
|
|
if (window->windowOffsetX < 0)
|
|
|
|
offsetX = offsetX - window->windowOffsetX;
|
|
|
|
|
|
|
|
if (window->windowOffsetY < 0)
|
|
|
|
offsetY = offsetY - window->windowOffsetY;
|
|
|
|
|
2012-05-26 02:37:38 +04:00
|
|
|
/*
|
|
|
|
* For keyboard moves send and explicit update to RDP server
|
|
|
|
*/
|
|
|
|
window_move.windowId = window->windowId;
|
2012-08-04 02:35:17 +04:00
|
|
|
|
2012-11-19 22:26:56 +04:00
|
|
|
/*
|
|
|
|
* Calculate new offsets for the rail server window
|
|
|
|
* Negative offset correction + rail server window offset + (difference in visibleOffset and new window local offset)
|
|
|
|
*/
|
2012-08-04 02:35:17 +04:00
|
|
|
window_move.left = offsetX + window->windowOffsetX + (xfw->left - window->visibleOffsetX);
|
|
|
|
window_move.top = offsetY + window->windowOffsetY + (xfw->top - window->visibleOffsetY);
|
|
|
|
|
2012-11-19 22:26:56 +04:00
|
|
|
window_move.right = window_move.left + xfw->width; /* In the update to RDP the position is one past the window */
|
2012-08-04 02:35:17 +04:00
|
|
|
window_move.bottom = window_move.top + xfw->height;
|
|
|
|
|
2013-03-29 04:23:16 +04:00
|
|
|
xf_send_rail_client_event(channels, RailChannel_ClientWindowMove, &window_move);
|
2012-05-26 02:37:38 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Simulate button up at new position to end the local move (per RDP spec)
|
|
|
|
*/
|
2011-12-03 02:51:30 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
XQueryPointer(xfc->display, xfw->handle,
|
2012-05-26 02:37:38 +04:00
|
|
|
&root_window, &child_window,
|
|
|
|
&x, &y, &child_x, &child_y, &mask);
|
2011-12-03 02:51:30 +04:00
|
|
|
input->MouseEvent(input, PTR_FLAGS_BUTTON1, x, y);
|
2012-08-04 02:35:17 +04:00
|
|
|
|
2012-11-19 22:26:56 +04:00
|
|
|
/* only send the mouse coordinates if not a keyboard move or size */
|
2012-08-04 02:35:17 +04:00
|
|
|
if ((xfw->local_move.direction != _NET_WM_MOVERESIZE_MOVE_KEYBOARD) &&
|
|
|
|
(xfw->local_move.direction != _NET_WM_MOVERESIZE_SIZE_KEYBOARD))
|
|
|
|
{
|
|
|
|
input->MouseEvent(input, PTR_FLAGS_BUTTON1, x, y);
|
|
|
|
DEBUG_X11_LMS("Mouse coordinates. x= %i, y= %i", x, y);
|
|
|
|
}
|
2012-05-26 02:37:38 +04:00
|
|
|
|
2012-11-19 22:26:56 +04:00
|
|
|
/*
|
|
|
|
* Proactively update the RAIL window dimensions. There is a race condition where
|
|
|
|
* we can start to receive GDI orders for the new window dimensions before we
|
|
|
|
* receive the RAIL ORDER for the new window size. This avoids that race condition.
|
|
|
|
*/
|
2012-01-14 04:07:27 +04:00
|
|
|
|
2012-08-04 02:35:17 +04:00
|
|
|
window->windowOffsetX = offsetX + window->windowOffsetX + (xfw->left - window->visibleOffsetX);
|
|
|
|
window->windowOffsetY = offsetY + window->windowOffsetY + (xfw->top - window->visibleOffsetY);
|
2012-01-14 04:07:27 +04:00
|
|
|
window->windowWidth = xfw->width;
|
|
|
|
window->windowHeight = xfw->height;
|
|
|
|
|
2011-12-03 02:51:30 +04:00
|
|
|
xfw->local_move.state = LMS_TERMINATING;
|
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_process_rail_get_sysparams_event(xfContext* xfc, rdpChannels* channels, wMessage* event)
|
2011-08-16 08:22:00 +04:00
|
|
|
{
|
2011-08-18 05:33:22 +04:00
|
|
|
RAIL_SYSPARAM_ORDER* sysparam;
|
|
|
|
|
2013-03-29 05:13:56 +04:00
|
|
|
sysparam = (RAIL_SYSPARAM_ORDER*) event->wParam;
|
2011-08-18 05:33:22 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
sysparam->workArea.left = xfc->workArea.x;
|
|
|
|
sysparam->workArea.top = xfc->workArea.y;
|
|
|
|
sysparam->workArea.right = xfc->workArea.x + xfc->workArea.width;
|
|
|
|
sysparam->workArea.bottom = xfc->workArea.y + xfc->workArea.height;
|
2011-08-18 05:33:22 +04:00
|
|
|
|
|
|
|
sysparam->taskbarPos.left = 0;
|
|
|
|
sysparam->taskbarPos.top = 0;
|
|
|
|
sysparam->taskbarPos.right = 0;
|
|
|
|
sysparam->taskbarPos.bottom = 0;
|
|
|
|
|
2012-10-09 10:31:28 +04:00
|
|
|
sysparam->dragFullWindows = FALSE;
|
2011-08-25 23:05:07 +04:00
|
|
|
|
2013-03-29 04:23:16 +04:00
|
|
|
xf_send_rail_client_event(channels, RailChannel_ClientSystemParam, sysparam);
|
2011-08-18 05:33:22 +04:00
|
|
|
}
|
|
|
|
|
2011-08-20 06:21:09 +04:00
|
|
|
const char* error_code_names[] =
|
|
|
|
{
|
|
|
|
"RAIL_EXEC_S_OK",
|
|
|
|
"RAIL_EXEC_E_HOOK_NOT_LOADED",
|
|
|
|
"RAIL_EXEC_E_DECODE_FAILED",
|
|
|
|
"RAIL_EXEC_E_NOT_IN_ALLOWLIST",
|
|
|
|
"RAIL_EXEC_E_FILE_NOT_FOUND",
|
|
|
|
"RAIL_EXEC_E_FAIL",
|
|
|
|
"RAIL_EXEC_E_SESSION_LOCKED"
|
|
|
|
};
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_process_rail_exec_result_event(xfContext* xfc, rdpChannels* channels, wMessage* event)
|
2011-08-19 18:10:08 +04:00
|
|
|
{
|
2011-08-20 06:21:09 +04:00
|
|
|
RAIL_EXEC_RESULT_ORDER* exec_result;
|
|
|
|
|
2013-03-29 05:13:56 +04:00
|
|
|
exec_result = (RAIL_EXEC_RESULT_ORDER*) event->wParam;
|
2011-08-19 18:10:08 +04:00
|
|
|
|
|
|
|
if (exec_result->execResult != RAIL_EXEC_S_OK)
|
|
|
|
{
|
2013-03-29 02:06:34 +04:00
|
|
|
fprintf(stderr, "RAIL exec error: execResult=%s NtError=0x%X\n",
|
2011-08-19 18:10:08 +04:00
|
|
|
error_code_names[exec_result->execResult], exec_result->rawResult);
|
2013-06-13 02:57:25 +04:00
|
|
|
xfc->disconnect = True;
|
2012-01-02 13:27:04 +04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_rail_enable_remoteapp_mode(xfc);
|
2011-08-19 18:10:08 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_process_rail_server_sysparam_event(xfContext* xfc, rdpChannels* channels, wMessage* event)
|
2011-08-20 02:46:10 +04:00
|
|
|
{
|
2013-03-29 05:13:56 +04:00
|
|
|
RAIL_SYSPARAM_ORDER* sysparam = (RAIL_SYSPARAM_ORDER*) event->wParam;
|
2011-08-20 02:46:10 +04:00
|
|
|
|
|
|
|
switch (sysparam->param)
|
|
|
|
{
|
2011-08-22 01:32:18 +04:00
|
|
|
case SPI_SET_SCREEN_SAVE_ACTIVE:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SPI_SET_SCREEN_SAVE_SECURE:
|
|
|
|
break;
|
2011-08-20 02:46:10 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_process_rail_server_minmaxinfo_event(xfContext* xfc, rdpChannels* channels, wMessage* event)
|
2011-08-20 02:46:10 +04:00
|
|
|
{
|
2011-10-16 08:50:10 +04:00
|
|
|
rdpRail* rail;
|
2011-09-01 02:02:22 +04:00
|
|
|
rdpWindow* rail_window = NULL;
|
2013-03-29 05:13:56 +04:00
|
|
|
RAIL_MINMAXINFO_ORDER* minmax = (RAIL_MINMAXINFO_ORDER*) event->wParam;
|
2011-08-20 02:46:10 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
rail = ((rdpContext*) xfc)->rail;
|
2011-10-16 08:50:10 +04:00
|
|
|
rail_window = window_list_get_by_id(rail->list, minmax->windowId);
|
2011-09-01 02:02:22 +04:00
|
|
|
|
|
|
|
if (rail_window != NULL)
|
|
|
|
{
|
|
|
|
xfWindow * window = NULL;
|
|
|
|
window = (xfWindow *) rail_window->extra;
|
|
|
|
|
2011-09-04 00:38:01 +04:00
|
|
|
DEBUG_X11_LMS("windowId=0x%X maxWidth=%d maxHeight=%d maxPosX=%d maxPosY=%d "
|
2011-09-03 20:50:26 +04:00
|
|
|
"minTrackWidth=%d minTrackHeight=%d maxTrackWidth=%d maxTrackHeight=%d",
|
2011-09-01 02:02:22 +04:00
|
|
|
minmax->windowId, minmax->maxWidth, minmax->maxHeight,
|
2012-10-09 11:01:37 +04:00
|
|
|
(INT16)minmax->maxPosX, (INT16)minmax->maxPosY,
|
2011-09-01 02:02:22 +04:00
|
|
|
minmax->minTrackWidth, minmax->minTrackHeight,
|
|
|
|
minmax->maxTrackWidth, minmax->maxTrackHeight);
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_SetWindowMinMaxInfo(xfc, window, minmax->maxWidth, minmax->maxHeight, minmax->maxPosX, minmax->maxPosY,
|
2011-09-03 20:50:26 +04:00
|
|
|
minmax->minTrackWidth, minmax->minTrackHeight, minmax->maxTrackWidth, minmax->maxTrackHeight);
|
2011-09-01 02:02:22 +04:00
|
|
|
}
|
2011-08-20 02:46:10 +04:00
|
|
|
}
|
|
|
|
|
2011-08-22 01:32:18 +04:00
|
|
|
const char* movetype_names[] =
|
2011-08-20 02:46:10 +04:00
|
|
|
{
|
|
|
|
"(invalid)",
|
|
|
|
"RAIL_WMSZ_LEFT",
|
|
|
|
"RAIL_WMSZ_RIGHT",
|
|
|
|
"RAIL_WMSZ_TOP",
|
|
|
|
"RAIL_WMSZ_TOPLEFT",
|
|
|
|
"RAIL_WMSZ_TOPRIGHT",
|
|
|
|
"RAIL_WMSZ_BOTTOM",
|
|
|
|
"RAIL_WMSZ_BOTTOMLEFT",
|
|
|
|
"RAIL_WMSZ_BOTTOMRIGHT",
|
|
|
|
"RAIL_WMSZ_MOVE",
|
|
|
|
"RAIL_WMSZ_KEYMOVE",
|
2011-08-22 01:32:18 +04:00
|
|
|
"RAIL_WMSZ_KEYSIZE"
|
|
|
|
};
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_process_rail_server_localmovesize_event(xfContext* xfc, rdpChannels* channels, wMessage* event)
|
2011-08-22 01:32:18 +04:00
|
|
|
{
|
2013-08-29 13:07:19 +04:00
|
|
|
int x = 0, y = 0;
|
2011-10-16 08:50:10 +04:00
|
|
|
rdpRail* rail;
|
2011-11-29 01:50:08 +04:00
|
|
|
int direction = 0;
|
2011-12-03 02:51:30 +04:00
|
|
|
Window child_window;
|
2012-11-19 22:26:56 +04:00
|
|
|
rdpWindow* rail_window = NULL;
|
2013-03-29 05:13:56 +04:00
|
|
|
RAIL_LOCALMOVESIZE_ORDER* movesize = (RAIL_LOCALMOVESIZE_ORDER*) event->wParam;
|
2011-09-01 02:02:22 +04:00
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
rail = ((rdpContext*) xfc)->rail;
|
2011-10-16 08:50:10 +04:00
|
|
|
rail_window = window_list_get_by_id(rail->list, movesize->windowId);
|
2011-09-01 02:02:22 +04:00
|
|
|
|
|
|
|
if (rail_window != NULL)
|
|
|
|
{
|
2011-12-03 02:51:30 +04:00
|
|
|
xfWindow* xfw = NULL;
|
|
|
|
xfw = (xfWindow*) rail_window->extra;
|
2011-09-01 02:02:22 +04:00
|
|
|
|
2011-09-04 00:38:01 +04:00
|
|
|
DEBUG_X11_LMS("windowId=0x%X isMoveSizeStart=%d moveSizeType=%s PosX=%d PosY=%d",
|
2011-09-01 02:02:22 +04:00
|
|
|
movesize->windowId, movesize->isMoveSizeStart,
|
2012-10-09 11:01:37 +04:00
|
|
|
movetype_names[movesize->moveSizeType], (INT16) movesize->posX, (INT16) movesize->posY);
|
2011-09-01 02:02:22 +04:00
|
|
|
|
2011-11-29 01:50:08 +04:00
|
|
|
switch (movesize->moveSizeType)
|
|
|
|
{
|
|
|
|
case RAIL_WMSZ_LEFT: //0x1
|
|
|
|
direction = _NET_WM_MOVERESIZE_SIZE_LEFT;
|
2011-12-03 02:51:30 +04:00
|
|
|
x = movesize->posX;
|
|
|
|
y = movesize->posY;
|
2011-11-29 01:50:08 +04:00
|
|
|
break;
|
|
|
|
case RAIL_WMSZ_RIGHT: //0x2
|
|
|
|
direction = _NET_WM_MOVERESIZE_SIZE_RIGHT;
|
2011-12-03 02:51:30 +04:00
|
|
|
x = movesize->posX;
|
|
|
|
y = movesize->posY;
|
2011-11-29 01:50:08 +04:00
|
|
|
break;
|
|
|
|
case RAIL_WMSZ_TOP: //0x3
|
|
|
|
direction = _NET_WM_MOVERESIZE_SIZE_TOP;
|
2011-12-03 02:51:30 +04:00
|
|
|
x = movesize->posX;
|
|
|
|
y = movesize->posY;
|
2011-11-29 01:50:08 +04:00
|
|
|
break;
|
|
|
|
case RAIL_WMSZ_TOPLEFT: //0x4
|
|
|
|
direction = _NET_WM_MOVERESIZE_SIZE_TOPLEFT;
|
2011-12-03 02:51:30 +04:00
|
|
|
x = movesize->posX;
|
|
|
|
y = movesize->posY;
|
2011-11-29 01:50:08 +04:00
|
|
|
break;
|
|
|
|
case RAIL_WMSZ_TOPRIGHT: //0x5
|
|
|
|
direction = _NET_WM_MOVERESIZE_SIZE_TOPRIGHT;
|
2011-12-03 02:51:30 +04:00
|
|
|
x = movesize->posX;
|
|
|
|
y = movesize->posY;
|
2011-11-29 01:50:08 +04:00
|
|
|
break;
|
|
|
|
case RAIL_WMSZ_BOTTOM: //0x6
|
|
|
|
direction = _NET_WM_MOVERESIZE_SIZE_BOTTOM;
|
2011-12-03 02:51:30 +04:00
|
|
|
x = movesize->posX;
|
|
|
|
y = movesize->posY;
|
2011-11-29 01:50:08 +04:00
|
|
|
break;
|
|
|
|
case RAIL_WMSZ_BOTTOMLEFT: //0x7
|
|
|
|
direction = _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT;
|
2011-12-03 02:51:30 +04:00
|
|
|
x = movesize->posX;
|
|
|
|
y = movesize->posY;
|
2011-11-29 01:50:08 +04:00
|
|
|
break;
|
|
|
|
case RAIL_WMSZ_BOTTOMRIGHT: //0x8
|
|
|
|
direction = _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT;
|
2011-12-03 02:51:30 +04:00
|
|
|
x = movesize->posX;
|
|
|
|
y = movesize->posY;
|
2011-11-29 01:50:08 +04:00
|
|
|
break;
|
|
|
|
case RAIL_WMSZ_MOVE: //0x9
|
|
|
|
direction = _NET_WM_MOVERESIZE_MOVE;
|
2013-06-13 02:57:25 +04:00
|
|
|
XTranslateCoordinates(xfc->display, xfw->handle,
|
|
|
|
RootWindowOfScreen(xfc->screen),
|
2011-12-03 02:51:30 +04:00
|
|
|
movesize->posX, movesize->posY, &x, &y, &child_window);
|
2011-11-29 01:50:08 +04:00
|
|
|
break;
|
|
|
|
case RAIL_WMSZ_KEYMOVE: //0xA
|
|
|
|
direction = _NET_WM_MOVERESIZE_MOVE_KEYBOARD;
|
2011-12-03 02:51:30 +04:00
|
|
|
x = movesize->posX;
|
|
|
|
y = movesize->posY;
|
2012-05-26 02:37:38 +04:00
|
|
|
/* FIXME: local keyboard moves not working */
|
|
|
|
return;
|
2011-11-29 01:50:08 +04:00
|
|
|
case RAIL_WMSZ_KEYSIZE: //0xB
|
|
|
|
direction = _NET_WM_MOVERESIZE_SIZE_KEYBOARD;
|
2011-12-03 02:51:30 +04:00
|
|
|
x = movesize->posX;
|
|
|
|
y = movesize->posY;
|
2012-05-26 02:37:38 +04:00
|
|
|
/* FIXME: local keyboard moves not working */
|
|
|
|
return;
|
2011-11-29 01:50:08 +04:00
|
|
|
}
|
|
|
|
|
2011-09-01 02:02:22 +04:00
|
|
|
if (movesize->isMoveSizeStart)
|
2011-11-29 01:50:08 +04:00
|
|
|
{
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_StartLocalMoveSize(xfc, xfw, direction, x, y);
|
2011-11-29 01:50:08 +04:00
|
|
|
} else {
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_EndLocalMoveSize(xfc, xfw);
|
2011-11-29 01:50:08 +04:00
|
|
|
}
|
2011-09-01 02:02:22 +04:00
|
|
|
}
|
2011-08-20 02:46:10 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_process_rail_appid_resp_event(xfContext* xfc, rdpChannels* channels, wMessage* event)
|
2011-08-20 02:46:10 +04:00
|
|
|
{
|
|
|
|
RAIL_GET_APPID_RESP_ORDER* appid_resp =
|
2013-03-29 05:13:56 +04:00
|
|
|
(RAIL_GET_APPID_RESP_ORDER*) event->wParam;
|
2011-08-20 02:46:10 +04:00
|
|
|
|
2013-03-29 02:06:34 +04:00
|
|
|
fprintf(stderr, "Server Application ID Response PDU: windowId=0x%X "
|
2011-08-20 02:46:10 +04:00
|
|
|
"applicationId=(length=%d dump)\n",
|
2013-10-23 00:28:23 +04:00
|
|
|
appid_resp->windowId, 512);
|
2011-08-22 01:32:18 +04:00
|
|
|
|
2013-10-23 00:28:23 +04:00
|
|
|
winpr_HexDump((BYTE*) &appid_resp->applicationId, 512);
|
2011-08-20 02:46:10 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_process_rail_langbarinfo_event(xfContext* xfc, rdpChannels* channels, wMessage* event)
|
2011-08-20 02:46:10 +04:00
|
|
|
{
|
|
|
|
RAIL_LANGBAR_INFO_ORDER* langbar =
|
2013-03-29 05:13:56 +04:00
|
|
|
(RAIL_LANGBAR_INFO_ORDER*) event->wParam;
|
2011-08-20 02:46:10 +04:00
|
|
|
|
2013-03-29 02:06:34 +04:00
|
|
|
fprintf(stderr, "Language Bar Information PDU: languageBarStatus=0x%X\n",
|
2011-08-22 01:32:18 +04:00
|
|
|
langbar->languageBarStatus);
|
2011-08-20 02:46:10 +04:00
|
|
|
}
|
|
|
|
|
2013-06-13 02:57:25 +04:00
|
|
|
void xf_process_rail_event(xfContext* xfc, rdpChannels* channels, wMessage* event)
|
2011-08-18 05:33:22 +04:00
|
|
|
{
|
2013-03-29 04:23:16 +04:00
|
|
|
switch (GetMessageType(event->id))
|
2011-08-18 05:33:22 +04:00
|
|
|
{
|
2013-03-29 04:23:16 +04:00
|
|
|
case RailChannel_GetSystemParam:
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_process_rail_get_sysparams_event(xfc, channels, event);
|
2011-08-18 05:33:22 +04:00
|
|
|
break;
|
|
|
|
|
2013-03-29 04:23:16 +04:00
|
|
|
case RailChannel_ServerExecuteResult:
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_process_rail_exec_result_event(xfc, channels, event);
|
2011-08-19 18:10:08 +04:00
|
|
|
break;
|
|
|
|
|
2013-03-29 04:23:16 +04:00
|
|
|
case RailChannel_ServerSystemParam:
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_process_rail_server_sysparam_event(xfc, channels, event);
|
2011-08-20 02:46:10 +04:00
|
|
|
break;
|
|
|
|
|
2013-03-29 04:23:16 +04:00
|
|
|
case RailChannel_ServerMinMaxInfo:
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_process_rail_server_minmaxinfo_event(xfc, channels, event);
|
2011-08-20 02:46:10 +04:00
|
|
|
break;
|
|
|
|
|
2013-03-29 04:23:16 +04:00
|
|
|
case RailChannel_ServerLocalMoveSize:
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_process_rail_server_localmovesize_event(xfc, channels, event);
|
2011-08-20 02:46:10 +04:00
|
|
|
break;
|
|
|
|
|
2013-03-29 04:23:16 +04:00
|
|
|
case RailChannel_ServerGetAppIdResponse:
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_process_rail_appid_resp_event(xfc, channels, event);
|
2011-08-20 02:46:10 +04:00
|
|
|
break;
|
|
|
|
|
2013-03-29 04:23:16 +04:00
|
|
|
case RailChannel_ServerLanguageBarInfo:
|
2013-06-13 02:57:25 +04:00
|
|
|
xf_process_rail_langbarinfo_event(xfc, channels, event);
|
2011-08-20 02:46:10 +04:00
|
|
|
break;
|
|
|
|
|
2011-08-18 05:33:22 +04:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2011-08-16 08:22:00 +04:00
|
|
|
}
|