diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-08-29 09:32:31 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-08-29 09:32:31 +0200 |
commit | e48e3a6fe01b63d693eb33260c26505f891f21a6 (patch) | |
tree | a9c640c24b171c2b436f5aaf1e359266b8cdd5ee | |
parent | 7ed869fcf17dcd9ddb2e02c927c2699eb104df7b (diff) | |
download | phi-e48e3a6fe01b63d693eb33260c26505f891f21a6.tar phi-e48e3a6fe01b63d693eb33260c26505f891f21a6.zip |
Correctly render tiled background pixmaps
-rw-r--r-- | lib/Phi/X11.hs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Phi/X11.hs b/lib/Phi/X11.hs index 818a9db..971be37 100644 --- a/lib/Phi/X11.hs +++ b/lib/Phi/X11.hs @@ -218,7 +218,9 @@ updatePanels dispvar = do renderWith buffer $ do save translate (-(fromIntegral $ rect_x area)) (-(fromIntegral $ rect_y area)) - withPatternForSurface rootImage setSource + withPatternForSurface rootImage $ \pattern -> do + patternSetExtend pattern ExtendRepeat + setSource pattern paint restore @@ -238,6 +240,7 @@ updatePanels dispvar = do -- copy buffer to window liftIO $ do (withDimension area $ clearArea disp (panelWindow panel) 0 0) True + --(withDimension area $ copyArea disp (panelPixmap panel) (panelWindow panel) (defaultGC disp $ defaultScreen disp) 0 0) 0 0 sync disp False return $ panel { panelWidgetState = layoutedWidget, panelWidgetCache = cache' } @@ -268,15 +271,15 @@ updateRootImage disp = do pixmap <- liftM (fromIntegral . fromMaybe 0 . listToMaybe . join . catMaybes) $ forM [atom_XROOTPMAP_ID atoms, atom_XROOTMAP_ID atoms] $ \atom -> liftIO $ getWindowProperty32 disp atom rootwin - (_, _, _, rootWidth, rootHeight, _, _) <- liftIO $ getGeometry disp rootwin + (_, _, _, pixmapWidth, pixmapHeight, _, _) <- liftIO $ getGeometry disp pixmap -- update surface size oldBg <- gets phiRootImage imageWidth <- liftM fromIntegral $ imageSurfaceGetWidth oldBg imageHeight <- liftM fromIntegral $ imageSurfaceGetHeight oldBg - when (imageWidth /= rootWidth || imageHeight /= rootHeight) $ do + when (imageWidth /= pixmapWidth || imageHeight /= pixmapHeight) $ do surfaceFinish oldBg - newBg <- liftIO $ createImageSurface FormatRGB24 (fromIntegral rootWidth) (fromIntegral rootHeight) + newBg <- liftIO $ createImageSurface FormatRGB24 (fromIntegral pixmapWidth) (fromIntegral pixmapHeight) modify $ \state -> state { phiRootImage = newBg } bg <- gets phiRootImage @@ -287,7 +290,7 @@ updateRootImage disp = do setSourceRGB 0 0 0 paint _ -> do - rootSurface <- liftIO $ Util.createXlibSurface disp pixmap visual (fromIntegral rootWidth) (fromIntegral rootHeight) + rootSurface <- liftIO $ Util.createXlibSurface disp pixmap visual (fromIntegral pixmapWidth) (fromIntegral pixmapHeight) renderWith bg $ withPatternForSurface rootSurface $ \pattern -> do setSource pattern |