if (keycode != 0)
{
+ XLockDisplay(subsystem->display);
+
XTestGrabControl(subsystem->display, True);
if (flags & KBD_FLAGS_DOWN)
XTestGrabControl(subsystem->display, False);
XFlush(subsystem->display);
+
+ XUnlockDisplay(subsystem->display);
}
#endif
}
x += surface->x;
y += surface->y;
+ XLockDisplay(subsystem->display);
+
XTestGrabControl(subsystem->display, True);
if (flags & PTR_FLAGS_WHEEL)
XTestGrabControl(subsystem->display, False);
XFlush(subsystem->display);
+
+ XUnlockDisplay(subsystem->display);
#endif
}
x += surface->x;
y += surface->y;
+ XLockDisplay(subsystem->display);
+
XTestGrabControl(subsystem->display, True);
XTestFakeMotionEvent(subsystem->display, 0, x, y, CurrentTime);
XTestGrabControl(subsystem->display, False);
XFlush(subsystem->display);
+
+ XUnlockDisplay(subsystem->display);
#endif
}
UINT32* pDstPixel;
XFixesCursorImage* ci;
+ XLockDisplay(subsystem->display);
ci = XFixesGetCursorImage(subsystem->display);
+ XUnlockDisplay(subsystem->display);
if (!ci)
return -1;
int root_x, root_y;
Window root, child;
+ XLockDisplay(subsystem->display);
+
if (!XQueryPointer(subsystem->display, subsystem->root_window,
&root, &child, &root_x, &root_y, &win_x, &win_y, &mask))
{
+ XUnlockDisplay(subsystem->display);
return -1;
}
+ XUnlockDisplay(subsystem->display);
+
x = root_x;
y = root_y;
}
region.height = height;
#ifdef WITH_XFIXES
+ XLockDisplay(subsystem->display);
XFixesSetRegion(subsystem->display, subsystem->xdamage_region, ®ion, 1);
XDamageSubtract(subsystem->display, subsystem->xdamage, subsystem->xdamage_region, None);
+ XUnlockDisplay(subsystem->display);
#endif
}
{
MONITOR_DEF* virtualScreen;
XWindowAttributes attr;
+
+ XLockDisplay(subsystem->display);
XGetWindowAttributes(subsystem->display, subsystem->root_window, &attr);
+ XUnlockDisplay(subsystem->display);
if (attr.width != subsystem->width || attr.height != subsystem->height)
{
XDestroyImage(image);
return 1;
-
+
fail_capture:
XSetErrorHandler(NULL);
XSync(subsystem->display, False);
if (WaitForSingleObject(subsystem->event, 0) == WAIT_OBJECT_0)
{
+ XLockDisplay(subsystem->display);
+
if (XEventsQueued(subsystem->display, QueuedAlready))
{
XNextEvent(subsystem->display, &xevent);
x11_shadow_handle_xevent(subsystem, &xevent);
}
+
+ XUnlockDisplay(subsystem->display);
}
if ((status == WAIT_TIMEOUT) || (GetTickCount64() > frameTime))
return 1;
}
-int x11_shadow_xfixes_init(x11ShadowSubsystem* subsystem)
+static int x11_shadow_xfixes_init(x11ShadowSubsystem* subsystem)
{
#ifdef WITH_XFIXES
int xfixes_event;
#endif
}
-int x11_shadow_xinerama_init(x11ShadowSubsystem* subsystem)
+static int x11_shadow_xinerama_init(x11ShadowSubsystem* subsystem)
{
#ifdef WITH_XINERAMA
int major, minor;
#endif
}
-int x11_shadow_xdamage_init(x11ShadowSubsystem* subsystem)
+static int x11_shadow_xdamage_init(x11ShadowSubsystem* subsystem)
{
#ifdef WITH_XDAMAGE
int major, minor;
#endif
}
-int x11_shadow_xshm_init(x11ShadowSubsystem* subsystem)
+static int x11_shadow_xshm_init(x11ShadowSubsystem* subsystem)
{
Bool pixmaps;
int major, minor;