[arch-commits] Commit in tint2/trunk (3 files)

Bartłomiej Piotrowski bpiotrowski at nymeria.archlinux.org
Wed Sep 25 18:19:17 UTC 2013


    Date: Wednesday, September 25, 2013 @ 20:19:17
  Author: bpiotrowski
Revision: 97617

upgpkg: tint2 0.11-6

- prevent creating zombie processes after clicking in the clock (FS#37035)

Added:
  tint2/trunk/fix_defunct_processes.patch
  tint2/trunk/middle_click_on_clock.patch
Modified:
  tint2/trunk/PKGBUILD

-----------------------------+
 PKGBUILD                    |   33 +++++++++++-------
 fix_defunct_processes.patch |   31 +++++++++++++++++
 middle_click_on_clock.patch |   75 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 126 insertions(+), 13 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2013-09-25 18:03:31 UTC (rev 97616)
+++ PKGBUILD	2013-09-25 18:19:17 UTC (rev 97617)
@@ -5,8 +5,8 @@
 
 pkgname=tint2
 pkgver=0.11
-pkgrel=5
-pkgdesc="A basic, good-looking task manager for WMs"
+pkgrel=6
+pkgdesc='Basic, good-looking task manager for WMs'
 arch=('i686' 'x86_64')
 url="http://code.google.com/p/tint2/"
 license=('GPL2')
@@ -13,31 +13,38 @@
 conflicts=('ttm-svn' 'tint')
 replaces=('tint')
 depends=('gtk2' 'imlib2')
-optdepends=('pygtk: for using tint2conf')
+optdepends=('pygtk: for tint2wizard')
 makedepends=('pygtk' 'cmake')
 provides=('tint')
-source=("http://$pkgname.googlecode.com/files/$pkgname-${pkgver}.tar.bz2"
-        'add-power-now-support.patch')
+source=(http://tint2.googlecode.com/files/tint2-$pkgver.tar.bz2
+        add-power-now-support.patch
+        fix_defunct_processes.patch
+        middle_click_on_clock.patch)
 md5sums=('6fc5731e7425125fa84a2add5cef4bff'
-         '6cfcad028f1bd2f69812167f5395f890')
+         '6cfcad028f1bd2f69812167f5395f890'
+         'b3d052ac5ada81c56e36133b1ecdee8c'
+         'f7918d29a87422aab6fb9d922867d8f8')
 
