#ifdef WITH_XTEST
int button = 0;
BOOL down = FALSE;
+ rdpShadowServer* server;
+ rdpShadowSurface* surface;
+
+ server = subsystem->server;
+ surface = server->surface;
XTestGrabControl(subsystem->display, True);
}
else
{
+ x += surface->x;
+ y += surface->y;
+
if (flags & PTR_FLAGS_MOVE)
XTestFakeMotionEvent(subsystem->display, 0, x, y, 0);
#ifdef WITH_XTEST
int button = 0;
BOOL down = FALSE;
+ rdpShadowServer* server;
+ rdpShadowSurface* surface;
+
+ server = subsystem->server;
+ surface = server->surface;
+
+ x += surface->x;
+ y += surface->y;
XTestGrabControl(subsystem->display, True);
XTestFakeMotionEvent(subsystem->display, 0, x, y, CurrentTime);
surface = server->surface;
screen = server->screen;
+ count = ArrayList_Count(server->clients);
+
+ if (count < 1)
+ return 1;
+
if (subsystem->use_xshm)
{
XLockDisplay(subsystem->display);
image = subsystem->fb_image;
status = shadow_capture_compare(surface->data, surface->scanline, surface->width, surface->height,
- (BYTE*) image->data, image->bytes_per_line, &invalidRect);
+ (BYTE*) &(image->data[surface->width * 4]), image->bytes_per_line, &invalidRect);
if (status > 0)
{
XLockDisplay(subsystem->display);
image = XGetImage(subsystem->display, subsystem->root_window,
- 0, 0, subsystem->width, subsystem->height, AllPlanes, ZPixmap);
+ surface->x, surface->y, surface->width, surface->height, AllPlanes, ZPixmap);
XUnlockDisplay(subsystem->display);
height = invalidRect.bottom - invalidRect.top;
freerdp_image_copy(surface->data, PIXEL_FORMAT_XRGB32,
- surface->scanline, x - surface->x, y - surface->y, width, height,
+ surface->scanline, x, y, width, height,
(BYTE*) image->data, PIXEL_FORMAT_XRGB32,
image->bytes_per_line, x, y);
subsystem->ExtendedMouseEvent = (pfnShadowExtendedMouseEvent) x11_shadow_input_extended_mouse_event;
subsystem->composite = FALSE;
- subsystem->use_xshm = TRUE;
+ subsystem->use_xshm = FALSE; /* temporarily disabled */
subsystem->use_xfixes = TRUE;
subsystem->use_xdamage = FALSE;
subsystem->use_xinerama = TRUE;
LeaveCriticalSection(&(client->lock));
- surfaceRect.left = surface->x;
- surfaceRect.top = surface->y;
- surfaceRect.right = surface->x + surface->width;
- surfaceRect.bottom = surface->y + surface->height;
+ surfaceRect.left = 0;
+ surfaceRect.top = 0;
+ surfaceRect.right = surface->width;
+ surfaceRect.bottom = surface->height;
region16_intersect_rect(&invalidRegion, &invalidRegion, &surfaceRect);
extents = region16_extents(&invalidRegion);
- nXSrc = extents->left - surface->x;
- nYSrc = extents->top - surface->y;
+ nXSrc = extents->left - 0;
+ nYSrc = extents->top - 0;
nWidth = extents->right - extents->left;
nHeight = extents->bottom - extents->top;
if (arg && (arg->Flags & COMMAND_LINE_ARGUMENT_PRESENT))
{
+ int index;
+ rdpShadowSubsystem* subsystem = server->subsystem;
+
if (arg->Flags & COMMAND_LINE_VALUE_PRESENT)
{
/* Select monitors */
+
+ index = atoi(arg->Value);
+
+ if (index < 0)
+ index = 0;
+
+ if (index >= subsystem->monitorCount)
+ index = 0;
+
+ subsystem->selectedMonitor = index;
}
else
{
- int index;
int width, height;
MONITOR_DEF* monitor;
- rdpShadowSubsystem* subsystem = server->subsystem;
/* List monitors */
signal(SIGPIPE, SIG_IGN);
#endif
+ server->screen = shadow_screen_new(server);
+
+ if (!server->screen)
+ return -1;
+
+ server->capture = shadow_capture_new(server);
+
+ if (!server->capture)
+ return -1;
+
if (!server->ipcSocket)
status = server->listener->Open(server->listener, NULL, (UINT16) server->port);
else
server->listener->Close(server->listener);
}
+ if (server->screen)
+ {
+ shadow_screen_free(server->screen);
+ server->screen = NULL;
+ }
+
+ if (server->capture)
+ {
+ shadow_capture_free(server->capture);
+ server->capture = NULL;
+ }
+
return 0;
}
fprintf(stderr, "subsystem init failure: %d\n", status);
}
- server->screen = shadow_screen_new(server);
-
- if (!server->screen)
- return -1;
-
- server->capture = shadow_capture_new(server);
-
- if (!server->capture)
- return -1;
-
return 1;
}