window = window_list_get_next(rail->list);
xfw = (xfWindow*) window->extra;
- // RDP can have zero width or height windows. X cannot, so we ignore these.
+ /* RDP can have zero width or height windows. X cannot, so we ignore these. */
- if (window->windowWidth == 0 || window->windowHeight == 0)
+ if ((window->windowWidth == 0) || (window->windowHeight == 0))
{
continue;
}
xf_rail_disable_remoteapp_mode(xfi);
}
-
static void xf_rail_CreateWindow(rdpRail* rail, rdpWindow* window)
{
xfInfo* xfi;
xfi = (xfInfo*) rail->extra;
xfw = (xfWindow*) window->extra;
- //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 dont update
- //our local window when that rail window state is minimized
+ /*
+ * 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
+ */
if (xfw->rail_state == WINDOW_SHOW_MINIMIZED)
return;
- // Do nothing if window is already in the correct position
+ /* Do nothing if window is already in the correct position */
if ( xfw->left == window->visibleOffsetX &&
xfw->top == window->visibleOffsetY &&
xfw->width == window->windowWidth &&
xfw->height == window->windowHeight)
{
- //Just ensure entire window area is updated to
- //handle cases where we have drawn locally before getting new bitmap
- //from the server
+ /*
+ * Just ensure entire window area is updated to handle cases where we
+ * have drawn locally before getting new bitmap from the server
+ */
xf_UpdateWindowArea(xfi, xfw, 0, 0, window->windowWidth, window->windowHeight);
return;
}
-
xf_MoveWindow(xfi, xfw,
window->visibleOffsetX, window->visibleOffsetY,
window->windowWidth, window->windowHeight);
static void xf_send_rail_client_event(rdpChannels* channels, UINT16 event_type, void* param)
{
RDP_EVENT* out_event = NULL;
- void * payload = NULL;
+ void* payload = NULL;
payload = rail_clone_order(event_type, param);
+
if (payload != NULL)
{
out_event = freerdp_event_new(RDP_EVENT_CLASS_RAIL, event_type,
if (! xfw->is_mapped || xfw->local_move.state != LMS_NOT_ACTIVE)
return;
- // If current window position disagrees with RDP window position, send
- // update to RDP server
+ /* If current window position disagrees with RDP window position, send update to RDP server */
if ( xfw->left != window->visibleOffsetX ||
xfw->top != window->visibleOffsetY ||
xfw->width != window->windowWidth ||
xfw->height != window->windowHeight)
{
- //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.
+ /*
+ * 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.
+ */
UINT32 offsetX = 0;
UINT32 offsetY = 0;
if (window->windowOffsetY < 0)
offsetY = offsetY - window->windowOffsetY;
- //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
+
+ /*
+ * 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
+ */
window_move.windowId = window->windowId;
- //Calculate new offsets for the rail server window
- //Negative offset correction + rail server window offset + (difference in visibleOffset and new window local offset)
+ /*
+ * Calculate new offsets for the rail server window
+ * Negative offset correction + rail server window offset + (difference in visibleOffset and new window local offset)
+ */
window_move.left = offsetX + window->windowOffsetX + (xfw->left - window->visibleOffsetX);
window_move.top = offsetY + window->windowOffsetY + (xfw->top - window->visibleOffsetY);
xfw->left, xfw->top, xfw->right, xfw->bottom,
xfw->width, xfw->height);
- //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.
+ /*
+ * 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.
+ */
UINT32 offsetX = 0;
UINT32 offsetY = 0;
*/
window_move.windowId = window->windowId;
- //Calculate new offsets for the rail server window
- //Negative offset correction + rail server window offset + (difference in visibleOffset and new window local offset)
+ /*
+ * Calculate new offsets for the rail server window
+ * Negative offset correction + rail server window offset + (difference in visibleOffset and new window local offset)
+ */
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; // In the update to RDP the position is one past the window
+ window_move.right = window_move.left + xfw->width; /* In the update to RDP the position is one past the window */
window_move.bottom = window_move.top + xfw->height;
-
xf_send_rail_client_event(channels,
RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE, &window_move);
&x, &y, &child_x, &child_y, &mask);
input->MouseEvent(input, PTR_FLAGS_BUTTON1, x, y);
- //only send the mouse coordinates if not a keyboard move or size
+ /* only send the mouse coordinates if not a keyboard move or size */
if ((xfw->local_move.direction != _NET_WM_MOVERESIZE_MOVE_KEYBOARD) &&
(xfw->local_move.direction != _NET_WM_MOVERESIZE_SIZE_KEYBOARD))
{
DEBUG_X11_LMS("Mouse coordinates. x= %i, y= %i", x, y);
}
- // 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.
+ /*
+ * 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.
+ */
window->windowOffsetX = offsetX + window->windowOffsetX + (xfw->left - window->visibleOffsetX);
window->windowOffsetY = offsetY + window->windowOffsetY + (xfw->top - window->visibleOffsetY);
void xf_process_rail_server_localmovesize_event(xfInfo* xfi, rdpChannels* channels, RDP_EVENT* event)
{
+ int x, y;
rdpRail* rail;
- rdpWindow* rail_window = NULL;
- RAIL_LOCALMOVESIZE_ORDER* movesize = (RAIL_LOCALMOVESIZE_ORDER*) event->user_data;
int direction = 0;
Window child_window;
- int x,y;
+ rdpWindow* rail_window = NULL;
+ RAIL_LOCALMOVESIZE_ORDER* movesize = (RAIL_LOCALMOVESIZE_ORDER*) event->user_data;
rail = ((rdpContext*) xfi->context)->rail;
rail_window = window_list_get_by_id(rail->list, movesize->windowId);
void xf_process_rail_appid_resp_event(xfInfo* xfi, rdpChannels* channels, RDP_EVENT* event)
{
RAIL_GET_APPID_RESP_ORDER* appid_resp =
- (RAIL_GET_APPID_RESP_ORDER*)event->user_data;
+ (RAIL_GET_APPID_RESP_ORDER*) event->user_data;
printf("Server Application ID Response PDU: windowId=0x%X "
"applicationId=(length=%d dump)\n",
COMMAND_LINE_ARGUMENT_A args[] =
{
- { "v", COMMAND_LINE_VALUE_REQUIRED, "<server>[:port]", NULL, NULL, -1, NULL, "destination server" },
- { "port", COMMAND_LINE_VALUE_REQUIRED, "<number>", NULL, NULL, -1, NULL, "server port" },
- { "w", COMMAND_LINE_VALUE_REQUIRED, "<width>", "1024", NULL, -1, NULL, "width" },
- { "h", COMMAND_LINE_VALUE_REQUIRED, "<height>", "768", NULL, -1, NULL, "height" },
- { "size", COMMAND_LINE_VALUE_REQUIRED, "<width>x<height>", "1024x768", NULL, -1, NULL, "screen size" },
- { "f", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "fullscreen" },
- { "bpp", COMMAND_LINE_VALUE_REQUIRED, "<depth>", "16", NULL, -1, NULL, "session bpp (color depth)" },
- { "admin", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, "console", "admin (or console) session" },
- { "multimon", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "multi-monitor" },
- { "workarea", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "work area" },
- { "t", COMMAND_LINE_VALUE_REQUIRED, "<title>", NULL, NULL, -1, "title", "window title" },
- { "decorations", COMMAND_LINE_VALUE_BOOL, NULL, NULL, BoolValueFalse, -1, NULL, "window decorations" },
- { "a", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, "addin", "addin" },
- { "vc", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "static virtual channel" },
- { "dvc", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "dynamic virtual channel" },
- { "u", COMMAND_LINE_VALUE_REQUIRED, "[<domain>\\]<user>", NULL, NULL, -1, NULL, "username" },
- { "p", COMMAND_LINE_VALUE_REQUIRED, "<password>", NULL, NULL, -1, NULL, "password" },
- { "d", COMMAND_LINE_VALUE_REQUIRED, "<domain>", NULL, NULL, -1, NULL, "domain" },
- { "g", COMMAND_LINE_VALUE_REQUIRED, "<gateway>[:port]", NULL, NULL, -1, NULL, "gateway" },
- { "gu", COMMAND_LINE_VALUE_REQUIRED, "[<domain>\\]<user>", NULL, NULL, -1, NULL, "gateway username" },
- { "gp", COMMAND_LINE_VALUE_REQUIRED, "<password>", NULL, NULL, -1, NULL, "gateway password" },
- { "gd", COMMAND_LINE_VALUE_REQUIRED, "<domain>", NULL, NULL, -1, NULL, "gateway domain" },
- { "z", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "compression" },
- { "shell", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "alternate shell" },
- { "shell-dir", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "shell working directory" },
- { "audio", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "audio output mode" },
- { "mic", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "audio input (microphone)" },
- { "fonts", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "smooth fonts (cleartype)" },
- { "aero", COMMAND_LINE_VALUE_BOOL, NULL, NULL, BoolValueFalse, -1, NULL, "desktop composition" },
- { "window-drag", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "full window drag" },
- { "menu-anims", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "menu animations" },
- { "themes", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "themes" },
- { "wallpaper", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "wallpaper" },
+ { "v", COMMAND_LINE_VALUE_REQUIRED, "<server>[:port]", NULL, NULL, -1, NULL, "Server hostname" },
+ { "port", COMMAND_LINE_VALUE_REQUIRED, "<number>", NULL, NULL, -1, NULL, "Server port" },
+ { "w", COMMAND_LINE_VALUE_REQUIRED, "<width>", "1024", NULL, -1, NULL, "Width" },
+ { "h", COMMAND_LINE_VALUE_REQUIRED, "<height>", "768", NULL, -1, NULL, "Height" },
+ { "size", COMMAND_LINE_VALUE_REQUIRED, "<width>x<height>", "1024x768", NULL, -1, NULL, "Screen size" },
+ { "f", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "Fullscreen mode" },
+ { "bpp", COMMAND_LINE_VALUE_REQUIRED, "<depth>", "16", NULL, -1, NULL, "Session bpp (color depth)" },
+ { "admin", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, "console", "Admin (or console) session" },
+ { "multimon", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "Multi-monitor" },
+ { "workarea", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "Work area" },
+ { "t", COMMAND_LINE_VALUE_REQUIRED, "<title>", NULL, NULL, -1, "title", "Window title" },
+ { "decorations", COMMAND_LINE_VALUE_BOOL, NULL, NULL, BoolValueFalse, -1, NULL, "Window decorations" },
+ { "a", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, "addin", "Addin" },
+ { "vc", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "Static virtual channel" },
+ { "dvc", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "Dynamic virtual channel" },
+ { "u", COMMAND_LINE_VALUE_REQUIRED, "[<domain>\\]<user>", NULL, NULL, -1, NULL, "Username" },
+ { "p", COMMAND_LINE_VALUE_REQUIRED, "<password>", NULL, NULL, -1, NULL, "Password" },
+ { "d", COMMAND_LINE_VALUE_REQUIRED, "<domain>", NULL, NULL, -1, NULL, "Domain" },
+ { "g", COMMAND_LINE_VALUE_REQUIRED, "<gateway>[:port]", NULL, NULL, -1, NULL, "Gateway Hostname" },
+ { "gu", COMMAND_LINE_VALUE_REQUIRED, "[<domain>\\]<user>", NULL, NULL, -1, NULL, "Gateway username" },
+ { "gp", COMMAND_LINE_VALUE_REQUIRED, "<password>", NULL, NULL, -1, NULL, "Gateway password" },
+ { "gd", COMMAND_LINE_VALUE_REQUIRED, "<domain>", NULL, NULL, -1, NULL, "Gateway domain" },
+ { "app", COMMAND_LINE_VALUE_REQUIRED, "||<alias> or <executable path>", NULL, NULL, -1, NULL, "Remote application program" },
+ { "app-name", COMMAND_LINE_VALUE_REQUIRED, "<app name>", NULL, NULL, -1, NULL, "Remote application name for user interface" },
+ { "app-icon", COMMAND_LINE_VALUE_REQUIRED, "<icon path>", NULL, NULL, -1, NULL, "Remote application icon for user interface" },
+ { "app-cmd", COMMAND_LINE_VALUE_REQUIRED, "<parameters>", NULL, NULL, -1, NULL, "Remote application command-line parameters" },
+ { "app-file", COMMAND_LINE_VALUE_REQUIRED, "<file name>", NULL, NULL, -1, NULL, "File to open with remote application" },
+ { "app-guid", COMMAND_LINE_VALUE_REQUIRED, "<app guid>", NULL, NULL, -1, NULL, "Remote application GUID" },
+ { "z", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Compression" },
+ { "shell", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "Alternate shell" },
+ { "shell-dir", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "Shell working directory" },
+ { "audio", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "Audio output mode" },
+ { "mic", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "Audio input (microphone)" },
+ { "fonts", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Smooth fonts (cleartype)" },
+ { "aero", COMMAND_LINE_VALUE_BOOL, NULL, NULL, BoolValueFalse, -1, NULL, "Desktop composition" },
+ { "window-drag", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Full window drag" },
+ { "menu-anims", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Menu animations" },
+ { "themes", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "Themes" },
+ { "wallpaper", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "Wallpaper" },
{ "gdi", COMMAND_LINE_VALUE_REQUIRED, "<sw|hw>", NULL, NULL, -1, NULL, "GDI rendering" },
{ "rfx", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "RemoteFX" },
{ "rfx-mode", COMMAND_LINE_VALUE_REQUIRED, "<image|video>", NULL, NULL, -1, NULL, "RemoteFX mode" },
int freerdp_client_add_static_channel(rdpSettings* settings, int count, char** params)
{
int index;
- ADDIN_ARGV* channel;
+ ADDIN_ARGV* args;
- channel = (ADDIN_ARGV*) malloc(sizeof(ADDIN_ARGV));
+ args = (ADDIN_ARGV*) malloc(sizeof(ADDIN_ARGV));
- channel->argc = count;
- channel->argv = (char**) malloc(sizeof(char*) * channel->argc);
+ args->argc = count;
+ args->argv = (char**) malloc(sizeof(char*) * args->argc);
- for (index = 0; index < channel->argc; index++)
- channel->argv[index] = _strdup(params[index]);
+ for (index = 0; index < args->argc; index++)
+ args->argv[index] = _strdup(params[index]);
- freerdp_static_channel_collection_add(settings, channel);
+ freerdp_static_channel_collection_add(settings, args);
return 0;
}
int freerdp_client_add_dynamic_channel(rdpSettings* settings, int count, char** params)
{
int index;
- ADDIN_ARGV* channel;
+ ADDIN_ARGV* args;
- channel = (ADDIN_ARGV*) malloc(sizeof(ADDIN_ARGV));
+ args = (ADDIN_ARGV*) malloc(sizeof(ADDIN_ARGV));
- channel->argc = count;
- channel->argv = (char**) malloc(sizeof(char*) * channel->argc);
+ args->argc = count;
+ args->argv = (char**) malloc(sizeof(char*) * args->argc);
- for (index = 0; index < channel->argc; index++)
- channel->argv[index] = _strdup(params[index]);
+ for (index = 0; index < args->argc; index++)
+ args->argv[index] = _strdup(params[index]);
- freerdp_dynamic_channel_collection_add(settings, channel);
+ freerdp_dynamic_channel_collection_add(settings, args);
return 0;
}
p = freerdp_command_line_parse_comma_separated_values(arg->Value, &count);
- printf("addin: %s %s %s\n", p[0], p[1], p[2]);
-
freerdp_client_add_static_channel(settings, count, p);
free(p);
p = freerdp_command_line_parse_comma_separated_values(arg->Value, &count);
- printf("addin: %s %s %s\n", p[0], p[1], p[2]);
-
freerdp_client_add_dynamic_channel(settings, count, p);
free(p);
settings->GatewayPassword = _strdup(arg->Value);
settings->GatewayUseSameCredentials = FALSE;
}
+ CommandLineSwitchCase(arg, "app")
+ {
+ settings->RemoteApplicationProgram = _strdup(arg->Value);
+
+ settings->RemoteApplicationMode = TRUE;
+ settings->RemoteAppLanguageBarSupported = TRUE;
+ settings->Workarea = TRUE;
+ settings->DisableWallpaper = TRUE;
+ settings->DisableFullWindowDrag = TRUE;
+ }
+ CommandLineSwitchCase(arg, "app-name")
+ {
+ settings->RemoteApplicationName = _strdup(arg->Value);
+ }
+ CommandLineSwitchCase(arg, "app-icon")
+ {
+ settings->RemoteApplicationIcon = _strdup(arg->Value);
+ }
+ CommandLineSwitchCase(arg, "app-cmd")
+ {
+ settings->RemoteApplicationCmdLine = _strdup(arg->Value);
+ }
+ CommandLineSwitchCase(arg, "app-file")
+ {
+ settings->RemoteApplicationFile = _strdup(arg->Value);
+ }
+ CommandLineSwitchCase(arg, "app-guid")
+ {
+ settings->RemoteApplicationGuid = _strdup(arg->Value);
+ }
CommandLineSwitchCase(arg, "z")
{
settings->CompressionEnabled = arg->Value ? TRUE : FALSE;
int index;
void* entry = NULL;
+ for (index = 0; index < settings->StaticChannelCount; index++)
+ {
+ ADDIN_ARGV* args;
+
+ args = settings->StaticChannelArray[index];
+
+ entry = freerdp_load_channel_addin_entry(args->argv[0], NULL, NULL, FREERDP_ADDIN_CHANNEL_STATIC);
+
+ if (entry)
+ {
+ if (freerdp_channels_client_load(channels, settings, entry, args) == 0)
+ printf("loading channel %s\n", args->argv[0]);
+ }
+ }
+
if (settings->DeviceRedirection)
{
entry = freerdp_load_channel_addin_entry("rdpdr", NULL, NULL, FREERDP_ADDIN_CHANNEL_STATIC);
}
}
- for (index = 0; index < settings->StaticChannelCount; index++)
+ if (settings->RemoteApplicationMode)
{
- ADDIN_ARGV* args;
-
- args = settings->StaticChannelArray[index];
-
- entry = freerdp_load_channel_addin_entry(args->argv[0], NULL, NULL, FREERDP_ADDIN_CHANNEL_STATIC);
+ entry = freerdp_load_channel_addin_entry("rail", NULL, NULL, FREERDP_ADDIN_CHANNEL_STATIC);
if (entry)
{
- if (freerdp_channels_client_load(channels, settings, entry, args) == 0)
- printf("loading channel %s\n", args->argv[0]);
+ if (freerdp_channels_client_load(channels, settings, entry, settings) == 0)
+ printf("loading channel %s\n", "rail");
}
}