Add support for real transparency when using a composited environment. (Fixes LP #190946)

This commit is contained in:
Thomas Meire 2008-02-23 22:54:39 +01:00
parent 5a12e350af
commit 379be85a09
1 changed files with 13 additions and 2 deletions

View File

@ -291,8 +291,12 @@ class TerminatorTerm:
self._vte.set_scroll_background (self.reconf ('scroll_background'))
self._vte.set_background_transparent (False)
if background_type == "transparent":
self._vte.set_background_transparent (True)
self._vte.set_background_saturation (1 - (self.reconf ('background_darkness')))
darkness = self.reconf ('background_darkness')
if self._vte.is_composited():
self._vte.set_opacity(int(darkness * 65535))
else:
self._vte.set_background_transparent (True)
self._vte.set_background_saturation (1 - darkness)
colors = palette.split (':')
palette = []
@ -540,6 +544,13 @@ class Terminator:
self.window.set_property ('allow-shrink', True)
# Set RGBA colormap if possible so VTE can use real alpha
# channels for transparency.
screen = self.window.get_screen()
colormap = screen.get_rgba_colormap()
if colormap and self.window.is_composited():
self.window.set_colormap(colormap)
# Start out with just one terminal
# FIXME: This should be really be decided from some kind of profile
term = (TerminatorTerm (self, self.profile, self.command))