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 | |||
@@ -518,6 +518,14 @@ miWindowExposures( WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed) | |||
518 | REGION_DESTROY( pWin->drawable.pScreen, exposures); | 518 | REGION_DESTROY( pWin->drawable.pScreen, exposures); |
519 | } | 519 | } |
520 | 520 | ||
521 | #ifdef ROOTLESS | ||
522 | /* Ugly, ugly, but we lost our hooks into miPaintWindow... =/ */ | ||
523 | void RootlessSetPixmapOfAncestors(WindowPtr pWin); | ||
524 | void RootlessStartDrawing(WindowPtr pWin); | ||
525 | void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn); | ||
526 | Bool IsFramedWindow(WindowPtr pWin); | ||
527 | #endif | ||
528 | |||
521 | void | 529 | void |
522 | miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) | 530 | miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) |
523 | { | 531 | { |
@@ -543,6 +551,19 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) | |||
543 | Bool solid = TRUE; | 551 | Bool solid = TRUE; |
544 | DrawablePtr drawable = &pWin->drawable; | 552 | DrawablePtr drawable = &pWin->drawable; |
545 | 553 | ||
554 | #ifdef ROOTLESS | ||
555 | if(IsFramedWindow(pWin)) { | ||
556 | RootlessStartDrawing(pWin); | ||
557 | RootlessDamageRegion(pWin, prgn); | ||
558 | |||
559 | if(pWin->backgroundState == ParentRelative) { | ||
560 | if((what == PW_BACKGROUND) || | ||
561 | (what == PW_BORDER && !pWin->borderIsPixel)) | ||
562 | RootlessSetPixmapOfAncestors(pWin); | ||
563 | } | ||
564 | } | ||
565 | #endif | ||
566 | |||
546 | if (what == PW_BACKGROUND) | 567 | if (what == PW_BACKGROUND) |
547 | { | 568 | { |
548 | while (pWin->backgroundState == ParentRelative) | 569 | while (pWin->backgroundState == ParentRelative) |
diff --git a/mi/miwindow.c b/mi/miwindow.c index 31c028482..c2333938e 100644 --- a/mi/miwindow.c +++ b/mi/miwindow.c | |||
@@ -1,3 +1,4 @@ | |||
1 | |||
1 | /*********************************************************** | 2 | /*********************************************************** |
2 | 3 | ||
3 | Copyright 1987, 1998 The Open Group | 4 | Copyright 1987, 1998 The Open Group |
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 | |||
@@ -1684,3 +1684,29 @@ RootlessShowAllWindows (void) | |||
1684 | RootlessScreenExpose (pScreen); | 1684 | RootlessScreenExpose (pScreen); |
1685 | } | 1685 | } |
1686 | } | 1686 | } |
1687 | |||
1688 | /* | ||
1689 | * SetPixmapOfAncestors | ||
1690 | * Set the Pixmaps on all ParentRelative windows up the ancestor chain. | ||
1691 | */ | ||
1692 | void | ||
1693 | RootlessSetPixmapOfAncestors(WindowPtr pWin) | ||
1694 | { | ||
1695 | ScreenPtr pScreen = pWin->drawable.pScreen; | ||
1696 | WindowPtr topWin = TopLevelParent(pWin); | ||
1697 | RootlessWindowRec *topWinRec = WINREC(topWin); | ||
1698 | |||
1699 | while (pWin->backgroundState == ParentRelative) { | ||
1700 | if (pWin == topWin) { | ||
1701 | // disallow ParentRelative background state on top level | ||
1702 | XID pixel = 0; | ||
1703 | ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient); | ||
1704 | RL_DEBUG_MSG("Cleared ParentRelative on 0x%x.\n", pWin); | ||
1705 | break; | ||
1706 | } | ||
1707 | |||
1708 | pWin = pWin->parent; | ||
1709 | pScreen->SetWindowPixmap(pWin, topWinRec->pixmap); | ||
1710 | } | ||
1711 | } | ||
1712 | |||