mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-04 20:20:13 +01:00
Autofooery and stubbing out of 2nd attemt at Xscreen.
This commit is contained in:
parent
4b7f0b3dbb
commit
dbacc8aa06
15 changed files with 410 additions and 44 deletions
16
configure.ac
16
configure.ac
|
|
@ -429,6 +429,7 @@ AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server
|
|||
AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=auto])
|
||||
AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes])
|
||||
AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
|
||||
AC_ARG_ENABLE(xscreen, AS_HELP_STRING([--enable-xnest], [Build Xscreen server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
|
||||
AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto])
|
||||
AC_ARG_ENABLE(xprint, AS_HELP_STRING([--enable-xprint], [Build Xprint extension and server (default: auto)]), [XPRINT=$enableval], [XPRINT=auto])
|
||||
AC_ARG_ENABLE(xgl, AS_HELP_STRING([--enable-xgl], [Build Xgl server (default: no)]), [XGL=$enableval], [XGL=no])
|
||||
|
|
@ -945,6 +946,20 @@ if test "x$XNEST" = xyes; then
|
|||
AC_SUBST([XNEST_LIBS])
|
||||
fi
|
||||
|
||||
dnl Xscreen DDX
|
||||
|
||||
AC_MSG_CHECKING([whether to build Xscreen DDX])
|
||||
PKG_CHECK_MODULES(XSCREENMODULES, [xfont xext xau xcb xcb-shape xcb-image xcb-aux xcb-icccm $XDMCP_MODULES], [have_xscreen=yes], [have_xscreen=no])
|
||||
if test "x$XSCREEN" = xauto; then
|
||||
XSCREEN="$have_xscreen"
|
||||
fi
|
||||
AC_MSG_RESULT([$XSCREEN])
|
||||
AM_CONDITIONAL(XSCREEN, [test "x$XSCREEN" = xyes])
|
||||
|
||||
if test "x$XSCREEN" = xyes; then
|
||||
XSCREEN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB"
|
||||
AC_SUBST([XSCREEN_LIBS])
|
||||
fi
|
||||
|
||||
dnl Xorg DDX
|
||||
|
||||
|
|
@ -1704,6 +1719,7 @@ hw/xgl/glx/module/Makefile
|
|||
hw/xgl/glxext/Makefile
|
||||
hw/xgl/glxext/module/Makefile
|
||||
hw/xnest/Makefile
|
||||
hw/xscreen/Makefile
|
||||
hw/xwin/Makefile
|
||||
hw/darwin/Makefile
|
||||
hw/kdrive/Makefile
|
||||
|
|
|
|||
|
|
@ -14,6 +14,10 @@ if XNEST
|
|||
XNEST_SUBDIRS = xnest
|
||||
endif
|
||||
|
||||
if XNEST
|
||||
XSCREEN_SUBDIRS = xscreen
|
||||
endif
|
||||
|
||||
if XWIN
|
||||
XWIN_SUBDIRS = xwin
|
||||
endif
|
||||
|
|
@ -34,8 +38,9 @@ SUBDIRS = \
|
|||
$(XWIN_SUBDIRS) \
|
||||
$(XVFB_SUBDIRS) \
|
||||
$(XNEST_SUBDIRS) \
|
||||
$(DMX_SUBDIRS) \
|
||||
$(KDRIVE_SUBDIRS)
|
||||
$(XSCREEN_SUBDIRS) \
|
||||
$(DMX_SUBDIRS) \
|
||||
$(KDRIVE_SUBDIRS)
|
||||
|
||||
DIST_SUBDIRS = dmx xfree86 vfb xnest xwin darwin kdrive xgl
|
||||
|
||||
|
|
|
|||
|
|
@ -233,6 +233,15 @@ void xnestHandleEvent(XCBGenericEvent *e)
|
|||
cev = (XCBConfigureNotifyEvent *)e;
|
||||
pWin = xnestWindowPtr(cev->window);
|
||||
pSib = xnestWindowPtr(cev->above_sibling);
|
||||
|
||||
xscreenHandleConfigure(pWin, pSib ? xnestWindow(pSib).xid : 0,
|
||||
cev->x, cev->y,
|
||||
cev->width, cev->height);
|
||||
break;
|
||||
#if 0
|
||||
cev = (XCBConfigureNotifyEvent *)e;
|
||||
pWin = xnestWindowPtr(cev->window);
|
||||
pSib = xnestWindowPtr(cev->above_sibling);
|
||||
pParent = pWin->parent;
|
||||
pScreen = pWin->drawable.pScreen;
|
||||
|
||||
|
|
@ -250,6 +259,9 @@ void xnestHandleEvent(XCBGenericEvent *e)
|
|||
cfg_data[i++] = 0;
|
||||
ConfigureWindow(pWin, cfg_mask, cfg_data, wClient(pWin));
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
case XCBReparentNotify:
|
||||
/*Reparent windows. This is to track non-xscreen managed windows and their
|
||||
* relationship to xscreen managed windows. It should be harmless to poke at
|
||||
|
|
@ -260,12 +272,13 @@ void xnestHandleEvent(XCBGenericEvent *e)
|
|||
pWin = xnestWindowPtr(ev_reparent->window);
|
||||
|
||||
ErrorF("ReparentNotify\n");
|
||||
DBG_xnestListWindows(XCBSetupRootsIter (XCBGetSetup (xnestConnection)).data->root);
|
||||
ErrorF("Reparenting %d to %d\n", (int) ev_reparent->window.xid, (int)ev_reparent->parent.xid);
|
||||
/*we'll assume the root can't be reparented, and as such, pParent is _always_ valid*/
|
||||
xnestReparentWindow(pWin, pParent, ev_reparent->x, ev_reparent->y, wClient(pWin));
|
||||
break;
|
||||
//DBG_xnestListWindows(XCBSetupRootsIter(XCBGetSetup (xnestConnection)).data->root);
|
||||
|
||||
break;
|
||||
#endif
|
||||
case XCBCreateNotify:
|
||||
ev_create = (XCBCreateNotifyEvent *)e;
|
||||
pParent = xnestWindowPtr(ev_create->parent);
|
||||
|
|
@ -275,7 +288,7 @@ void xnestHandleEvent(XCBGenericEvent *e)
|
|||
ErrorF("Adding new window\n");
|
||||
|
||||
/*track window*/
|
||||
pWin = xnestTrackWindow(ev_create->window,
|
||||
pWin = xscreenTrackWindow(ev_create->window,
|
||||
pParent, /*parent WindowPtr*/
|
||||
ev_create->x, ev_create->y, /*x, y*/
|
||||
ev_create->width, ev_create->height,/*w, h*/
|
||||
|
|
@ -294,14 +307,13 @@ void xnestHandleEvent(XCBGenericEvent *e)
|
|||
}
|
||||
ErrorF("-- Added win %d\n", (int)pWin->drawable.id);
|
||||
ErrorF("\n\n---------CreateNotify--------\n\n");
|
||||
DBG_xnestListWindows(XCBSetupRootsIter (XCBGetSetup (xnestConnection)).data->root);
|
||||
//DBG_xnestListWindows(XCBSetupRootsIter(XCBGetSetup (xnestConnection)).data->root);
|
||||
break;
|
||||
case XCBNoExposure:
|
||||
case XCBGraphicsExposure:
|
||||
case XCBCirculateNotify:
|
||||
|
||||
case XCBGravityNotify:
|
||||
#if 0
|
||||
case XCBMapNotify:
|
||||
ev_map = (XCBMapNotifyEvent *)e;
|
||||
pWin = xnestWindowPtr(ev_map->window);
|
||||
|
|
@ -317,7 +329,6 @@ void xnestHandleEvent(XCBGenericEvent *e)
|
|||
pWin->mapped = 0;
|
||||
break;
|
||||
|
||||
#endif
|
||||
default:
|
||||
ErrorF("****xnest warning: unhandled event %d\n", e->response_type & ~0x80);
|
||||
ErrorF("****Sequence number: %d\n", e->sequence);
|
||||
|
|
@ -338,8 +349,8 @@ void xnestCollectEvents()
|
|||
if (!e->response_type) {
|
||||
err = (XCBGenericError *)e;
|
||||
ErrorF("****** File: %s Error: %d, Sequence %d\n", __FILE__, err->error_code, err->sequence);
|
||||
|
||||
} else {
|
||||
ErrorF("Handling event %d\n", e->response_type & ~0x80);
|
||||
xnestHandleEvent(e);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,18 +31,21 @@ is" without express or implied warranty.
|
|||
#include "Xnest.h"
|
||||
|
||||
#include "Display.h"
|
||||
#include "WindowFuncs.h"
|
||||
#include "Events.h"
|
||||
#include "Handlers.h"
|
||||
|
||||
void
|
||||
xnestBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadMask)
|
||||
void xnestBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadMask)
|
||||
{
|
||||
xnestCollectEvents();
|
||||
XCBFlush(xnestConnection);
|
||||
DBG_xnestListWindows(XCBSetupRootsIter (XCBGetSetup (xnestConnection)).data->root);
|
||||
ErrorF("\n\n\nBlock\n");
|
||||
|
||||
xnestCollectEvents();
|
||||
XCBFlush(xnestConnection);
|
||||
}
|
||||
|
||||
void
|
||||
xnestWakeupHandler(pointer blockData, int result, pointer pReadMask)
|
||||
void xnestWakeupHandler(pointer blockData, int result, pointer pReadMask)
|
||||
{
|
||||
ErrorF("\n\n\nWakeup\n");
|
||||
xnestCollectEvents();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ Bool xnestCreateWindow(WindowPtr pWin)
|
|||
XCBGrabServer(xnestConnection);
|
||||
xscreenTrackChildren(pWin);
|
||||
XCBUngrabServer(xnestConnection);
|
||||
|
||||
ErrorF("Root window: %d\n", screen->root);
|
||||
ErrorF(__FUNCTION__);
|
||||
DBG_xnestListWindows(XCBSetupRootsIter (XCBGetSetup (xnestConnection)).data->root);
|
||||
|
|
@ -223,7 +224,7 @@ void xnestConfigureWindow(WindowPtr pWin, unsigned int mask)
|
|||
unsigned int valuemask;
|
||||
XCBParamsConfigureWindow values;
|
||||
|
||||
if (mask & XCBConfigWindowSibling &&
|
||||
if ((mask & XCBConfigWindowSibling) &&
|
||||
xnestWindowPriv(pWin)->parent.xid != xnestWindowParent(pWin).xid) {
|
||||
XCBReparentWindow(xnestConnection,
|
||||
xnestWindow(pWin),
|
||||
|
|
|
|||
|
|
@ -43,8 +43,16 @@ void DBG_xnestListWindows(XCBWINDOW w)
|
|||
{
|
||||
XCBWINDOW *child;
|
||||
WindowPtr pWin;
|
||||
XCBGenericError *err;
|
||||
XCBQueryTreeCookie qcook;
|
||||
XCBQueryTreeRep *qrep;
|
||||
XCBGetGeometryCookie gcook;
|
||||
XCBGetGeometryRep *grep;
|
||||
XCBGetGeometryRep back_grep;
|
||||
XCBGetWindowAttributesCookie acook;
|
||||
XCBGetWindowAttributesRep *arep;
|
||||
XCBGetWindowAttributesRep back_arep;
|
||||
|
||||
static int splvl = 0;
|
||||
int i,j;
|
||||
|
||||
|
|
@ -54,7 +62,7 @@ void DBG_xnestListWindows(XCBWINDOW w)
|
|||
* pScreen = xnestScreen(w);
|
||||
*/
|
||||
qcook = XCBQueryTree(xnestConnection, w);
|
||||
qrep = XCBQueryTreeReply(xnestConnection, qcook, NULL);
|
||||
qrep = XCBQueryTreeReply(xnestConnection, qcook, &err);
|
||||
child = XCBQueryTreeChildren(qrep);
|
||||
/* Walk through the windows, initializing the privates.
|
||||
* FIXME: initialize x, y, and pWin contents.. how? */
|
||||
|
|
@ -63,9 +71,36 @@ void DBG_xnestListWindows(XCBWINDOW w)
|
|||
pWin = xnestWindowPtr(child[i]);
|
||||
for (j=0; j<splvl; j++)
|
||||
ErrorF(" ");
|
||||
ErrorF("Window %d, pWin 0x%x ", w.xid, pWin);
|
||||
if (!pWin)
|
||||
ErrorF("********************WARNING: NULL WINDOW********************");
|
||||
|
||||
gcook = XCBGetGeometry(xnestConnection, (XCBDRAWABLE)child[i]);
|
||||
acook = XCBGetWindowAttributes(xnestConnection, child[i]);
|
||||
|
||||
grep = XCBGetGeometryReply(xnestConnection, gcook, &err);
|
||||
if (err) {
|
||||
ErrorF("Error %d\n", err->error_code);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
arep = XCBGetWindowAttributesReply(xnestConnection, acook, &err);
|
||||
if (err) {
|
||||
ErrorF("Error %d\n", err->error_code);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (pWin) {
|
||||
ErrorF("Window %d, Internal %d, (%d, %d), (%d, %d)....(%d, %d), (%d,%d), Event mask 0x%x",
|
||||
child[i].xid, pWin->drawable.id,
|
||||
pWin->drawable.x, pWin->drawable.y,
|
||||
pWin->drawable.width, pWin->drawable.height,
|
||||
grep->x, grep->y,
|
||||
grep->width, grep->height,
|
||||
arep->your_event_mask);
|
||||
} else {
|
||||
ErrorF("Window %d, <NOT TRACKED INTERNALLY!!!!!!>, (%d, %d), (%d,%d), Event mask 0x%x",
|
||||
grep->x, grep->y,
|
||||
grep->width, grep->height,
|
||||
arep->your_event_mask);
|
||||
}
|
||||
ErrorF("\n");
|
||||
/*and recurse, adding this window's children*/
|
||||
splvl++;
|
||||
|
|
@ -82,7 +117,7 @@ void DBG_xnestListWindows(XCBWINDOW w)
|
|||
* This function is used to set up a window that's already been created
|
||||
* on the backing server, which means I don't want to actually _create_ it.
|
||||
**/
|
||||
WindowPtr xnestTrackWindow(XCBWINDOW w, WindowPtr pParent, int x, int y, int width, int height, int bw)
|
||||
WindowPtr xscreenTrackWindow(XCBWINDOW w, WindowPtr pParent, int x, int y, int width, int height, int bw)
|
||||
{
|
||||
WindowPtr pWin;
|
||||
ScreenPtr pScreen;
|
||||
|
|
@ -105,7 +140,7 @@ WindowPtr xnestTrackWindow(XCBWINDOW w, WindowPtr pParent, int x, int y, int wid
|
|||
pWin->optional = (WindowOptPtr)NULL;
|
||||
pWin->cursorIsNone = TRUE;
|
||||
|
||||
pWin->backingStore = NotUseful;
|
||||
pWin->backingStore = NotUseful;file:///home/ori/.mozilla/firefox/eysrj7gz.default/bookmarks.html
|
||||
pWin->DIXsaveUnder = FALSE;
|
||||
pWin->backStorage = (pointer) NULL;
|
||||
|
||||
|
|
@ -130,7 +165,7 @@ WindowPtr xnestTrackWindow(XCBWINDOW w, WindowPtr pParent, int x, int y, int wid
|
|||
#ifdef COMPOSITE
|
||||
pWin->redirectDraw = 0;
|
||||
#endif
|
||||
|
||||
|
||||
pWin->parent = pParent;
|
||||
pWin->drawable = pParent->drawable;
|
||||
|
||||
|
|
@ -138,6 +173,7 @@ WindowPtr xnestTrackWindow(XCBWINDOW w, WindowPtr pParent, int x, int y, int wid
|
|||
pWin->origin.y = y + bw;
|
||||
pWin->drawable.width = width;
|
||||
pWin->drawable.height = height;
|
||||
pWin->borderWidth = bw;
|
||||
pWin->drawable.x = pParent->drawable.x + x + bw;
|
||||
pWin->drawable.y = pParent->drawable.y + y + bw;
|
||||
pWin->drawable.type = DRAWABLE_WINDOW;
|
||||
|
|
@ -154,7 +190,7 @@ WindowPtr xnestTrackWindow(XCBWINDOW w, WindowPtr pParent, int x, int y, int wid
|
|||
xnestWindowPriv(pWin)->height = pWin->drawable.height;
|
||||
xnestWindowPriv(pWin)->sibling_above = (XCBWINDOW){0};
|
||||
xnestWindowPriv(pWin)->owner = XSCREEN_OWNED_BACKING;
|
||||
|
||||
|
||||
pWin->borderIsPixel = pParent->borderIsPixel;
|
||||
pWin->border = pParent->border;
|
||||
if (pWin->borderIsPixel == FALSE)
|
||||
|
|
@ -171,6 +207,7 @@ WindowPtr xnestTrackWindow(XCBWINDOW w, WindowPtr pParent, int x, int y, int wid
|
|||
pWin->valdata = NULL;
|
||||
|
||||
REGION_NULL(pScreen, &pWin->winSize);
|
||||
xnestWindowPriv(pWin)->clip_shape = NULL;
|
||||
REGION_NULL(pScreen, &pWin->borderSize);
|
||||
REGION_NULL(pScreen, &pWin->clipList);
|
||||
REGION_NULL(pScreen, &pWin->borderClip);
|
||||
|
|
@ -179,16 +216,73 @@ WindowPtr xnestTrackWindow(XCBWINDOW w, WindowPtr pParent, int x, int y, int wid
|
|||
|
||||
SetWinSize (pWin);
|
||||
SetBorderSize (pWin);
|
||||
/*FIXME! THIS IS FUCKED. ONLY FOR TESTING.*/
|
||||
/*FIXME! THIS IS FUCKED. ONLY FOR TESTING Need to actually get the resolution properly.*/
|
||||
pWin->drawable.depth = 24;
|
||||
return pWin;
|
||||
}
|
||||
|
||||
int xscreenHandleConfigure(WindowPtr pWin, XCBWINDOW sib, int x, int y, int w, int h, int bw)
|
||||
{
|
||||
WindowPtr pSib = NullWindow;
|
||||
WindowPtr pParent = pWin->parent;
|
||||
xEvent event;
|
||||
|
||||
if (xnestWindowPriv(pWin)->owner == XSCREEN_OWNED_XSCREEN){
|
||||
event.u.u.type = ConfigureNotify;
|
||||
event.u.configureNotify.window = pWin->drawable.id;
|
||||
if (pSib)
|
||||
event.u.configureNotify.aboveSibling = sib.xid;
|
||||
else
|
||||
event.u.configureNotify.aboveSibling = 0;
|
||||
event.u.configureNotify.x = x;
|
||||
event.u.configureNotify.y = y;
|
||||
event.u.configureNotify.width = w;
|
||||
event.u.configureNotify.height = h;
|
||||
event.u.configureNotify.borderWidth = bw;
|
||||
event.u.configureNotify.override = pWin->overrideRedirect;
|
||||
DeliverEvents(pWin, &event, 1, NullWindow);
|
||||
} else {
|
||||
pWin->origin.x = x + bw;
|
||||
pWin->origin.y = y + bw;
|
||||
pWin->drawable.x = x + bw + pParent->drawable.x;
|
||||
pWin->drawable.y = y + bw + pParent->drawable.y;
|
||||
}
|
||||
}
|
||||
|
||||
void break_here(void){
|
||||
printf("********************************************************BREAK!!!\n");
|
||||
}
|
||||
|
||||
void xnestRemoveWindow(WindowPtr pWin)
|
||||
{
|
||||
WindowPtr pPrev;
|
||||
WindowPtr pNext;
|
||||
WindowPtr pParent;
|
||||
|
||||
pPrev = pWin->prevSib;
|
||||
pNext = pWin->nextSib;
|
||||
pParent = pWin->parent;
|
||||
|
||||
if (pPrev)
|
||||
pPrev->nextSib = pNext;
|
||||
else
|
||||
pParent->firstChild = pNext;
|
||||
|
||||
if (pNext)
|
||||
pNext->prevSib = pPrev;
|
||||
else
|
||||
pWin->lastChild = pPrev;
|
||||
|
||||
pWin->nextSib = NULL;
|
||||
pWin->prevSib = NULL;
|
||||
}
|
||||
|
||||
void xnestInsertWindow(WindowPtr pWin, WindowPtr pParent)
|
||||
{
|
||||
WindowPtr pPrev;
|
||||
|
||||
pPrev = RealChildHead(pParent);
|
||||
|
||||
pPrev = pParent->firstChild;// RealChildHead(pParent);
|
||||
pWin->parent = pParent;
|
||||
if (pPrev)
|
||||
{
|
||||
pWin->nextSib = pPrev->nextSib;
|
||||
|
|
@ -209,6 +303,8 @@ void xnestInsertWindow(WindowPtr pWin, WindowPtr pParent)
|
|||
pParent->lastChild = pWin;
|
||||
pParent->firstChild = pWin;
|
||||
}
|
||||
if (pWin->nextSib == pWin)
|
||||
break_here();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -246,15 +342,17 @@ void xscreenTrackChildren(WindowPtr pParent)
|
|||
gcook = XCBGetGeometry(xnestConnection, (XCBDRAWABLE)child[i]);
|
||||
grep = XCBGetGeometryReply(xnestConnection, gcook, NULL);
|
||||
|
||||
pWin = xnestTrackWindow(child[i], pParent, grep->x, grep->y, grep->width, grep->height, grep->border_width);
|
||||
pWin = xscreenTrackWindow(child[i], pParent, grep->x, grep->y, grep->width, grep->height, grep->border_width);
|
||||
|
||||
/*listen to events on the new window*/
|
||||
ev_mask = XCBEventMaskSubstructureNotify|XCBEventMaskStructureNotify;;
|
||||
XCBChangeWindowAttributes(xnestConnection, child[i], XCBCWEventMask, &ev_mask);
|
||||
} else {
|
||||
ErrorF("Skipping %d\n", child[i]);
|
||||
ErrorF("*****Skipping %d\n", child[i]);
|
||||
}
|
||||
|
||||
if (xnestWindowPriv(pWin)->owner != XSCREEN_OWNED_BACKING && pWin->parent)
|
||||
xnestRemoveWindow(pWin);
|
||||
xnestInsertWindow(pWin, pParent);
|
||||
/*and recurse, adding this window's children*/
|
||||
xscreenTrackChildren(pWin);
|
||||
|
|
@ -268,21 +366,20 @@ void xscreenTrackChildren(WindowPtr pParent)
|
|||
**/
|
||||
|
||||
int xnestReparentWindow(register WindowPtr pWin, register WindowPtr pParent,
|
||||
int x, int y, ClientPtr client)
|
||||
int x, int y, ClientPtr client)
|
||||
{
|
||||
WindowPtr pPrev, pPriorParent;
|
||||
Bool WasMapped = (Bool)(pWin->mapped);
|
||||
// Bool WasMapped = (Bool)(pWin->mapped);
|
||||
int bw = wBorderWidth (pWin);
|
||||
register ScreenPtr pScreen;
|
||||
|
||||
pScreen = pWin->drawable.pScreen;
|
||||
|
||||
if (WasMapped)
|
||||
UnmapWindow(pWin, FALSE);
|
||||
// if (WasMapped)
|
||||
// UnmapWindow(pWin, FALSE);
|
||||
|
||||
|
||||
/* take out of sibling chain */
|
||||
|
||||
pPriorParent = pPrev = pWin->parent;
|
||||
if (pPrev->firstChild == pWin)
|
||||
pPrev->firstChild = pWin->nextSib;
|
||||
|
|
@ -296,7 +393,7 @@ int xnestReparentWindow(register WindowPtr pWin, register WindowPtr pParent,
|
|||
|
||||
/* insert at begining of pParent */
|
||||
pWin->parent = pParent;
|
||||
pPrev = RealChildHead(pParent);
|
||||
pPrev = pParent->firstChild;//RealChildHead(pParent);
|
||||
if (pPrev)
|
||||
{
|
||||
pWin->nextSib = pPrev->nextSib;
|
||||
|
|
@ -317,6 +414,7 @@ int xnestReparentWindow(register WindowPtr pWin, register WindowPtr pParent,
|
|||
pParent->lastChild = pWin;
|
||||
pParent->firstChild = pWin;
|
||||
}
|
||||
|
||||
|
||||
pWin->origin.x = x + bw;
|
||||
pWin->origin.y = y + bw;
|
||||
|
|
@ -326,14 +424,12 @@ int xnestReparentWindow(register WindowPtr pWin, register WindowPtr pParent,
|
|||
/* clip to parent */
|
||||
SetWinSize (pWin);
|
||||
SetBorderSize (pWin);
|
||||
if (pScreen->ReparentWindow)
|
||||
(*pScreen->ReparentWindow)(pWin, pPriorParent);
|
||||
(*pScreen->PositionWindow)(pWin, pWin->drawable.x, pWin->drawable.y);
|
||||
ResizeChildrenWinSize(pWin, 0, 0, 0, 0);
|
||||
//CheckWindowOptionalNeed(pWin);
|
||||
//ResizeChildrenWinSize(pWin, 0, 0, 0, 0);
|
||||
//CheckWindowOptionalNeed(pWin);
|
||||
|
||||
if (WasMapped)
|
||||
MapWindow(pWin, client);
|
||||
// if (WasMapped)
|
||||
// MapWindow(pWin, client);
|
||||
RecalculateDeliverableEvents(pWin);
|
||||
return(Success);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef _WINDOWFUNCS_H_
|
||||
#define _WINDOWFUNCS_H_
|
||||
WindowPtr xnestTrackWindow(XCBWINDOW w, WindowPtr pParent, int x, int y, int width, int height, int bw);
|
||||
WindowPtr xscreenTrackWindow(XCBWINDOW w, WindowPtr pParent, int x, int y, int width, int height, int bw);
|
||||
void xnestInsertWindow(WindowPtr pWin, WindowPtr pParent);
|
||||
int xnestReparentWindow(register WindowPtr pWin, register WindowPtr pParent, int x, int y, ClientPtr client);
|
||||
void DBG_xnestListWindows(XCBWINDOW w);
|
||||
|
|
|
|||
20
hw/xscreen/Makefile.am
Normal file
20
hw/xscreen/Makefile.am
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
bin_PROGRAMS = Xscreen
|
||||
|
||||
Xscreen_SOURCES = xs-init.c \
|
||||
xs-input.c \
|
||||
xs-globals.h \
|
||||
xs-globals.c \
|
||||
xs-screen.h \
|
||||
xs-screen.c \
|
||||
$(top_srcdir)/Xext/dpmsstubs.c \
|
||||
$(top_srcdir)/Xi/stubs.c \
|
||||
$(top_srcdir)/mi/miinitext.c \
|
||||
$(top_srcdir)/fb/fbcmap.c
|
||||
|
||||
|
||||
Xscreen_LDADD = $(XORG_CORE_LIBS) \
|
||||
$(XNEST_LIBS) \
|
||||
$(XNESTMODULES_LIBS)
|
||||
|
||||
INCLUDES = $(XSCREENMODULES_CFLAGS)
|
||||
AM_CFLAGS = @SERVER_DEFINES@ -DNO_HW_ONLY_EXTS
|
||||
4
hw/xscreen/xs-globals.c
Normal file
4
hw/xscreen/xs-globals.c
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#include <X11/Xmd.h>
|
||||
#include <X11/XCB/xcb.h>
|
||||
|
||||
XCBConnection *xsConnection;
|
||||
1
hw/xscreen/xs-globals.h
Normal file
1
hw/xscreen/xs-globals.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
extern XCBConnection *xsConnection;
|
||||
117
hw/xscreen/xs-init.c
Normal file
117
hw/xscreen/xs-init.c
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
#ifdef HAVE_XSCREEN_CONFIG_H
|
||||
#include <xnest-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/* need to include Xmd before XCB stuff, or
|
||||
* things get redeclared.*/
|
||||
#include <X11/Xmd.h>
|
||||
#include <X11/XCB/xcb.h>
|
||||
#include <X11/XCB/xcb_aux.h>
|
||||
#include <X11/XCB/xproto.h>
|
||||
#include <X11/XCB/shape.h>
|
||||
|
||||
#include "gcstruct.h"
|
||||
#include "window.h"
|
||||
#include "windowstr.h"
|
||||
#include "pixmapstr.h"
|
||||
#include "colormapst.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "region.h"
|
||||
|
||||
#include "xs-globals.h"
|
||||
#include "xs-screen.h"
|
||||
|
||||
#include "mi.h"
|
||||
|
||||
/**
|
||||
* DIX hooks for initializing input and output.
|
||||
* XKB stuff is not supported yet, since it's currently missing in
|
||||
* XCB.
|
||||
**/
|
||||
void InitInput(int argc, char *argv[])
|
||||
{
|
||||
}
|
||||
|
||||
void xsInitPixmapFormats(const XCBSetup *setup, PixmapFormatRec fmts[])
|
||||
{
|
||||
XCBFORMAT *bs_fmts; /*formats on backing server*/
|
||||
int i;
|
||||
|
||||
bs_fmts = XCBSetupPixmapFormats(setup);
|
||||
for (i = 0; i < setup->pixmap_formats_len; i++) {
|
||||
fmts[i].depth = bs_fmts[i].depth;
|
||||
fmts[i].bitsPerPixel = bs_fmts[i].bits_per_pixel;
|
||||
fmts[i].scanlinePad = bs_fmts[i].scanline_pad;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Here is where we initialize the scren info and open the display.
|
||||
**/
|
||||
void InitOutput(ScreenInfo *si, int argc, char *argv[])
|
||||
{
|
||||
int screennum;
|
||||
const XCBSetup *setup;
|
||||
char *display;
|
||||
|
||||
/*FIXME: add a "-display" option*/
|
||||
/*Globals Globals Everywhere.*/
|
||||
xsConnection = XCBConnect(NULL, &screennum);
|
||||
|
||||
if (!xsConnection) { /* failure to connect */
|
||||
/* prettify the display name */
|
||||
display = getenv("DISPLAY");
|
||||
if (!display)
|
||||
display = "";
|
||||
FatalError("Unable to open display \"%s\".\n", display);
|
||||
}
|
||||
|
||||
setup = XCBGetSetup(xsConnection);
|
||||
|
||||
si->imageByteOrder = setup->image_byte_order;
|
||||
si->bitmapScanlineUnit = setup->bitmap_format_scanline_unit;
|
||||
si->bitmapBitOrder = setup->bitmap_format_bit_order;
|
||||
si->numPixmapFormats = setup->pixmap_formats_len;
|
||||
xsInitPixmapFormats(setup, si->formats);
|
||||
/**
|
||||
* NB: If anyone cares about multiple screens in Xscreen,
|
||||
* they can add support. I don't care about it, and I'm not
|
||||
* going to be putting in barely-tested code
|
||||
**/
|
||||
si->numScreens = 1;
|
||||
AddScreen(xsOpenScreen, argc, argv);
|
||||
/*si->numVideoScreens = ... what do I do with this?;*/
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* We don't really need to do cleanup here, at least not yet.
|
||||
* There'll be stuff later.
|
||||
**/
|
||||
void ddxGiveUp()
|
||||
{
|
||||
/*FIXME: close display properly*/
|
||||
}
|
||||
|
||||
void AbortDDX()
|
||||
{
|
||||
/*FIXME: close display properly*/
|
||||
}
|
||||
|
||||
/*We don't support arguments yet*/
|
||||
void ddxUseMsg()
|
||||
{
|
||||
ErrorF("No extra options yet\n");
|
||||
}
|
||||
|
||||
|
||||
void ddxInitGlobals()
|
||||
{
|
||||
}
|
||||
|
||||
int ddxProcessArgument(int argc, char *argv[], int i)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
56
hw/xscreen/xs-input.c
Normal file
56
hw/xscreen/xs-input.c
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
/**
|
||||
* Copyright 2006 Ori Bernstein
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software
|
||||
* and its documentation for any purpose is hereby granted without fee,
|
||||
* provided that the above copyright notice appear in all copies and that
|
||||
* both that copyright notice and this permission notice appear in
|
||||
* supporting documentation. Ori Bernstein makes no representations about
|
||||
* the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
**/
|
||||
|
||||
#ifdef HAVE_XSCREEN_CONFIG_H
|
||||
#include <xnest-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/* need to include Xmd before XCB stuff, or
|
||||
* things get redeclared.*/
|
||||
#include <X11/Xmd.h>
|
||||
#include <X11/XCB/xcb.h>
|
||||
#include <X11/XCB/xcb_aux.h>
|
||||
#include <X11/XCB/xproto.h>
|
||||
#include <X11/XCB/shape.h>
|
||||
|
||||
#include "gcstruct.h"
|
||||
#include "window.h"
|
||||
#include "windowstr.h"
|
||||
#include "pixmapstr.h"
|
||||
#include "colormapst.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "region.h"
|
||||
|
||||
#include "mi.h"
|
||||
|
||||
/**
|
||||
* DIX hook for processing input events.
|
||||
* Just hooks into the mi stuff.
|
||||
**/
|
||||
void ProcessInputEvents()
|
||||
{
|
||||
mieqProcessInputEvents();
|
||||
miPointerUpdate();
|
||||
}
|
||||
|
||||
/*The backing server should have already filtered invalid modifiers*/
|
||||
Bool LegalModifier(unsigned int key, DevicePtr pDev)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void OsVendorInit()
|
||||
{
|
||||
}
|
||||
|
||||
31
hw/xscreen/xs-screen.c
Normal file
31
hw/xscreen/xs-screen.c
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#ifdef HAVE_XSCREEN_CONFIG_H
|
||||
#include <xnest-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/* need to include Xmd before XCB stuff, or
|
||||
* things get redeclared.*/
|
||||
#include <X11/Xmd.h>
|
||||
#include <X11/XCB/xcb.h>
|
||||
#include <X11/XCB/xcb_aux.h>
|
||||
#include <X11/XCB/xproto.h>
|
||||
#include <X11/XCB/shape.h>
|
||||
|
||||
#include "gcstruct.h"
|
||||
#include "window.h"
|
||||
#include "windowstr.h"
|
||||
#include "pixmapstr.h"
|
||||
#include "colormapst.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "region.h"
|
||||
|
||||
#include "xs-globals.h"
|
||||
#include "xs-screen.h"
|
||||
|
||||
#include "mi.h"
|
||||
|
||||
Bool xsOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
6
hw/xscreen/xs-screen.h
Normal file
6
hw/xscreen/xs-screen.h
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef _XS_SCREEN_INCL_
|
||||
#define _XS_SCREEN_INCL_
|
||||
|
||||
Bool xsOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]);
|
||||
|
||||
#endif
|
||||
|
|
@ -591,8 +591,7 @@ typedef struct _ScreenInfo {
|
|||
int bitmapScanlinePad;
|
||||
int bitmapBitOrder;
|
||||
int numPixmapFormats;
|
||||
PixmapFormatRec
|
||||
formats[MAXFORMATS];
|
||||
PixmapFormatRec formats[MAXFORMATS];
|
||||
int arraySize;
|
||||
int numScreens;
|
||||
ScreenPtr screens[MAXSCREENS];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue