wip
This commit is contained in:
parent
68f1039aab
commit
dc3ffbb510
|
|
@ -58,7 +58,7 @@ xnestCreateColormap(ColormapPtr pCmap)
|
|||
XnestScreenPtr xnscr = xnestScreenPriv(pCmap->pScreen);
|
||||
|
||||
xnestColormapPriv(pCmap)->colormap =
|
||||
XCreateColormap(xnestDisplay,
|
||||
XCreateColormap(xnscr->upstreamDisplay,
|
||||
xnscr->rootWindow,
|
||||
xnestVisual(pVisual),
|
||||
(pVisual->class & DynamicClass) ? AllocAll : AllocNone);
|
||||
|
|
@ -68,7 +68,7 @@ xnestCreateColormap(ColormapPtr pCmap)
|
|||
colors = xallocarray(ncolors, sizeof(XColor));
|
||||
for (i = 0; i < ncolors; i++)
|
||||
colors[i].pixel = i;
|
||||
XQueryColors(xnestDisplay, xnestColormap(pCmap), colors, ncolors);
|
||||
XQueryColors(xnscr->upstreamDisplay, xnestColormap(pCmap), colors, ncolors);
|
||||
for (i = 0; i < ncolors; i++) {
|
||||
pCmap->red[i].co.local.red = colors[i].red;
|
||||
pCmap->red[i].co.local.green = colors[i].red;
|
||||
|
|
@ -81,7 +81,7 @@ xnestCreateColormap(ColormapPtr pCmap)
|
|||
colors = xallocarray(ncolors, sizeof(XColor));
|
||||
for (i = 0; i < ncolors; i++)
|
||||
colors[i].pixel = i;
|
||||
XQueryColors(xnestDisplay, xnestColormap(pCmap), colors, ncolors);
|
||||
XQueryColors(xnscr->upstreamDisplay, xnestColormap(pCmap), colors, ncolors);
|
||||
for (i = 0; i < ncolors; i++) {
|
||||
pCmap->red[i].co.local.red = colors[i].red;
|
||||
pCmap->red[i].co.local.green = colors[i].green;
|
||||
|
|
@ -108,7 +108,7 @@ xnestCreateColormap(ColormapPtr pCmap)
|
|||
if (blue > pVisual->blueMask)
|
||||
blue = 0L;
|
||||
}
|
||||
XQueryColors(xnestDisplay, xnestColormap(pCmap), colors, ncolors);
|
||||
XQueryColors(xnscr->upstreamDisplay, xnestColormap(pCmap), colors, ncolors);
|
||||
for (i = 0; i < ncolors; i++) {
|
||||
pCmap->red[i].co.local.red = colors[i].red;
|
||||
pCmap->green[i].co.local.green = colors[i].green;
|
||||
|
|
@ -133,7 +133,8 @@ xnestCreateColormap(ColormapPtr pCmap)
|
|||
void
|
||||
xnestDestroyColormap(ColormapPtr pCmap)
|
||||
{
|
||||
XFreeColormap(xnestDisplay, xnestColormap(pCmap));
|
||||
XnestScreenPtr xnscr = xnestScreenPriv(pCmap->pScreen);
|
||||
XFreeColormap(xnscr->upstreamDisplay, xnestColormap(pCmap));
|
||||
}
|
||||
|
||||
#define SEARCH_PREDICATE \
|
||||
|
|
@ -219,7 +220,7 @@ xnestSetInstalledColormapWindows(ScreenPtr pScreen)
|
|||
if (!xnestSameInstalledColormapWindows(icws.windows, icws.numWindows)) {
|
||||
free(xnestOldInstalledColormapWindows);
|
||||
|
||||
XSetWMColormapWindows(xnestDisplay, xnscr->rootWindow,
|
||||
XSetWMColormapWindows(xnscr->upstreamDisplay, xnscr->rootWindow,
|
||||
icws.windows, numWindows);
|
||||
|
||||
xnestOldInstalledColormapWindows = icws.windows;
|
||||
|
|
@ -247,7 +248,7 @@ xnestSetInstalledColormapWindows(ScreenPtr pScreen)
|
|||
pScreen->defColormap, X11_RESTYPE_COLORMAP,
|
||||
serverClient, DixUseAccess);
|
||||
|
||||
XSetWindowColormap(xnestDisplay, xnscr->rootWindow, xnestColormap(pCmap));
|
||||
XSetWindowColormap(xnscr->upstreamDisplay, xnscr->rootWindow, xnestColormap(pCmap));
|
||||
}
|
||||
#endif /* DUMB_WINDOW_MANAGERS */
|
||||
}
|
||||
|
|
@ -262,7 +263,7 @@ xnestSetScreenSaverColormapWindow(ScreenPtr pScreen)
|
|||
|
||||
free(xnestOldInstalledColormapWindows);
|
||||
|
||||
XSetWMColormapWindows(xnestDisplay, xnscr->rootWindow,
|
||||
XSetWMColormapWindows(xnscr->upstreamDisplay, xnscr->rootWindow,
|
||||
&xnscr->screenSaverWindow, 1);
|
||||
|
||||
xnestOldInstalledColormapWindows = NULL;
|
||||
|
|
@ -288,7 +289,7 @@ xnestDirectInstallColormaps(ScreenPtr pScreen)
|
|||
dixLookupResourceByType((void **) &pCmap, pCmapIDs[i], X11_RESTYPE_COLORMAP,
|
||||
serverClient, DixInstallAccess);
|
||||
if (pCmap)
|
||||
XInstallColormap(xnestDisplay, xnestColormap(pCmap));
|
||||
XInstallColormap(xnscr->upstreamDisplay, xnestColormap(pCmap));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -309,7 +310,7 @@ xnestDirectUninstallColormaps(ScreenPtr pScreen)
|
|||
dixLookupResourceByType((void **) &pCmap, pCmapIDs[i], X11_RESTYPE_COLORMAP,
|
||||
serverClient, DixUninstallAccess);
|
||||
if (pCmap)
|
||||
XUninstallColormap(xnestDisplay, xnestColormap(pCmap));
|
||||
XUninstallColormap(xnscr->upstreamDisplay, xnestColormap(pCmap));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -365,8 +366,10 @@ xnestListInstalledColormaps(ScreenPtr pScreen, Colormap * pCmapIDs)
|
|||
void
|
||||
xnestStoreColors(ColormapPtr pCmap, int nColors, xColorItem * pColors)
|
||||
{
|
||||
XnestScreenPtr xnscr = xnestScreenPriv(pScreen);
|
||||
|
||||
if (pCmap->pVisual->class & DynamicClass)
|
||||
XStoreColors(xnestDisplay, xnestColormap(pCmap),
|
||||
XStoreColors(xnscr->upstreamDisplay, xnestColormap(pCmap),
|
||||
(XColor *) pColors, nColors);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
|||
XColor fg_color, bg_color;
|
||||
unsigned long valuemask;
|
||||
XGCValues values;
|
||||
XnestScreenPtr xscr = xnestScreenPriv(pScreen);
|
||||
XnestScreenPtr xnscr = xnestScreenPriv(pScreen);
|
||||
|
||||
valuemask = GCFunction |
|
||||
GCPlaneMask | GCForeground | GCBackground | GCClipMask;
|
||||
|
|
@ -55,24 +55,24 @@ xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
|||
values.background = 0L;
|
||||
values.clip_mask = None;
|
||||
|
||||
XChangeGC(xnestDisplay, xnestBitmapGC, valuemask, &values);
|
||||
XChangeGC(xnscr->upstreamDisplay, xnestBitmapGC, valuemask, &values);
|
||||
|
||||
source = XCreatePixmap(xnestDisplay,
|
||||
xscr->rootWindow,
|
||||
source = XCreatePixmap(xnscr->upstreamDisplay,
|
||||
xnscr->rootWindow,
|
||||
pCursor->bits->width, pCursor->bits->height, 1);
|
||||
|
||||
mask = XCreatePixmap(xnestDisplay,
|
||||
xscr->rootWindow,
|
||||
mask = XCreatePixmap(xnscr->upstreamDisplay,
|
||||
xnscr->rootWindow,
|
||||
pCursor->bits->width, pCursor->bits->height, 1);
|
||||
|
||||
ximage = XCreateImage(xnestDisplay,
|
||||
ximage = XCreateImage(xnscr->upstreamDisplay,
|
||||
xnestDefaultVisual(pScreen),
|
||||
1, XYBitmap, 0,
|
||||
(char *) pCursor->bits->source,
|
||||
pCursor->bits->width,
|
||||
pCursor->bits->height, BitmapPad(xnestDisplay), 0);
|
||||
|
||||
XPutImage(xnestDisplay, source, xnestBitmapGC, ximage,
|
||||
XPutImage(xnscr->upstreamDisplay, source, xnestBitmapGC, ximage,
|
||||
0, 0, 0, 0, pCursor->bits->width, pCursor->bits->height);
|
||||
|
||||
XFree(ximage);
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ xnestOpenDisplay(int argc, char *argv[])
|
|||
|
||||
/* fill out the first screen and later copy it to all others */
|
||||
XnestScreenPtr xnscr = XnestScreenByIdx(0);
|
||||
xnscr->clonedFrom = -1;
|
||||
|
||||
if (!xnestDoFullGeneration)
|
||||
return;
|
||||
|
|
@ -187,13 +188,13 @@ xnestOpenDisplay(int argc, char *argv[])
|
|||
screensaver_height,
|
||||
xnestWhitePixel,
|
||||
xnestBlackPixel,
|
||||
DefaultDepth(xndscr->display,
|
||||
DefaultDepth(xnscr->upstreamDisplay,
|
||||
DefaultScreen(xnscr->upstreamDisplay)));
|
||||
|
||||
/* now copy over the remaining screens */
|
||||
for (i=1; i<xnestNumScreens; i++) {
|
||||
XnestScreenPtr s2 = XnestScreenByIdx(i);
|
||||
s2->display = xnscr->upstreamDisplay;
|
||||
s2->upstreamDisplay = xnscr->upstreamDisplay;
|
||||
s2->clonedFrom = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,13 +64,23 @@ DeviceIntPtr xnestKeyboardDevice = NULL;
|
|||
void
|
||||
xnestBell(int volume, DeviceIntPtr pDev, void *ctrl, int cls)
|
||||
{
|
||||
XBell(xnestDisplay, volume);
|
||||
int i;
|
||||
for (i=0; x<xnestNumDisplays; i++) {
|
||||
XnestScreenPtr xnscr = xnestScreenByIdx(i);
|
||||
if (xnscr->clonedFrom >= 0)
|
||||
XBell(xnscr->upstreamDisplay, volume);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
DDXRingBell(int volume, int pitch, int duration)
|
||||
{
|
||||
XBell(xnestDisplay, volume);
|
||||
int i;
|
||||
for (i=0; x<xnestNumDisplays; i++) {
|
||||
XnestScreenPtr xnscr = xnestScreenByIdx(i);
|
||||
if (xnscr->clonedFrom >= 0)
|
||||
XBell(xnscr->upstreamDisplay, volume);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -79,7 +89,7 @@ xnestChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl * ctrl)
|
|||
#if 0
|
||||
unsigned long value_mask;
|
||||
XKeyboardControl values;
|
||||
int i;
|
||||
int i,j;
|
||||
|
||||
value_mask = KBKeyClickPercent |
|
||||
KBBellPercent | KBBellPitch | KBBellDuration | KBAutoRepeatMode;
|
||||
|
|
@ -91,7 +101,11 @@ xnestChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl * ctrl)
|
|||
values.auto_repeat_mode = ctrl->autoRepeat ?
|
||||
AutoRepeatModeOn : AutoRepeatModeOff;
|
||||
|
||||
XChangeKeyboardControl(xnestDisplay, value_mask, &values);
|
||||
for (j=0; x<xnestNumDisplays; j++) {
|
||||
XnestScreenPtr xnscr = xnestScreenByIdx(j);
|
||||
if (xnscr->clonedFrom >= 0)
|
||||
XChangeKeyboardControl(xnscr->upstreamDisplay, value_mask, &values);
|
||||
}
|
||||
|
||||
/*
|
||||
value_mask = KBKey | KBAutoRepeatMode;
|
||||
|
|
@ -105,6 +119,12 @@ xnestChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl * ctrl)
|
|||
values.led_mode =
|
||||
(ctrl->leds & (1 << (i - 1))) ? LedModeOn : LedModeOff;
|
||||
XChangeKeyboardControl(xnestDisplay, value_mask, &values);
|
||||
|
||||
for (j=0; x<xnestNumDisplays; j++) {
|
||||
XnestScreenPtr xnscr = xnestScreenByIdx(j);
|
||||
if (xnscr->clonedFrom >= 0)
|
||||
XChangeKeyboardControl(xnscr->upstreamDisplay, value_mask, &values);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,8 +38,15 @@ DeviceIntPtr xnestPointerDevice = NULL;
|
|||
void
|
||||
xnestChangePointerControl(DeviceIntPtr pDev, PtrCtrl * ctrl)
|
||||
{
|
||||
XChangePointerControl(xnestDisplay, True, True,
|
||||
int i;
|
||||
// we have to send it to all upstream servers, but only once per connection
|
||||
for (i=0; i<xnestNumScreens; i++) {
|
||||
XnestScreenPtr xnscr = XnestScreenByIdx(i);
|
||||
if (xnscr->clonedFrom >= 0) { // skip the cloned ones
|
||||
XChangePointerControl(xnscr->upstreamDisplay, True, True,
|
||||
ctrl->num, ctrl->den, ctrl->threshold);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
Loading…
Reference in New Issue