Xnest: use XCB for event loop
Now that no X11 calls are being done via Xlib anymore, we're free to also move over event receiving, leaving Xlib pretty much unused. Also need to add a simple event queue mechanism, because we've go a screen operation (see xnestBitBlitHelper) that needs to collect up certain events for it's return value. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
8c701832ea
commit
4716ee9981
|
@ -33,7 +33,6 @@ is" without express or implied warranty.
|
||||||
#include "Args.h"
|
#include "Args.h"
|
||||||
|
|
||||||
char *xnestDisplayName = NULL;
|
char *xnestDisplayName = NULL;
|
||||||
Bool xnestSynchronize = FALSE;
|
|
||||||
Bool xnestFullGeneration = FALSE;
|
Bool xnestFullGeneration = FALSE;
|
||||||
int xnestDefaultClass;
|
int xnestDefaultClass;
|
||||||
Bool xnestUserDefaultClass = FALSE;
|
Bool xnestUserDefaultClass = FALSE;
|
||||||
|
@ -70,10 +69,6 @@ ddxProcessArgument(int argc, char *argv[], int i)
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (!strcmp(argv[i], "-sync")) {
|
|
||||||
xnestSynchronize = TRUE;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (!strcmp(argv[i], "-full")) {
|
if (!strcmp(argv[i], "-full")) {
|
||||||
xnestFullGeneration = TRUE;
|
xnestFullGeneration = TRUE;
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -187,7 +182,6 @@ void
|
||||||
ddxUseMsg(void)
|
ddxUseMsg(void)
|
||||||
{
|
{
|
||||||
ErrorF("-display string display name of the real server\n");
|
ErrorF("-display string display name of the real server\n");
|
||||||
ErrorF("-sync sinchronize with the real server\n");
|
|
||||||
ErrorF("-full utilize full regeneration\n");
|
ErrorF("-full utilize full regeneration\n");
|
||||||
ErrorF("-class string default visual class\n");
|
ErrorF("-class string default visual class\n");
|
||||||
ErrorF("-depth int default depth\n");
|
ErrorF("-depth int default depth\n");
|
||||||
|
|
|
@ -19,7 +19,6 @@ is" without express or implied warranty.
|
||||||
#include <X11/Xdefs.h>
|
#include <X11/Xdefs.h>
|
||||||
|
|
||||||
extern char *xnestDisplayName;
|
extern char *xnestDisplayName;
|
||||||
extern Bool xnestSynchronize;
|
|
||||||
extern Bool xnestFullGeneration;
|
extern Bool xnestFullGeneration;
|
||||||
extern int xnestDefaultClass;
|
extern int xnestDefaultClass;
|
||||||
extern Bool xnestUserDefaultClass;
|
extern Bool xnestUserDefaultClass;
|
||||||
|
|
|
@ -72,9 +72,6 @@ xnestOpenDisplay(int argc, char *argv[])
|
||||||
FatalError("Unable to open display \"%s\".\n",
|
FatalError("Unable to open display \"%s\".\n",
|
||||||
XDisplayName(xnestDisplayName));
|
XDisplayName(xnestDisplayName));
|
||||||
|
|
||||||
if (xnestSynchronize)
|
|
||||||
XSynchronize(xnestDisplay, TRUE);
|
|
||||||
|
|
||||||
xnest_upstream_setup();
|
xnest_upstream_setup();
|
||||||
|
|
||||||
if (xnestParentWindow != (Window) 0)
|
if (xnestParentWindow != (Window) 0)
|
||||||
|
|
|
@ -30,6 +30,7 @@ is" without express or implied warranty.
|
||||||
#include "inpututils.h"
|
#include "inpututils.h"
|
||||||
|
|
||||||
#include "Xnest.h"
|
#include "Xnest.h"
|
||||||
|
#include "xnest-xcb.h"
|
||||||
|
|
||||||
#include "Args.h"
|
#include "Args.h"
|
||||||
#include "Color.h"
|
#include "Color.h"
|
||||||
|
@ -63,42 +64,6 @@ SetTimeSinceLastInputEvent(void)
|
||||||
lastEventTime = GetTimeInMillis();
|
lastEventTime = GetTimeInMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
|
||||||
xnestExposurePredicate(Display * dpy, XEvent * event, char *args)
|
|
||||||
{
|
|
||||||
return event->type == Expose || event->type == ProcessedExpose;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
xnestNotExposurePredicate(Display * dpy, XEvent * event, char *args)
|
|
||||||
{
|
|
||||||
return !xnestExposurePredicate(dpy, event, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
xnestCollectExposures(void)
|
|
||||||
{
|
|
||||||
XEvent X;
|
|
||||||
WindowPtr pWin;
|
|
||||||
RegionRec Rgn;
|
|
||||||
BoxRec Box;
|
|
||||||
|
|
||||||
while (XCheckIfEvent(xnestDisplay, &X, xnestExposurePredicate, NULL)) {
|
|
||||||
pWin = xnestWindowPtr(X.xexpose.window);
|
|
||||||
|
|
||||||
if (pWin && X.xexpose.width && X.xexpose.height) {
|
|
||||||
Box.x1 = pWin->drawable.x + wBorderWidth(pWin) + X.xexpose.x;
|
|
||||||
Box.y1 = pWin->drawable.y + wBorderWidth(pWin) + X.xexpose.y;
|
|
||||||
Box.x2 = Box.x1 + X.xexpose.width;
|
|
||||||
Box.y2 = Box.y1 + X.xexpose.height;
|
|
||||||
|
|
||||||
RegionInit(&Rgn, &Box, 1);
|
|
||||||
|
|
||||||
miSendExposures(pWin, &Rgn, Box.x1, Box.y1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
xnestQueueKeyEvent(int type, unsigned int keycode)
|
xnestQueueKeyEvent(int type, unsigned int keycode)
|
||||||
{
|
{
|
||||||
|
@ -106,52 +71,62 @@ xnestQueueKeyEvent(int type, unsigned int keycode)
|
||||||
QueueKeyboardEvents(xnestKeyboardDevice, type, keycode);
|
QueueKeyboardEvents(xnestKeyboardDevice, type, keycode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define EVTYPE(tname) tname *ev = (tname*)event
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xnest_handle_event(XEvent X)
|
xnest_handle_event(xcb_generic_event_t *event)
|
||||||
{
|
{
|
||||||
switch (X.type) {
|
if (!event)
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch (event->response_type & ~0x80) {
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
{
|
{
|
||||||
xnestUpdateModifierState(X.xkey.state);
|
EVTYPE(xcb_key_press_event_t);
|
||||||
xnestQueueKeyEvent(KeyPress, X.xkey.keycode);
|
xnestUpdateModifierState(ev->state);
|
||||||
|
xnestQueueKeyEvent(KeyPress, ev->detail);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case KeyRelease:
|
case KeyRelease:
|
||||||
{
|
{
|
||||||
xnestUpdateModifierState(X.xkey.state);
|
EVTYPE(xcb_key_release_event_t);
|
||||||
xnestQueueKeyEvent(KeyRelease, X.xkey.keycode);
|
xnestUpdateModifierState(ev->state);
|
||||||
|
xnestQueueKeyEvent(KeyRelease, ev->detail);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
{
|
{
|
||||||
ValuatorMask mask;
|
ValuatorMask mask;
|
||||||
|
EVTYPE(xcb_button_press_event_t);
|
||||||
valuator_mask_set_range(&mask, 0, 0, NULL);
|
valuator_mask_set_range(&mask, 0, 0, NULL);
|
||||||
xnestUpdateModifierState(X.xkey.state);
|
xnestUpdateModifierState(ev->state);
|
||||||
lastEventTime = GetTimeInMillis();
|
lastEventTime = GetTimeInMillis();
|
||||||
QueuePointerEvents(xnestPointerDevice, ButtonPress,
|
QueuePointerEvents(xnestPointerDevice, ButtonPress,
|
||||||
X.xbutton.button, POINTER_RELATIVE, &mask);
|
ev->detail, POINTER_RELATIVE, &mask);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
{
|
{
|
||||||
ValuatorMask mask;
|
ValuatorMask mask;
|
||||||
|
EVTYPE(xcb_button_release_event_t);
|
||||||
valuator_mask_set_range(&mask, 0, 0, NULL);
|
valuator_mask_set_range(&mask, 0, 0, NULL);
|
||||||
xnestUpdateModifierState(X.xkey.state);
|
xnestUpdateModifierState(ev->state);
|
||||||
lastEventTime = GetTimeInMillis();
|
lastEventTime = GetTimeInMillis();
|
||||||
QueuePointerEvents(xnestPointerDevice, ButtonRelease,
|
QueuePointerEvents(xnestPointerDevice, ButtonRelease,
|
||||||
X.xbutton.button, POINTER_RELATIVE, &mask);
|
ev->detail, POINTER_RELATIVE, &mask);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
{
|
{
|
||||||
|
EVTYPE(xcb_motion_notify_event_t);
|
||||||
ValuatorMask mask;
|
ValuatorMask mask;
|
||||||
int valuators[2];
|
int valuators[2];
|
||||||
valuators[0] = X.xmotion.x;
|
valuators[0] = ev->event_x;
|
||||||
valuators[1] = X.xmotion.y;
|
valuators[1] = ev->event_y;
|
||||||
valuator_mask_set_range(&mask, 0, 2, valuators);
|
valuator_mask_set_range(&mask, 0, 2, valuators);
|
||||||
lastEventTime = GetTimeInMillis();
|
lastEventTime = GetTimeInMillis();
|
||||||
QueuePointerEvents(xnestPointerDevice, MotionNotify,
|
QueuePointerEvents(xnestPointerDevice, MotionNotify,
|
||||||
|
@ -161,8 +136,9 @@ xnest_handle_event(XEvent X)
|
||||||
|
|
||||||
case FocusIn:
|
case FocusIn:
|
||||||
{
|
{
|
||||||
if (X.xfocus.detail != NotifyInferior) {
|
EVTYPE(xcb_focus_in_event_t);
|
||||||
ScreenPtr pScreen = xnestScreen(X.xfocus.window);
|
if (ev->detail != NotifyInferior) {
|
||||||
|
ScreenPtr pScreen = xnestScreen(ev->event);
|
||||||
if (pScreen)
|
if (pScreen)
|
||||||
xnestDirectInstallColormaps(pScreen);
|
xnestDirectInstallColormaps(pScreen);
|
||||||
}
|
}
|
||||||
|
@ -171,8 +147,9 @@ xnest_handle_event(XEvent X)
|
||||||
|
|
||||||
case FocusOut:
|
case FocusOut:
|
||||||
{
|
{
|
||||||
if (X.xfocus.detail != NotifyInferior) {
|
EVTYPE(xcb_focus_out_event_t);
|
||||||
ScreenPtr pScreen = xnestScreen(X.xfocus.window);
|
if (ev->detail != NotifyInferior) {
|
||||||
|
ScreenPtr pScreen = xnestScreen(ev->event);
|
||||||
if (pScreen)
|
if (pScreen)
|
||||||
xnestDirectUninstallColormaps(pScreen);
|
xnestDirectUninstallColormaps(pScreen);
|
||||||
}
|
}
|
||||||
|
@ -184,15 +161,16 @@ xnest_handle_event(XEvent X)
|
||||||
|
|
||||||
case EnterNotify:
|
case EnterNotify:
|
||||||
{
|
{
|
||||||
if (X.xcrossing.detail != NotifyInferior) {
|
EVTYPE(xcb_enter_notify_event_t);
|
||||||
ScreenPtr pScreen = xnestScreen(X.xcrossing.window);
|
if (ev->detail != NotifyInferior) {
|
||||||
|
ScreenPtr pScreen = xnestScreen(ev->event);
|
||||||
if (pScreen) {
|
if (pScreen) {
|
||||||
ValuatorMask mask;
|
ValuatorMask mask;
|
||||||
int valuators[2];
|
int valuators[2];
|
||||||
NewCurrentScreen(inputInfo.pointer, pScreen, X.xcrossing.x,
|
NewCurrentScreen(inputInfo.pointer, pScreen,
|
||||||
X.xcrossing.y);
|
ev->event_x, ev->event_y);
|
||||||
valuators[0] = X.xcrossing.x;
|
valuators[0] = ev->event_x;
|
||||||
valuators[1] = X.xcrossing.y;
|
valuators[1] = ev->event_y;
|
||||||
valuator_mask_set_range(&mask, 0, 2, valuators);
|
valuator_mask_set_range(&mask, 0, 2, valuators);
|
||||||
lastEventTime = GetTimeInMillis();
|
lastEventTime = GetTimeInMillis();
|
||||||
QueuePointerEvents(xnestPointerDevice, MotionNotify,
|
QueuePointerEvents(xnestPointerDevice, MotionNotify,
|
||||||
|
@ -205,8 +183,9 @@ xnest_handle_event(XEvent X)
|
||||||
|
|
||||||
case LeaveNotify:
|
case LeaveNotify:
|
||||||
{
|
{
|
||||||
if (X.xcrossing.detail != NotifyInferior) {
|
EVTYPE(xcb_leave_notify_event_t);
|
||||||
ScreenPtr pScreen = xnestScreen(X.xcrossing.window);
|
if (ev->detail != NotifyInferior) {
|
||||||
|
ScreenPtr pScreen = xnestScreen(ev->event);
|
||||||
if (pScreen) {
|
if (pScreen) {
|
||||||
xnestDirectUninstallColormaps(pScreen);
|
xnestDirectUninstallColormaps(pScreen);
|
||||||
}
|
}
|
||||||
|
@ -216,8 +195,9 @@ xnest_handle_event(XEvent X)
|
||||||
|
|
||||||
case DestroyNotify:
|
case DestroyNotify:
|
||||||
{
|
{
|
||||||
if (xnestParentWindow != (Window) 0 &&
|
xcb_destroy_notify_event_t *ev = (xcb_destroy_notify_event_t*)event;
|
||||||
X.xdestroywindow.window == xnestParentWindow)
|
if (xnestParentWindow &&
|
||||||
|
ev->window == xnestParentWindow)
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -228,11 +208,35 @@ xnest_handle_event(XEvent X)
|
||||||
case MapNotify:
|
case MapNotify:
|
||||||
case ReparentNotify:
|
case ReparentNotify:
|
||||||
case UnmapNotify:
|
case UnmapNotify:
|
||||||
case NoExpose:
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Expose:
|
||||||
|
{
|
||||||
|
EVTYPE(xcb_expose_event_t);
|
||||||
|
WindowPtr pWin = xnestWindowPtr(ev->window);
|
||||||
|
if (pWin && ev->width && ev->height) {
|
||||||
|
RegionRec Rgn;
|
||||||
|
BoxRec Box = {
|
||||||
|
.x1 = pWin->drawable.x + wBorderWidth(pWin) + ev->x,
|
||||||
|
.y1 = pWin->drawable.y + wBorderWidth(pWin) + ev->y,
|
||||||
|
.x2 = Box.x1 + ev->width,
|
||||||
|
.y2 = Box.y1 + ev->height,
|
||||||
|
};
|
||||||
|
RegionInit(&Rgn, &Box, 1);
|
||||||
|
miSendExposures(pWin, &Rgn, Box.x1, Box.y1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NoExpose:
|
||||||
|
ErrorF("xnest: received stray NoExpose\n");
|
||||||
|
break;
|
||||||
|
case GraphicsExpose:
|
||||||
|
ErrorF("xnest: received stray GraphicsExpose\n");
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ErrorF("xnest warning: unhandled event: %d\n", X.type);
|
ErrorF("xnest warning: unhandled event: %d\n", event->response_type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -240,9 +244,29 @@ xnest_handle_event(XEvent X)
|
||||||
void
|
void
|
||||||
xnestCollectEvents(void)
|
xnestCollectEvents(void)
|
||||||
{
|
{
|
||||||
XEvent X;
|
/* process queued events */
|
||||||
|
struct xnest_event_queue *tmp = NULL, *walk = NULL;
|
||||||
while (XCheckIfEvent(xnestDisplay, &X, xnestNotExposurePredicate, NULL)) {
|
xorg_list_for_each_entry_safe(walk, tmp, &xnestUpstreamInfo.eventQueue.entry, entry) {
|
||||||
xnest_handle_event(X);
|
xnest_handle_event(walk->event);
|
||||||
|
xorg_list_del(&walk->entry);
|
||||||
|
free(walk->event);
|
||||||
|
free(walk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xcb_flush(xnestUpstreamInfo.conn);
|
||||||
|
|
||||||
|
int err = xcb_connection_has_error(xnestUpstreamInfo.conn);
|
||||||
|
if (err) {
|
||||||
|
ErrorF("Xnest: upsream connection error: %d\n", err);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* fetch new events from xcb */
|
||||||
|
xcb_generic_event_t *event = NULL;
|
||||||
|
while ((event = xcb_poll_for_event(xnestUpstreamInfo.conn))) {
|
||||||
|
xnest_handle_event(event);
|
||||||
|
free(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
xcb_flush(xnestUpstreamInfo.conn);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,9 @@ is" without express or implied warranty.
|
||||||
|
|
||||||
#include <X11/Xmd.h>
|
#include <X11/Xmd.h>
|
||||||
|
|
||||||
#define ProcessedExpose (LASTEvent + 1)
|
|
||||||
|
|
||||||
extern CARD32 lastEventTime;
|
extern CARD32 lastEventTime;
|
||||||
|
|
||||||
void SetTimeSinceLastInputEvent(void);
|
void SetTimeSinceLastInputEvent(void);
|
||||||
void xnestCollectExposures(void);
|
|
||||||
void xnestCollectEvents(void);
|
void xnestCollectEvents(void);
|
||||||
void xnestQueueKeyEvent(int type, unsigned int keycode);
|
void xnestQueueKeyEvent(int type, unsigned int keycode);
|
||||||
|
|
||||||
|
|
|
@ -142,21 +142,13 @@ xnestGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
|
||||||
free(reply);
|
free(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
|
||||||
xnestBitBlitPredicate(Display * dpy, XEvent * event, char *args)
|
|
||||||
{
|
|
||||||
return event->type == GraphicsExpose || event->type == NoExpose;
|
|
||||||
}
|
|
||||||
|
|
||||||
static RegionPtr
|
static RegionPtr
|
||||||
xnestBitBlitHelper(GCPtr pGC)
|
xnestBitBlitHelper(GCPtr pGC)
|
||||||
{
|
{
|
||||||
if (!pGC->graphicsExposures)
|
if (!pGC->graphicsExposures)
|
||||||
return NullRegion;
|
return NullRegion;
|
||||||
else {
|
else {
|
||||||
XEvent event;
|
|
||||||
RegionPtr pReg, pTmpReg;
|
RegionPtr pReg, pTmpReg;
|
||||||
BoxRec Box;
|
|
||||||
Bool pending, overlap;
|
Bool pending, overlap;
|
||||||
|
|
||||||
pReg = RegionCreate(NULL, 1);
|
pReg = RegionCreate(NULL, 1);
|
||||||
|
@ -164,24 +156,43 @@ xnestBitBlitHelper(GCPtr pGC)
|
||||||
if (!pReg || !pTmpReg)
|
if (!pReg || !pTmpReg)
|
||||||
return NullRegion;
|
return NullRegion;
|
||||||
|
|
||||||
|
xcb_flush(xnestUpstreamInfo.conn);
|
||||||
|
|
||||||
pending = TRUE;
|
pending = TRUE;
|
||||||
while (pending) {
|
while (pending) {
|
||||||
XIfEvent(xnestDisplay, &event, xnestBitBlitPredicate, NULL);
|
xcb_generic_event_t *event = xcb_wait_for_event(xnestUpstreamInfo.conn);
|
||||||
|
if (!event) {
|
||||||
switch (event.type) {
|
|
||||||
case NoExpose:
|
|
||||||
pending = FALSE;
|
pending = FALSE;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case GraphicsExpose:
|
switch (event->response_type & ~0x80) {
|
||||||
Box.x1 = event.xgraphicsexpose.x;
|
case NoExpose:
|
||||||
Box.y1 = event.xgraphicsexpose.y;
|
pending = FALSE;
|
||||||
Box.x2 = event.xgraphicsexpose.x + event.xgraphicsexpose.width;
|
free(event);
|
||||||
Box.y2 = event.xgraphicsexpose.y + event.xgraphicsexpose.height;
|
break;
|
||||||
RegionReset(pTmpReg, &Box);
|
|
||||||
RegionAppend(pReg, pTmpReg);
|
case GraphicsExpose:
|
||||||
pending = event.xgraphicsexpose.count;
|
{
|
||||||
break;
|
xcb_graphics_exposure_event_t* ev = (xcb_graphics_exposure_event_t*)event;
|
||||||
|
BoxRec Box = {
|
||||||
|
.x1 = ev->x,
|
||||||
|
.y1 = ev->y,
|
||||||
|
.x2 = ev->x + ev->width,
|
||||||
|
.y2 = ev->y + ev->height,
|
||||||
|
};
|
||||||
|
RegionReset(pTmpReg, &Box);
|
||||||
|
RegionAppend(pReg, pTmpReg);
|
||||||
|
pending = ev->count;
|
||||||
|
free(event);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
struct xnest_event_queue *q = malloc(sizeof(struct xnest_event_queue));
|
||||||
|
q->event = event;
|
||||||
|
xorg_list_add(&q->entry, &xnestUpstreamInfo.eventQueue.entry);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,7 @@ is" without express or implied warranty.
|
||||||
void
|
void
|
||||||
xnestBlockHandler(void *blockData, void *timeout)
|
xnestBlockHandler(void *blockData, void *timeout)
|
||||||
{
|
{
|
||||||
xnestCollectExposures();
|
xnestCollectEvents();
|
||||||
XFlush(xnestDisplay);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -37,6 +37,8 @@ void xnest_upstream_setup(void) {
|
||||||
for (int i = 0; i < xnestUpstreamInfo.screenId; ++i)
|
for (int i = 0; i < xnestUpstreamInfo.screenId; ++i)
|
||||||
xcb_screen_next (&iter);
|
xcb_screen_next (&iter);
|
||||||
xnestUpstreamInfo.screenInfo = iter.data;
|
xnestUpstreamInfo.screenInfo = iter.data;
|
||||||
|
|
||||||
|
xorg_list_init(&xnestUpstreamInfo.eventQueue.entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* retrieve upstream GC XID for our xserver GC */
|
/* retrieve upstream GC XID for our xserver GC */
|
||||||
|
|
|
@ -7,11 +7,19 @@
|
||||||
|
|
||||||
#include <xcb/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
|
|
||||||
|
#include "include/list.h"
|
||||||
|
|
||||||
|
struct xnest_event_queue {
|
||||||
|
struct xorg_list entry;
|
||||||
|
xcb_generic_event_t *event;
|
||||||
|
};
|
||||||
|
|
||||||
struct xnest_upstream_info {
|
struct xnest_upstream_info {
|
||||||
xcb_connection_t *conn;
|
xcb_connection_t *conn;
|
||||||
uint32_t screenId;
|
uint32_t screenId;
|
||||||
const xcb_screen_t *screenInfo;
|
const xcb_screen_t *screenInfo;
|
||||||
const xcb_setup_t *setup;
|
const xcb_setup_t *setup;
|
||||||
|
struct xnest_event_queue eventQueue;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct xnest_upstream_info xnestUpstreamInfo;
|
extern struct xnest_upstream_info xnestUpstreamInfo;
|
||||||
|
|
Loading…
Reference in New Issue