[arch-commits] Commit in guake/trunk (PKGBUILD fix-compiositing.patch guake.install)

Balló György bgyorgy at archlinux.org
Tue Sep 23 15:49:21 UTC 2014


    Date: Tuesday, September 23, 2014 @ 17:49:20
  Author: bgyorgy
Revision: 119514

upgpkg: guake 0.4.4-4

Handle enabling/disabling compositing while Guake is running (FS#41757)

Added:
  guake/trunk/fix-compiositing.patch
Modified:
  guake/trunk/PKGBUILD
  guake/trunk/guake.install

------------------------+
 PKGBUILD               |   15 ++++--
 fix-compiositing.patch |  110 +++++++++++++++++++++++++++++++++++++++++++++++
 guake.install          |    4 -
 3 files changed, 122 insertions(+), 7 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2014-09-23 15:39:13 UTC (rev 119513)
+++ PKGBUILD	2014-09-23 15:49:20 UTC (rev 119514)
@@ -5,18 +5,20 @@
 
 pkgname=guake
 pkgver=0.4.4
-pkgrel=3
+pkgrel=4
 pkgdesc='Drop-down terminal for GNOME'
 arch=('i686' 'x86_64')
 url="http://guake.org/"
 license=('GPL')
-depends=('python2-notify' 'vte' 'python2-gconf' 'python2-dbus' 'python2-xdg' 'hicolor-icon-theme' 'xdg-utils')
+depends=('python2-notify' 'vte' 'python2-gconf' 'python2-dbus' 'python2-xdg')
 makedepends=('intltool' 'gnome-common')
 install=$pkgname.install
 source=($pkgname-$pkgver.tar.gz::https://github.com/Guake/$pkgname/archive/$pkgver.tar.gz
-        guake-fix-notification.patch)
+        guake-fix-notification.patch
+        fix-compiositing.patch)
 md5sums=('06b424ae32c7e63a8256922f1e8c51b6'
-         '0b57227e6869dd84dd4fb0794ed0d082')
+         '0b57227e6869dd84dd4fb0794ed0d082'
+         '742729d81a9e22b59bd4ec0af64804d3')
 
 prepare() {
   cd "$srcdir/$pkgname-$pkgver"
@@ -28,8 +30,11 @@
   sed -i 's|/usr/bin/env python|/usr/bin/python2|' src/{guake{,-prefs},prefs.py}
 
   # Runtime fix when no notification server available
-  patch -Np1 -i "$srcdir/guake-fix-notification.patch"
+  patch -Np1 -i ../guake-fix-notification.patch
 
+  # Handle enabling/disabling compositing while Guake is running
+  patch -Np1 -i ../fix-compiositing.patch
+
   # Fix build
   sed -i '/AM_INIT_AUTOMAKE/ s/-Werror//' configure.ac
 }

