[Xquartz-dev] Possible white rectangle fix

Jeremy Huddleston jeremyhu at apple.com
Wed Dec 10 12:22:08 PST 2008


The check isn't there in Tiger's X11... I wonder where that might  
be... I'll do some grepping (man, Tiger's rootless code is so much  
cleaner than what's in xorg-server right now... qq):

RootlessRepositionWindow (WindowPtr pWin)
{
     RootlessWindowRec *winRec = WINREC (pWin);
     ScreenPtr pScreen = pWin->drawable.pScreen;
     xp_window_changes wc;
     int sx, sy;

     if (IsRoot (pWin))
         set_screen_origin (pWin);

     if (winRec == NULL)
         return;

     RootlessStopDrawing (pWin, FALSE);

     sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX;
     sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY;

     wc.x = sx + winRec->x;
     wc.y = sy + winRec->y;

     if (!rootlessHasRoot (pScreen))
         wc.window_level = normal_window_levels[winRec->level];
     else
         wc.window_level = rooted_window_levels[winRec->level];

     configure_window (winRec->wid, XP_ORIGIN | XP_WINDOW_LEVEL, &wc);

     RootlessReorderWindow (pWin);
}



xorg-server-1.4-apple:

void
RootlessRepositionWindow(WindowPtr pWin)
{
     RootlessWindowRec *winRec = WINREC(pWin);
     ScreenPtr pScreen = pWin->drawable.pScreen;

     if (winRec == NULL)
         return;

     RootlessStopDrawing(pWin, FALSE);
     SCREENREC(pScreen)->imp->MoveFrame(winRec->wid, pScreen,
                                        winRec->x + SCREEN_TO_GLOBAL_X,
                                        winRec->y + SCREEN_TO_GLOBAL_Y);

     RootlessReorderWindow(pWin);
}

void
xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY)
{
     TA_SERVER();

     xp_window_changes wc;

     wc.x = newX;
     wc.y = newY;
     //    ErrorF("xprMoveFrame(%d, %p, %d, %d)\n", wid, pScreen,  
newX, newY);
     xprConfigureWindow(x_cvt_vptr_to_uint(wid), XP_ORIGIN, &wc);
}

static inline xp_error
xprConfigureWindow(xp_window_id id, unsigned int mask,
                    const xp_window_changes *values)
{
     TA_SERVER();

     return xp_configure_window(id, mask, values);
}

---

Some places for me to start investigating...

(12:15:29 Wed Dec 10 2008 jeremy at tifa i386)
xc/programs/Xserver/hw/apple $ grep realized rootless*
rootless-common.c:    if (!pWin->realized)
rootless-screen.c:    if (!pWin->realized)
rootless-window.c:   realized, or we really need it (e.g. to attach  
VRAM surfaces to).
rootless-window.c:   windows do not eat memory until they are  
realized. */
rootless-window.c:	    if (!pWin->realized)
rootless-window.c:	    if (!pWin->realized)
rootless-window.c:	    if (!pWin->realized)
rootless-window.c:	if (!pTopWin->realized && pWin->realized)
rootless-window.c:	if (pTopWin->realized && !pWin->realized)
rootless-window.c:    if (pWin->realized && winRec != NULL
rootless-window.c:		   && (WINREC (newPrevW) == NULL || !newPrevW- 
 >realized))

(12:21:12 Wed Dec 10 2008 jeremy at tifa i386)
xc/programs/Xserver/hw/apple $ grep viewable rootless*
rootless-gc.c:// ValidateGC wraps gcOps iff dest is viewable. All  
others just unwrap&call.
rootless-gc.c:    if (((WindowPtr) pDrawable)->viewable)
rootless-screen.c:                if (pChild->viewable) {
rootless-val-tree.c: *	regions for pParent and its children. Only  
viewable windows are
rootless-val-tree.c:		if (pChild->viewable)
rootless-val-tree.c:		if (pChild->viewable)
rootless-val-tree.c:		if (pChild->viewable)
rootless-val-tree.c:	    if (pChild->viewable) {
rootless-val-tree.c:		 * If the child is viewable, we want to remove  
its extents
rootless-val-tree.c:	if (pChild->viewable)
rootless-val-tree.c:        if (pWin->viewable) {
rootless-window.c:    if (winRec != NULL && pWin->viewable)


On Dec 10, 2008, at 08:25, George Peter Staplin wrote:

> Quoted Richard Tobin <richard at inf.ed.ac.uk>:
>
>> In RootlessRepositionWindow() in rootlessWindow.c, change the
>> call to RootlessReorderWindow() so that it only happens if the
>> window is realized:
>>
>>    if(pWin->realized)
>> 	RootlessReorderWindow(pWin);
>>
>> I don't know if this is the right way to do it, but it eliminates the
>> white rectangle problem for me.
>>
>> -- Richard
>
> That's very interesting :)
>
> I wonder if it should be:
>  if(pWin->viewable)
>     RootlessReorderWindow(pWin);
>
> Does that work as well?
>
> George
> -- 
> http://people.freedesktop.org/~gstaplin/
> _______________________________________________
> Xquartz-dev mailing list
> Xquartz-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/xquartz-dev



More information about the Xquartz-dev mailing list