-build() {
-  cd "$srcdir/$pkgname-${pkgver}"
+prepare() {
+  cd $pkgname-$pkgver
 
-  # add support for power_now battery attribute (fixes FS#21954)
   patch -Np0 -i ../add-power-now-support.patch
+  patch -Np0 -i ../fix_defunct_processes.patch
+  patch -Np0 -i ../middle_click_on_clock.patch
 
   # python2 fix
   sed -i 's_#!/usr/bin/env python_#!/usr/bin/env python2_' src/tint2conf/tintwizard.py
   sed -i 's_python _python2 _' src/tint2conf/main.c
+}
 
-  [ -d build ] || mkdir build
-  cd build
-  cmake -DCMAKE_INSTALL_PREFIX=/usr ../
+build() {
+  cd $pkgname-$pkgver
+
+  cmake -DCMAKE_INSTALL_PREFIX=/usr .
   make 
 }
 
 package() {
-  cd "$srcdir/$pkgname-${pkgver}/build"
+  cd $pkgname-$pkgver
   make DESTDIR="$pkgdir" install
 }

Added: fix_defunct_processes.patch
===================================================================
--- fix_defunct_processes.patch	                        (rev 0)
+++ fix_defunct_processes.patch	2013-09-25 18:19:17 UTC (rev 97617)
@@ -0,0 +1,31 @@
+http://code.google.com/p/tint2/issues/detail?id=430
+Submitted By: David B. Cortarello (Nomius) <dcortarello at gmail dot com>
+Date: 18-05-2013
+Initial Package Version: subversion trunk (revision 652)
+Description: Fix zombie (defunct) processes created in clock_action.
+This patch provides the following bugfixes:
+   * This patch uses waitpid with WNOHANG to eliminate all zombie processes created by tint2 (in particular by the clock -right or left- click). This is done by a small hack in the update_clocks_min, called to "redraw" that area.
+
+--- src/clock/clock.c	(revision 652)
++++ src/clock/clock.c	(working copy)
+@@ -23,6 +23,8 @@
+ #include <cairo-xlib.h>
+ #include <pango/pangocairo.h>
+ #include <stdlib.h>
++#include <sys/types.h>
++#include <sys/wait.h>
+ 
+ #include "window.h"
+ #include "server.h"
+@@ -98,6 +103,10 @@
+ 	// remember old_sec because after suspend/hibernate the clock should be updated directly, and not
+ 	// on next minute change
+ 	time_t old_sec = time_clock.tv_sec;
++
++	// Little hack to wait executed commands in clock_action avoiding zombies
++	waitpid(-1, NULL, WNOHANG);
++
+ 	gettimeofday(&time_clock, 0);
+ 	if (time_clock.tv_sec % 60 == 0 || time_clock.tv_sec - old_sec > 60) {
+ 		int i;
+

Added: middle_click_on_clock.patch
===================================================================
--- middle_click_on_clock.patch	                        (rev 0)
+++ middle_click_on_clock.patch	2013-09-25 18:19:17 UTC (rev 97617)
@@ -0,0 +1,75 @@
+http://code.google.com/p/tint2/issues/detail?id=430
+Submitted By: David B. Cortarello (Nomius) <dcortarello at gmail dot com>
+Date: 18-05-2013
+Initial Package Version: subversion trunk (revision 652)
+Description: Implemented middle click mouse button in the clock to execute tasks.
+* Implemented middle click mouse button over the clock by accepting the button 2 in the clock_action. 
+* A new configuration parameter was created called clock_mclick_command, which works in the same way 
+* clock_lclick_command and clock_rclick_command does.
+
+Index: src/clock/clock.c
+===================================================================
+--- src/clock/clock.c	(revision 652)
++++ src/clock/clock.c	(working copy)
+@@ -39,6 +41,7 @@
+ char *time_tooltip_format;
+ char *time_tooltip_timezone;
+ char *clock_lclick_command;
++char *clock_mclick_command;
+ char *clock_rclick_command;
+ struct timeval time_clock;
+ PangoFontDescription *time1_font_desc;
+@@ -61,6 +64,7 @@
+ 	time_tooltip_format = 0;
+ 	time_tooltip_timezone = 0;
+ 	clock_lclick_command = 0;
++	clock_mclick_command = 0;
+ 	clock_rclick_command = 0;
+ 	time1_font_desc = 0;
+ 	time2_font_desc = 0;
+@@ -77,6 +81,7 @@
+ 	if (time2_timezone) g_free(time2_timezone);
+ 	if (time_tooltip_timezone) g_free(time_tooltip_timezone);
+ 	if (clock_lclick_command) g_free(clock_lclick_command);
++	if (clock_mclick_command) g_free(clock_mclick_command);
+ 	if (clock_rclick_command) g_free(clock_rclick_command);
+ 	if (clock_timeout) stop_timeout(clock_timeout);
+ }
+@@ -254,6 +263,9 @@
+ 		case 1:
+ 		command = clock_lclick_command;
+ 		break;
++        case 2:
++        command = clock_mclick_command;
++		break;
+ 		case 3:
+ 		command = clock_rclick_command;
+ 		break;
+Index: src/clock/clock.h
+===================================================================
+--- src/clock/clock.h	(revision 652)
++++ src/clock/clock.h	(working copy)
+@@ -33,6 +33,7 @@
+ extern PangoFontDescription *time1_font_desc;
+ extern PangoFontDescription *time2_font_desc;
+ extern char *clock_lclick_command;
++extern char *clock_mclick_command;
+ extern char *clock_rclick_command;
+ extern int clock_enabled;
+ 
+Index: src/config.c
+===================================================================
+--- src/config.c	(revision 652)
++++ src/config.c	(working copy)
+@@ -396,6 +396,10 @@
+ 		if (strlen(value) > 0)
+ 			clock_lclick_command = strdup(value);
+ 	}
++	else if (strcmp(key, "clock_mclick_command") == 0) {
++		if (strlen(value) > 0)
++			clock_mclick_command = strdup(value);
++	}
+ 	else if (strcmp(key, "clock_rclick_command") == 0) {
+ 		if (strlen(value) > 0)
+ 			clock_rclick_command = strdup(value);
+




More information about the arch-commits mailing list