diff options
author | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2009-09-27 23:09:51 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2009-09-27 23:09:51 -0700 |
commit | cf2e3312cff3f341e9edba8c321a4ca7ffd8748e (patch) | |
tree | e492d85e578ef22aabea5c748f6a1323b5b851c3 | |
parent | dadab5a2279a19dcf709402d7f22f0cd48670db0 (diff) |
Rootless: Correct border rendering on parent-relative windows
Resurected code from the punted RootlessPaintBackground/Border and added it conditionally to miPaintWindow
-rw-r--r-- | mi/miexpose.c | 21 | ||||
-rw-r--r-- | mi/miwindow.c | 1 | ||||
-rw-r--r-- | miext/rootless/rootlessWindow.c | 26 |
3 files changed, 48 insertions, 0 deletions
diff --git a/mi/miexpose.c b/mi/miexpose.c index 6ce56ee85..1c9c3a436 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -515,12 +515,20 @@ miWindowExposures( WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed) REGION_EMPTY( pWin->drawable.pScreen, prgn); } else if (exposures && exposures != prgn) REGION_DESTROY( pWin->drawable.pScreen, exposures); } +#ifdef ROOTLESS +/* Ugly, ugly, but we lost our hooks into miPaintWindow... =/ */ +void RootlessSetPixmapOfAncestors(WindowPtr pWin); +void RootlessStartDrawing(WindowPtr pWin); +void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn); +Bool IsFramedWindow(WindowPtr pWin); +#endif + void miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) { ScreenPtr pScreen = pWin->drawable.pScreen; ChangeGCVal gcval[6]; BITS32 gcmask; @@ -540,12 +548,25 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) */ int tile_x_off, tile_y_off; PixUnion fill; Bool solid = TRUE; DrawablePtr drawable = &pWin->drawable; +#ifdef ROOTLESS + if(IsFramedWindow(pWin)) { + RootlessStartDrawing(pWin); + RootlessDamageRegion(pWin, prgn); + + if(pWin->backgroundState == ParentRelative) { + if((what == PW_BACKGROUND) || + (what == PW_BORDER && !pWin->borderIsPixel)) + RootlessSetPixmapOfAncestors(pWin); + } + } +#endif + if (what == PW_BACKGROUND) { while (pWin->backgroundState == ParentRelative) pWin = pWin->parent; draw_x_off = drawable->x; diff --git a/mi/miwindow.c b/mi/miwindow.c index 31c028482..c2333938e 100644 --- a/mi/miwindow.c +++ b/mi/miwindow.c @@ -1,6 +1,7 @@ + /*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c index e273d0e38..d43301fc1 100644 --- a/miext/rootless/rootlessWindow.c +++ b/miext/rootless/rootlessWindow.c @@ -1681,6 +1681,32 @@ RootlessShowAllWindows (void) RootlessReorderWindow (pWin); } RootlessScreenExpose (pScreen); } } + +/* + * SetPixmapOfAncestors + * Set the Pixmaps on all ParentRelative windows up the ancestor chain. + */ +void +RootlessSetPixmapOfAncestors(WindowPtr pWin) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + WindowPtr topWin = TopLevelParent(pWin); + RootlessWindowRec *topWinRec = WINREC(topWin); + + while (pWin->backgroundState == ParentRelative) { + if (pWin == topWin) { + // disallow ParentRelative background state on top level + XID pixel = 0; + ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient); + RL_DEBUG_MSG("Cleared ParentRelative on 0x%x.\n", pWin); + break; + } + + pWin = pWin->parent; + pScreen->SetWindowPixmap(pWin, topWinRec->pixmap); + } +} + |