koniu ?
- Forwarded message from Bernd Zeimetz [EMAIL PROTECTED] -
From: Bernd Zeimetz [EMAIL PROTECTED]
To: Debian Bug Tracking System [EMAIL PROTECTED]
Subject: Bug#506803: awesome: naughty's notify should return 'notification'
Date: Mon, 24 Nov 2008 22:52:42 +0100
X-Mailer: reportbug 3.47
X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW
autolearn=ham version=3.2.5
Package: awesome
Version: 3.1~rc3-1
Severity: normal
Tags: patch
Hi!
Since a48e71af18644af61fbbb536d88fb1dcad856631 destroy() takes a notification
object instead. Unfortunately notify() doesn't return the created
notification,
so destroy() is pretty much useless at the moment.
The attached patch fixes the api doc of destroy and adds an according return
statement to notify().
Cheers,
Bernd
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.27.2-think (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages awesome depends on:
ii libc6 2.7-16 GNU C Library: Shared libraries
ii libcairo2 1.8.2-2The Cairo 2D vector graphics
libra
ii libdbus-1-3 1.2.1-4simple interprocess messaging
syst
ii libev33.43-1 high-performance event loop
librar
ii libglib2.0-0 2.18.2-1 The GLib library of C routines
ii libimlib2 1.4.0-1.1 powerful image loading and
renderi
ii liblua5.1-0 5.1.4-1Simple, extensible, embeddable
pro
ii libncurses5 5.7-2 shared libraries for terminal
hand
ii libpango1.0-0 1.22.2-1 Layout and rendering of
internatio
ii libreadline5 5.2-3 GNU readline and history
libraries
ii libx11-6 2:1.1.5-2 X11 client-side library
ii libx11-xcb1 2:1.1.5-2 Xlib/XCB interface library
ii libxcb-atom1 0.3.0-1utility libraries for X C
Binding
ii libxcb-aux0 0.3.0-1utility libraries for X C
Binding
ii libxcb-event1 0.3.0-1utility libraries for X C
Binding
ii libxcb-icccm1 0.3.0-1utility libraries for X C
Binding
ii libxcb-keysyms0 0.3.0-1utility libraries for X C
Binding
ii libxcb-property1 0.3.0-1utility libraries for X C
Binding
ii libxcb-randr0 1.1-1.1X C Binding, randr extension
ii libxcb-render-util0 0.3.0-1utility libraries for X C
Binding
ii libxcb-render01.1-1.1X C Binding, render extension
ii libxcb-xinerama0 1.1-1.1X C Binding, xinerama extension
ii libxcb1 1.1-1.1X C Binding
ii menu 2.1.41 generates programs menu for all
me
Versions of packages awesome recommends:
ii x11-xserver-utils 7.3+5 X server utilities
awesome suggests no packages.
-- no debconf information
From 532c79671848b80163eaadbd2e2f6b0ed53a25a6 Mon Sep 17 00:00:00 2001
From: Bernd Zeimetz [EMAIL PROTECTED]
Date: Mon, 24 Nov 2008 22:44:55 +0100
Subject: [PATCH] naughty: notify() needs to return notification
destroy() takes a notification object since
a48e71af18644af61fbbb536d88fb1dcad856631.
So we need to return the created object in notify().
---
lib/naughty.lua.in |6 --
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/naughty.lua.in b/lib/naughty.lua.in
index 04686da..31879f9 100644
--- a/lib/naughty.lua.in
+++ b/lib/naughty.lua.in
@@ -136,8 +136,7 @@ local function arrange(screen)
end
--- Destroy notification by index
--- @param idx Index of the notification
--- @param position One of 4 keys in notification dictionary: top_right,
top_left, bottom_right, bottom_left
+-- @param notification Notification object
-- @return True if the popup was successfully destroyed, nil otherwise
function destroy(notification)
if notification then
@@ -164,6 +163,7 @@ end
-- @param run Function to run on left click
-- @param width The popup width
-- @usage naughty.notify({ title = 'Achtung!', text = 'You\'re idling',
timeout = 0 })
+-- @return notification Created notification object
function notify(args)
-- gather variables together
local timeout = args.timeout or config.timeout
@@ -249,6 +249,8 @@ function notify(args)
-- insert the notification to the table
table.insert(notifications[screen][notification.position],notification)
+
+return notification
end
-- vim:
filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
--