From c55755f90b5e57dca19c8a4f5820ba2bd311b8d5 Mon Sep 17 00:00:00 2001
From: Aleksandar Krsteski <alekrsteski@gmail.com>
Date: Thu, 19 Feb 2009 03:52:51 +0100
Subject: [PATCH 2/2] Add support for real (ARGB) transparency when available.
Guake by default will use real transparency with alpha channel if
available. In preferences window it uses Opacity slider to control the
terminal transparency which is only visible when background image is not
set.
Signed-off-by: Aleksandar Krsteski <alekrsteski@gmail.com>
---
src/guake.py | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/src/guake.py b/src/guake.py
index 523bd7b..1f6df18 100644
|
a
|
b
|
|
| 248 | 248 | i.set_background_image_file(image) |
| 249 | 249 | i.set_background_transparent(False) |
| 250 | 250 | else: |
| 251 | | i.set_background_transparent(True) |
| | 251 | """We need to clear the image if it's not set but there is |
| | 252 | a bug in vte python bidnings which doesn't allow None to be |
| | 253 | passed to set_background_image (C GTK function expects NULL). |
| | 254 | The user will need to restart Guake after clearing the image. |
| | 255 | i.set_background_image(None) |
| | 256 | """ |
| | 257 | if self.guake.has_argb: |
| | 258 | i.set_background_transparent(False) |
| | 259 | else: |
| | 260 | i.set_background_transparent(True) |
| 252 | 261 | |
| 253 | 262 | def bgopacity_changed(self, client, connection_id, entry, data): |
| 254 | 263 | """If the gconf var style/background/opacity be changed, this |
| … |
… |
|
| 258 | 267 | opacity = entry.value.get_int() |
| 259 | 268 | for i in self.guake.term_list: |
| 260 | 269 | i.set_background_saturation(opacity / 100.0) |
| 261 | | i.set_opacity(opacity) |
| | 270 | if self.guake.has_argb: |
| | 271 | i.set_opacity(int(opacity / 100.0 * 65535)) |
| 262 | 272 | |
| 263 | 273 | def backspace_changed(self, client, connection_id, entry, data): |
| 264 | 274 | """If the gconf var compat_backspace be changed, this method |
| … |
… |
|
| 478 | 488 | self.mainframe = self.get_widget('mainframe') |
| 479 | 489 | self.resizer = self.get_widget('resizer') |
| 480 | 490 | |
| | 491 | # check and set ARGB for real transparency |
| | 492 | screen = self.window.get_screen() |
| | 493 | colormap = screen.get_rgba_colormap() |
| | 494 | if colormap != None and screen.is_composited(): |
| | 495 | self.window.set_colormap(colormap) |
| | 496 | self.has_argb = True |
| | 497 | else: |
| | 498 | self.has_argb = False |
| | 499 | |
| 481 | 500 | # List of vte.Terminal widgets, it will be useful when needed |
| 482 | 501 | # to get a widget by the current page in self.notebook |
| 483 | 502 | self.term_list = [] |