Added: fix-compiositing.patch
===================================================================
--- fix-compiositing.patch	                        (rev 0)
+++ fix-compiositing.patch	2014-09-23 15:49:20 UTC (rev 119514)
@@ -0,0 +1,110 @@
+From b0e3e2b0544967d2ac3f9df299867142b4b4dec8 Mon Sep 17 00:00:00 2001
+From: Alexander Mezin <mezin.alexander at gmail.com>
+Date: Sun, 3 Mar 2013 02:48:01 +0700
+Subject: [PATCH] Handle enabling/disabling compositing while Guake is running
+
+Currently Guake checks if compositing is enabled only at startup.
+This causes problems in XFCE: Guake window is opaque when it's
+started automatically on login. I have to restart it to enable
+transparency. Also, it is generally better to react to changes
+without restart.
+---
+ src/guake | 64 ++++++++++++++++++++++++++++++++++++++-------------------------
+ 1 file changed, 39 insertions(+), 25 deletions(-)
+
+diff --git a/src/guake b/src/guake
+index 1b321fc..50e1a91 100644
+--- a/src/guake
++++ b/src/guake
+@@ -301,33 +301,14 @@ class GConfHandler(object):
+         will set the transparent flag to false if an image is set in
+         all terminals open.
+         """
+-        image = entry.value.get_string()
+-        for i in self.guake.term_list:
+-            if image and os.path.exists(image):
+-                i.set_background_image_file(image)
+-                i.set_background_transparent(False)
+-            else:
+-                """We need to clear the image if it's not set but there is
+-                a bug in vte python bidnings which doesn't allow None to be
+-                passed to set_background_image (C GTK function expects NULL).
+-                The user will need to restart Guake after clearing the image.
+-                i.set_background_image(None)
+-                """
+-                if self.guake.has_argb:
+-                    i.set_background_transparent(False)
+-                else:
+-                    i.set_background_transparent(True)
++        self.guake.set_background_image(entry.value.get_string())
+ 
+     def bgtransparency_changed(self, client, connection_id, entry, data):
+         """If the gconf var style/background/transparency be changed, this
+         method will be called and will set the saturation and transparency
+         properties in all terminals open.
+         """
+-        transparency = entry.value.get_int()
+-        for i in self.guake.term_list:
+-            i.set_background_saturation(transparency / 100.0)
+-            if self.guake.has_argb:
+-                i.set_opacity(int((100 - transparency) / 100.0 * 65535))
++        self.guake.set_background_transparency(entry.value.get_int())
+ 
+     def backspace_changed(self, client, connection_id, entry, data):
+         """If the gconf var compat_backspace be changed, this method
+@@ -560,11 +541,21 @@ class Guake(SimpleGladeApp):
+         # check and set ARGB for real transparency
+         screen = self.window.get_screen()
+         colormap = screen.get_rgba_colormap()
+-        if colormap != None and screen.is_composited():
+-            self.window.set_colormap(colormap)
+-            self.has_argb = True
+-        else:
++        if colormap == None:
+             self.has_argb = False
++        else:
++            self.window.set_colormap(colormap)
++            self.has_argb = self.window.get_screen().is_composited()
++
++            def composited_changed(screen):
++                self.has_argb = screen.is_composited()
++                self.set_background_transparency(
++                    self.client.get_int(KEY('/style/background/transparency')))
++                self.set_background_image(
++                    self.client.get_string(KEY('/style/background/image')))
++
++            self.window.get_screen().connect("composited-changed",
++                                              composited_changed);
+ 
+         # List of vte.Terminal widgets, it will be useful when needed
+         # to get a widget by the current page in self.notebook
+@@ -659,6 +650,29 @@ class Guake(SimpleGladeApp):
+                   'press <b>%s</b> to use it.') % label, filename)
+             notification.show()
+ 
++    def set_background_transparency(self, transparency):
++        for i in self.term_list:
++            i.set_background_saturation(transparency / 100.0)
++            if self.has_argb:
++                i.set_opacity(int((100 - transparency) / 100.0 * 65535))
++
++    def set_background_image(self, image):
++        for i in self.term_list:
++            if image and os.path.exists(image):
++                i.set_background_image_file(image)
++                i.set_background_transparent(False)
++            else:
++                """We need to clear the image if it's not set but there is
++                a bug in vte python bidnings which doesn't allow None to be
++                passed to set_background_image (C GTK function expects NULL).
++                The user will need to restart Guake after clearing the image.
++                i.set_background_image(None)
++                """
++                if self.has_argb:
++                    i.set_background_transparent(False)
++                else:
++                    i.set_background_transparent(True)
++
+     def execute_command(self, command, tab=None):
+         """Execute the `command' in the `tab'. If tab is None, the
+         command will be executed in the currently selected

Modified: guake.install
===================================================================
--- guake.install	2014-09-23 15:39:13 UTC (rev 119513)
+++ guake.install	2014-09-23 15:49:20 UTC (rev 119514)
@@ -2,7 +2,7 @@
 
 post_install() {
   usr/sbin/gconfpkg --install ${pkgname}
-  xdg-icon-resource forceupdate
+  gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
 }
 
 pre_upgrade() {
@@ -18,5 +18,5 @@
 }
 
 post_remove() {
-  xdg-icon-resource forceupdate
+  gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
 }




More information about the arch-commits mailing list