From 379be85a0958b56d4557e1b6ae49b1536b2ca753 Mon Sep 17 00:00:00 2001 From: Thomas Meire Date: Sat, 23 Feb 2008 22:54:39 +0100 Subject: [PATCH] Add support for real transparency when using a composited environment. (Fixes LP #190946) --- terminator | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/terminator b/terminator index 0d2b9cfc..f1397a14 100755 --- a/terminator +++ b/terminator @@ -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))