diff options
Diffstat (limited to 'miext/rootless/rootlessScreen.c')
-rw-r--r-- | miext/rootless/rootlessScreen.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c index 18673a8b6..5031858dd 100644 --- a/miext/rootless/rootlessScreen.c +++ b/miext/rootless/rootlessScreen.c @@ -42,6 +42,7 @@ #include "propertyst.h" #include "mivalidate.h" #include "picturestr.h" +#include "colormapst.h" #include <sys/types.h> #include <sys/stat.h> @@ -64,6 +65,7 @@ extern Bool RootlessCreateGC(GCPtr pGC); DevPrivateKey rootlessGCPrivateKey = &rootlessGCPrivateKey; DevPrivateKey rootlessScreenPrivateKey = &rootlessScreenPrivateKey; DevPrivateKey rootlessWindowPrivateKey = &rootlessWindowPrivateKey; +DevPrivateKey rootlessWindowOldPixmapPrivateKey = &rootlessWindowOldPixmapPrivateKey; /* @@ -469,6 +471,67 @@ RootlessMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst, return result; } +ColormapPtr +RootlessGetColormap (ScreenPtr pScreen) +{ + RootlessScreenRec *s = SCREENREC (pScreen); + + return s->colormap; +} + +static void +RootlessInstallColormap (ColormapPtr pMap) +{ + ScreenPtr pScreen = pMap->pScreen; + RootlessScreenRec *s = SCREENREC (pScreen); + + SCREEN_UNWRAP(pScreen, InstallColormap); + + if (s->colormap != pMap) { + s->colormap = pMap; + s->colormap_changed = TRUE; + RootlessQueueRedisplay (pScreen); + } + + pScreen->InstallColormap (pMap); + + SCREEN_WRAP (pScreen, InstallColormap); +} + +static void +RootlessUninstallColormap (ColormapPtr pMap) +{ + ScreenPtr pScreen = pMap->pScreen; + RootlessScreenRec *s = SCREENREC (pScreen); + + SCREEN_UNWRAP(pScreen, UninstallColormap); + + if (s->colormap == pMap) + s->colormap = NULL; + + pScreen->UninstallColormap (pMap); + + SCREEN_WRAP(pScreen, UninstallColormap); +} + +static void +RootlessStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef) +{ + ScreenPtr pScreen = pMap->pScreen; + RootlessScreenRec *s = SCREENREC (pScreen); + + SCREEN_UNWRAP(pScreen, StoreColors); + + if (s->colormap == pMap && ndef > 0) { + s->colormap_changed = TRUE; + RootlessQueueRedisplay (pScreen); + } + + pScreen->StoreColors (pMap, ndef, pdef); + + SCREEN_WRAP(pScreen, StoreColors); +} + static CARD32 RootlessRedisplayCallback(OsTimerPtr timer, CARD32 time, void *arg) @@ -599,6 +662,9 @@ RootlessWrap(ScreenPtr pScreen) WRAP(MarkOverlappedWindows); WRAP(ValidateTree); WRAP(ChangeWindowAttributes); + WRAP(InstallColormap); + WRAP(UninstallColormap); + WRAP(StoreColors); #ifdef SHAPE WRAP(SetShape); @@ -636,6 +702,8 @@ Bool RootlessInit(ScreenPtr pScreen, RootlessFrameProcsPtr procs) s = SCREENREC(pScreen); s->imp = procs; + s->colormap = NULL; + s->redisplay_expired = FALSE; RootlessWrap(pScreen); |