--- notify-osd-0.9.21.orig/configure.in +++ notify-osd-0.9.21/configure.in @@ -1,4 +1,4 @@ -AC_INIT(notify-osd, 0.9.21, dx-team@canonical.com) +AC_INIT(notify-osd, 0.9.20, dx-team@canonical.com) AC_CONFIG_SRCDIR(src/main.c) AC_CONFIG_HEADERS(config.h) --- notify-osd-0.9.21.orig/autogen.sh +++ notify-osd-0.9.21/autogen.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +PKG_NAME="notify-osd" +REQUIRED_AUTOCONF_VERSION=2.59 +REQUIRED_AUTOMAKE_VERSION=1.8 +REQUIRED_MACROS="python.m4" +ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4" + +(test -f $srcdir/configure.in) || { + echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" + echo " top-level $PKG_NAME directory" + exit 1 +} + +which gnome-autogen.sh || { + echo "You need to install the gnome-common module and make" + echo "sure the gnome-autogen.sh script is in your \$PATH." + exit 1 +} + +USE_GNOME2_MACROS=1 . gnome-autogen.sh --- notify-osd-0.9.21.orig/debian/copyright +++ notify-osd-0.9.21/debian/copyright @@ -0,0 +1,49 @@ +This package was debianized by David Barth on +Wed Dec 3 18:04:59 PST 2008 + +It was downloaded from https://launchpad.net/notify-osd + +Copyright (C) Canonical, Oct. 2008 + +egg/* is Copyright (C) 2006, 2007 OpenedHand + +License: + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL-3'. + +License for egg/*: + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA + 02110-1301 USA + +On Debian systems, the complete text of the GNU Lesser General +Public License can be found in `/usr/share/common-licenses/LGPL-2'. + +The Debian packaging is (C) 2009, Canonical Ltd. and +is licensed under the GPLv3, see `/usr/share/common-licenses/GPL-3'. --- notify-osd-0.9.21.orig/debian/notify-osd.preinst +++ notify-osd-0.9.21/debian/notify-osd.preinst @@ -0,0 +1,23 @@ +#!/bin/sh +set -e + +case "$1" in + install|upgrade) + # avoid file conflict with notification-daemon + dpkg-divert --add --rename --package notify-osd --divert /usr/share/dbus-1/services/org.freedesktop.Notifications.service.notify-osd /usr/share/dbus-1/services/org.freedesktop.Notifications.service > /dev/null + ;; + + abort-upgrade) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +#DEBHELPER# + +exit 0 + + --- notify-osd-0.9.21.orig/debian/watch +++ notify-osd-0.9.21/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://launchpad.net/notify-osd/+download .*/notify-osd-([0-9.]+)\.tar\.gz --- notify-osd-0.9.21.orig/debian/control +++ notify-osd-0.9.21/debian/control @@ -0,0 +1,30 @@ +Source: notify-osd +Section: x11 +Priority: optional +Maintainer: DX Team +Build-Depends: cdbs (>= 0.4.41), + debhelper (>= 5), + libglib2.0-dev (>= 2.4), + libgtk2.0-dev (>= 2.4), + libdbus-1-dev (>= 0.36), + libdbus-glib-1-dev (>= 0.60), + libwnck-dev, + libnotify-dev (>= 0.4.5), + libgconf2-dev, + intltool +Standards-Version: 3.8.0 +Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-desktop/notify-osd/ubuntu +Homepage: https://launchpad.net/notify-osd + +Package: notify-osd +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, human-icon-theme (>= 0.33) +Conflicts: notify-daemon, alsdorf (<< 0.8-0ubuntu2) +Replaces: notify-daemon, alsdorf (<< 0.8-0ubuntu2) +Provides: notification-daemon +Description: daemon that displays passive pop-up notifications + The Desktop Notifications framework provides a standard way of doing + passive pop-up notifications on the Linux desktop. These are + designed to notify the user of something without interrupting their + work with a dialog box that they must close. Passive popups can + automatically disappear after a short period of time. --- notify-osd-0.9.21.orig/debian/rules +++ notify-osd-0.9.21/debian/rules @@ -0,0 +1,8 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/class/gnome.mk +include /usr/share/cdbs/1/rules/debhelper.mk + +LDFLAGS += -Wl,-z,defs -Wl,--as-needed +# DEB_MAKE_TEST_TARGET := test + --- notify-osd-0.9.21.orig/debian/notify-osd.install +++ notify-osd-0.9.21/debian/notify-osd.install @@ -0,0 +1 @@ +debian/source_notify-osd.py usr/share/apport/package-hooks --- notify-osd-0.9.21.orig/debian/changelog +++ notify-osd-0.9.21/debian/changelog @@ -0,0 +1,381 @@ +notify-osd (0.9.21-0ubuntu1) karmic; urgency=low + + * New upstream version (LP: #427434) + - Using a fixed slot-allocation scheme now. This means async + bubbles (e.g. volume) always appear in the top slot/position + and sync. bubbles (e.g. IM-message notification) always appear + in the bottom slot/position. + + -- Ken VanDine Thu, 10 Sep 2009 12:51:58 -0400 + +notify-osd (0.9.20-0ubuntu1) karmic; urgency=low + + * New upstream version: + - added support for integer gconf-key "/apps/notify-osd/gravity" + - supported values are 1 (NorthEast, top-right) and 2 (East, vertically centered at right of screen) + - switch back default positioning to NorthEast (top-right) + + -- Sebastien Bacher Tue, 01 Sep 2009 16:02:26 +0200 + +notify-osd (0.9.19-0ubuntu1) karmic; urgency=low + + * New upstream version: (LP: #420046) + - updated sizing-factor of body-text height to be 0.9 EMs (of system-wide + setting) according to https://wiki.ubuntu.com/NotifyOSD#Body%20text + - implemented fade-prevention when bubble is opened while mouse-pointer + is over it/within proximity-fade area + - fade-out value now set to 40% as stated in + https://wiki.ubuntu.com/NotifyOSD#Interaction + - added support for automake-1.11's slient output + - added valgrind make-rule + - experiment with centering bubbles vertically, sync. bubble always goes + above center-line, async. one always below it + - ensure GErrors are correctly freed + + -- Ken VanDine Thu, 27 Aug 2009 20:47:56 +0200 + +notify-osd (0.9.18-0ubuntu1) karmic; urgency=low + + * New upstream version: (lp: #417384) + - code-clean by extracting fallback-dialog from class Bubble + - fixes for i18n unit-tests + - enforce notification-spam protection (part of backlog-feature work), max. 50 allowed in queue + - Python-examples now get included in generated dist. tarball + + -- Sebastien Bacher Thu, 27 Aug 2009 11:29:55 +0200 + +notify-osd (0.9.17-0ubuntu1) karmic; urgency=low + + * New upstream version: + - added timings-object in preparation for coming + "animations and durations" work + - patch from Eitan Isaacson fixing LP: #409810 + - patch from Aurélien Gateau extending text-filtering to handle newlines and + some HTML-tags + + -- Sebastien Bacher Fri, 14 Aug 2009 17:58:40 +0200 + +notify-osd (0.9.16-0ubuntu1) karmic; urgency=low + + * New upstream version: + - further preparation for refactoring of class Bubble and Stack + - mem-leak fixes and fix for LP: #378193 by Alexander Sack + - much code-refactoring + - adapted to 0.10 fd.o spec + - lots of autotools-related fixes and improvements + - added ATK interface by Eitan Isaacson + - fix by Chow Loong Jin for LP: #401809 + - added support for image_data and image_path + + -- Sebastien Bacher Wed, 05 Aug 2009 08:49:17 +0100 + +notify-osd (0.9.15-0ubuntu2) karmic; urgency=low + + (cherry-pick rev 357 from lp:~asac/notify-osd/lp378193_tile_memleak) + * fix LP: #378193 - huge memory leak in notify-osd; turned out the biggest share of + memory leak was due to tile objects not properly destroyed in bubble.c; refactoring code a bit + to prevent this in future + - update src/bubble.c + + -- Alexander Sack Mon, 27 Jul 2009 17:53:28 +0200 + +notify-osd (0.9.15-0ubuntu1) karmic; urgency=low + + * New upstream version: + - fixed wrong default values for bubble-width, margin- and icon-size + - fixed regressions introduced by the move to the surface- and blur-cache + - improved drawing of gauge/indicator + - tweaked rendering of layout-grid, added display of layout-grid to + debug-mode of notify-osd + - refactored rendering code for bubble + - migrated rendering of drop-shadow, background, icon, title, + body and gauge to surface/blur-cache + - added surface- and blur-cache + - added debug-output for font-size, screen-dpi, pixels/EM and + bubble-width in pixels + - fixed rounding errors in pixel-per-em calculation, changed default bubble + width to 24 EMs, fixed title- and body-text height, + fixes LP: #336110 and LP: #391190 + + -- Sebastien Bacher Tue, 21 Jul 2009 10:46:15 +0200 + +notify-osd (0.9.14.1-0ubuntu1) karmic; urgency=low + + * New upstream version + + -- Sebastien Bacher Mon, 22 Jun 2009 15:40:02 +0200 + +notify-osd (0.9.14-0ubuntu1) karmic; urgency=low + + * New upstream version: + - Numerous bug-fixes + - Added a special debugging feature for displaying notification urgencies + if started with "DEBUG=1 /usr/lib/notify-osd/notify-osd", meant to help + with collecting data for the Do-Not-Disturb mode, testers are encouraged + to run with it enabled and report any applications tagging their + notifications with the wrong urgency-level + - Implemented a new fade-on-hover behaviour called "proximity-fade", this + monitors the mouse pointer and upon nearing the bubble it will fade out + based on the distance of the pointer to the bubble edges + - Trigger-values for under- and overshoot-animations have changed, this + makes it necessary to also update gnome-power-manager and + gnome-settings-daemon + * debian/control: + - updated libnotify requirement + + -- Sebastien Bacher Mon, 22 Jun 2009 14:36:24 +0200 + +notify-osd (0.9.13-0ubuntu1) karmic; urgency=low + + * New upstream version + * Tweak to the apport hook installation + + [ Ara Pulido ] + * Install an apport hook so bugs get details about the configuration + + [ Loic Minier ] + * Drop patch debian/patches/60_gdmsession-strip-desktop-extension.patch and + do the changes to data/org.freedesktop.Notifications.service.in directly. + * Drop unused simple-patchsys; changes are done in the diff directly. + * Set LDFLAGS directly instead of via DEB_CONFIGURE_ENV; bdep on cdbs >= + 0.4.41. + * Cleanup some whitespaces. + * data/org.freedesktop.Notifications.service.in: more quoting, GDMSESSION + isn't always set (e.g. when using startx). + * Pass "-z defs" to ld before --as-needed for safety. + + -- Sebastien Bacher Wed, 03 Jun 2009 15:49:05 +0200 + +notify-osd (0.9.11-0ubuntu2) jaunty; urgency=low + + * data/org.freedesktop.Notifications.service.in: strip .desktop from + GDMSESSION before checking it; LP: #360989. + + -- Loic Minier Tue, 14 Apr 2009 13:44:56 +0200 + +notify-osd (0.9.11-0ubuntu1) jaunty; urgency=low + + * New upstream version: + - reposition a sync. bubble upon appended async (lp: #334388) + - do not print debug for non-bubbles (NULL); (lp: #352668) + + -- Sebastien Bacher Thu, 09 Apr 2009 13:57:41 +0200 + +notify-osd (0.9.10-0ubuntu2) jaunty; urgency=low + + * data/org.freedesktop.Notifications.service.in: Only run notify-osd on + GNOME sessions; if you have both Kubuntu and Ubuntu installed, Kubuntu + shouldn't get notify-osd. (LP: #338279) + + -- Martin Pitt Wed, 08 Apr 2009 22:26:26 -0700 + +notify-osd (0.9.10-0ubuntu1) jaunty; urgency=low + + * New upstream bug fix release: + - Enforce 10-line-limit for body-message text if newline-characters are part of it. + - Fixes DoS-like exploit-weakness of new append-functionality introduced with rev. 280. + - Make fallback dialogs more HIG-compliant. (LP: #332178) + - cairo_surface_t reference is lost when pointer is overwritten (LP: #356916) + - priv->icon_pixbuf is overwritten before it's current reference is decreased (LP: #356927) + - string from dbus_g_method_get_sender not freed (LP: #356858) + - Notification entries are not appended unless a replace is used (LP: #337394) + - Fix the workarea fallback case. + + -- Martin Pitt Wed, 08 Apr 2009 16:14:08 -0700 + +notify-osd (0.9.9-0ubuntu1) jaunty; urgency=low + + * New upstream version: + - updated text-filter, fixes LP: #353398 + - revert commit 267, a dedicated env-var for indicating a non-composited + desktop under UNR is not needed + - revert commit 266, fixes LP: #354349 + - don't do any filtering on the summary-text, removed the filter for the + summary-text completely + - only pass message-body text through HTML- and markup-filter, + the summary text should only be filtered for pango-markup, + treat bubble and fallback-dialog in the same manner + + -- Sebastien Bacher Fri, 03 Apr 2009 16:54:44 +0200 + +notify-osd (0.9.8-0ubuntu1) jaunty; urgency=low + + * New upstream version: + - introduced env. variable NOTIFY_OSD_MUST_NOT_USE_COMPOSITING for UNR + - added fallback positioning-behaviour for corner-case + when no gnome-panel was found (lp: #351516, #351593) + - added sanity-check for existence of $HOME/.cache (lp: #345770) + * debian/patches/correct_service_install.patch: + - the change is in the new version + + -- Sebastien Bacher Wed, 01 Apr 2009 15:33:59 +0200 + +notify-osd (0.9.7-0ubuntu3) jaunty; urgency=low + + * Merge to trunk, to *really* get 0.9.7. + * Drop "alsdorf" transitional package. We have had it long enough. + * Drop debian/notify-osd.install, not necessary any more with just one + binary package. + + -- Martin Pitt Tue, 31 Mar 2009 13:45:07 +0200 + +notify-osd (0.9.7-0ubuntu2) jaunty; urgency=low + + * Reupload, previous upload dropped Ubuntu patches, causing + stracciatella-session to use notify-osd instead of notification-daemon. + + -- Martin Pitt Tue, 31 Mar 2009 12:53:25 +0200 + +notify-osd (0.9.7-0ubuntu1) jaunty; urgency=low + + * New upstream version: + - added and improved multihead support, + notifications stick to panel whatever the monitor it is on (lp: #331369) + - crashers fixes (lp: #331927, #349133) + - enable the icon lookup fallback mechanism for fallback icons like + notification-display-brightness-* (lp: #344385) + - reworked parts of notify-osd in order to make it adapt dynamically to + changes of font-face, font-size and dpi (lp: #339731) + - ensure X errors will not kill notify-osd + - use HTML- and markup-filter for title- and body-message-text also + in fallback-dialog + * debian/patches/correct_service_install.patch: + - correctly install the dbus service + * debian/rules: + - use simple-patchsys rules + + -- Sebastien Bacher Sat, 28 Mar 2009 12:45:12 +0100 + +notify-osd (0.9.6-0ubuntu2) jaunty; urgency=low + + * debian/control: Add missing new build dependency libwnck-dev. + + -- Martin Pitt Thu, 19 Mar 2009 14:23:19 +0100 + +notify-osd (0.9.6-0ubuntu1) jaunty; urgency=low + + * New upstream release 0.9.6: + - Detect screensaver inhibition for do-not-disturb mode. + - Add compatibility checks to ease transition period for applications to + pick up the capability and hint name changes. (LP: #343553) + - Correctly exit if registering on DBus failed. (LP: #331150) + - Fix filtering of HTML. + - Basic accessibility support. + + -- Martin Pitt Thu, 19 Mar 2009 13:39:13 +0100 + +notify-osd (0.9.5-0ubuntu1) jaunty; urgency=low + + * New upstream bug fix release: + - Fix typo in project name in AC_INIT (LP: #338837) + * Add debian/watch. + * Add bzr-builddeb configuration. + * debian/copyright: Update download location. + + -- Martin Pitt Tue, 17 Mar 2009 13:31:07 +0100 + +notify-osd (0.9.3-0ubuntu1) jaunty; urgency=low + + * New upstream version: + - don't crash on download notifications (lp: #332042) + - correctly pass actions to the fallback (lp: #340773) + - correctly namespace the capability names (lp: #340817) + + -- Sebastien Bacher Fri, 13 Mar 2009 15:13:30 +0100 + +notify-osd (0.9ubuntu2) jaunty; urgency=low + + * Merge bug fixes from trunk (r219): + - Added max. limit of 10 lines for message-body text. + - 3-line wrapping for summary text. + - capability "truncation" now advertised to clients (LP: #337389) + - non-composite mouse-hover effect now fully blanks (LP: #336108) + - disable markup-filter if parsing fails (LP: #331019) + + -- Martin Pitt Wed, 04 Mar 2009 19:47:24 +0100 + +notify-osd (0.9-0ubuntu1) jaunty; urgency=low + + * New upstream release: + - src/bubble.c: Ensure that window is always on top (LP: #331115) + - Updated value-indicator bar-rendering to comply to visual guidelines from + design-team + - Temp. fix for notifications appearing over panel, will visually break for + people without a top panel + - Added API-calls bubble_get_title(), bubble_get_body_message() and + bubble_get_value() to ease a11y + - Don't allow LAYOUT_ICON_ONLY when missing icon pixbuf, nice catch by + Frederic "fredp" Peters + - Implement support for title-only (LP: #333524) + - Changed capability hints: private-synchronous, append and private-icon-only + - make sure text is rendered using system-wide font-settings + for antialiasing, subpixel-order and hinting (LP: #331165) + - Provide fallback gnome icons for people not using the Human theme; thanks to + asomething for the proposed fix + - sync. icon-value following sync. icon-only misses layout-change + (LP: #335250) + - Fallback alert has leftmost button as default (LP: #330091) + - Fallback alert boxes shouldn't use custom icons (LP: #330088) + - Fallback alerts aren't centered (LP: #330484) + * debian/control: Fix Homepage and Vcs-Bzr fields. + * Drop icons/avatar.png from bzr, since it's not part of the orig.tar.gz and + not used in the upstream code. + + -- Martin Pitt Mon, 02 Mar 2009 17:37:47 +0100 + +notify-osd (0.8-0ubuntu4) jaunty; urgency=low + + * Fix Conflicts/Replaces on alsdorf so that the transitional package is + installable (LP: #332831). + + -- Colin Watson Mon, 23 Feb 2009 10:45:53 +0100 + +notify-osd (0.8-0ubuntu3) jaunty; urgency=low + + * data/org.freedesktop.Notifications.service.in: Run + notification-daemon for stracciatella-session. + * Merge bug fixes from trunk: + - Ensure that window is always on top. Thanks Alexander Sack for + the patch! (LP: #331115) + - change window-title to be picked up by window-match-rules of + compiz-plugins and not collide with the old notification-daemon + - egg/egg-fixed.c: Fix unused symbol on arm, which causes build + failure due to -Werror. + + -- Martin Pitt Wed, 18 Feb 2009 22:55:40 +0100 + +notify-osd (0.8-0ubuntu2) jaunty; urgency=low + + [ David Barth ] + * Ensure we are installed with the right icon set. + * imported code with from the trunk with the new 'notify-osd' name + * return proper list of server capabilities + * sync bubble timers to avoid a hole at the top (temporary) + * remove flicker for bubble appearing/fading under the mouse-pointer + * added new default icons for volume & brightness + * numerous other visual tweaks + * various code cleanups + * bumped the release number closer to 1.0 + + [ Martin Pitt ] + * debian/control: Fix Vcs-Bzr to point to Ubuntu packaging branch. + * Add debian/notify-osd.{preinst,postrm}: Divert + notification-daemon's D-BUS activation .service file, and drop the + Conflicts:/Replaces: notification-daemon, so that the packages can + be installed side by side. This paves the way for offering an + "almost vanilla" GNOME session (UbuntuSpec:stracciatella-session). + * debian/control, debian/changelog, debian/notify-osd.install: + Rename package to notify-osd. The transitional package should be + kept for a while, until all users of the PPA and daily Jaunty + users have upgraded to the new package name. + + -- Martin Pitt Wed, 18 Feb 2009 18:53:58 +0100 + +alsdorf (0.8-0ubuntu1) jaunty; urgency=low + + * Initial jaunty upload based on the dxteam work + * debian/control, debian/rules: + - don't run autotools but use a tarball + * COPYING.LGPL: copy the LGPL license in the tarball + + -- Sebastien Bacher Tue, 17 Feb 2009 19:33:58 +0100 --- notify-osd-0.9.21.orig/debian/notify-osd.postinst +++ notify-osd-0.9.21/debian/notify-osd.postinst @@ -0,0 +1,10 @@ +#!/bin/sh +set -e + +case "$1" in + configure) + killall alsdorf notification-daemon notify-osd 2>/dev/null || true + ;; +esac + +#DEBHELPER# --- notify-osd-0.9.21.orig/debian/notify-osd.postrm +++ notify-osd-0.9.21/debian/notify-osd.postrm @@ -0,0 +1,20 @@ +#! /bin/sh +set -e + +case "$1" in + remove|purge) + # Remove our diversion + dpkg-divert --remove --rename --package notify-osd --divert /usr/share/dbus-1/services/org.freedesktop.Notifications.service.notify-osd /usr/share/dbus-1/services/org.freedesktop.Notifications.service > /dev/null + ;; + + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 0 +esac + +#DEBHELPER# + +exit 0 --- notify-osd-0.9.21.orig/debian/source_notify-osd.py +++ notify-osd-0.9.21/debian/source_notify-osd.py @@ -0,0 +1,83 @@ +#!/usr/bin/python + +'''Notify-OSD Apport interface + +Copyright (C) 2009 Canonical Ltd. +Author: Ara Pulido + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. See http://www.gnu.org/copyleft/gpl.html for +the full text of the license. +''' + +import os.path +import subprocess +import os +import apport.hookutils + +HOME = os.getenv("HOME") +NOTIFYOSD_LOG = HOME + '/.cache/notify-osd.log' +RELATED_PACKAGES = ['xserver-xorg', 'libgl1-mesa-glx', 'libdrm2', 'xserver-xorg-video-intel', 'xserver-xorg-video-ati'] + + +def installed_version(pkg): + script = subprocess.Popen(['apt-cache', 'policy', pkg], stdout=subprocess.PIPE) + output = script.communicate()[0] + return output.split('\n')[1].replace("Installed: ", "") + +def add_info(report): + + apport.hookutils.attach_related_packages(report, RELATED_PACKAGES) + apport.hookutils.attach_hardware(report) + + try: + report['XorgConf'] = open('/etc/X11/xorg.conf').read() + except IOError: + pass + + try: + report['XorgLog'] = open('/var/log/Xorg.0.log').read() + except IOError: + pass + + try: + report['XorgLogOld'] = open('/var/log/Xorg.0.log.old').read() + except IOError: + pass + + report['Lsmod'] = apport.hookutils.command_output(['lsmod']) + + try: + script = subprocess.Popen(['grep', 'fglrx', '/var/log/kern.log', '/proc/modules'], stdout=subprocess.PIPE) + matches = script.communicate()[0] + if (matches): + report['fglrx-loaded'] = matches + except OSError: + pass + + report['Xrandr'] = apport.hookutils.command_output(['xrandr', '--verbose']) + + try: + monitors_config = os.path.join(os.environ['HOME'], '.config/monitors.xml') + report['monitors.xml'] = open(monitors_config).read() + except IOError: + pass + + report['xdpyinfo'] = apport.hookutils.command_output(['xdpyinfo']) + report['glxinfo'] = apport.hookutils.command_output(['glxinfo']) + report['setxkbmap'] = apport.hookutils.command_output(['setxkbmap', '-print']) + report['setxkbmap'] = apport.hookutils.command_output(['xkbcomp', ':0', '-w0', '-']) + + report['WindowManager'] = apport.hookutils.command_output(['gconftool-2','--get','/desktop/gnome/session/required_components/windowmanager']) + report['IconTheme'] = apport.hookutils.command_output(['gconftool-2','--get','/desktop/gnome/interface/icon_theme']) + report['GtkTheme'] = apport.hookutils.command_output(['gconftool-2','--get','/desktop/gnome/interface/gtk_theme']) + + +## DEBUGING ## +if __name__ == '__main__': + report = {} + add_info(report) + for key in report: + print '[%s]\n%s' % (key, report[key]) --- notify-osd-0.9.21.orig/debian/compat +++ notify-osd-0.9.21/debian/compat @@ -0,0 +1 @@ +5 --- notify-osd-0.9.21.orig/tests/test-stack.c +++ notify-osd-0.9.21/tests/test-stack.c @@ -79,111 +79,6 @@ g_object_unref (G_OBJECT (stack)); } -static void -test_stack_slots () -{ - Stack* stack = NULL; - Defaults* defaults = defaults_new (); - Observer* observer = observer_new (); - gint x; - gint y; - Bubble* one; - Bubble* two; - - stack = stack_new (defaults, observer); - - // check if stack_is_slot_vacant() can take "crap" without crashing - g_assert_cmpint (stack_is_slot_vacant (NULL, SLOT_TOP), ==, FALSE); - g_assert_cmpint (stack_is_slot_vacant (stack, 832), ==, FALSE); - g_assert_cmpint (stack_is_slot_vacant (NULL, 4321), ==, FALSE); - - // check if stack_get_slot_position can take "crap" without crashing - stack_get_slot_position (NULL, SLOT_TOP, 0, &x, &y); - g_assert_cmpint (x, ==, -1); - g_assert_cmpint (y, ==, -1); - stack_get_slot_position (stack, 4711, 0, &x, &y); - g_assert_cmpint (x, ==, -1); - g_assert_cmpint (y, ==, -1); - stack_get_slot_position (NULL, 42, 0, NULL, NULL); - - // check if stack_allocate_slot() can take "crap" without crashing - one = bubble_new (defaults); - two = bubble_new (defaults); - g_assert_cmpint (stack_allocate_slot (NULL, one, SLOT_TOP), ==, FALSE); - g_assert_cmpint (stack_allocate_slot (stack, NULL, SLOT_TOP), ==, FALSE); - g_assert_cmpint (stack_allocate_slot (stack, one, 4711), ==, FALSE); - - // check if stack_free_slot() can take "crap" without crashing - g_assert_cmpint (stack_free_slot (NULL, two), ==, FALSE); - g_assert_cmpint (stack_free_slot (stack, NULL), ==, FALSE); - - // initially both slots should be empty - g_assert_cmpint (stack_is_slot_vacant (stack, SLOT_TOP), ==, VACANT); - g_assert_cmpint (stack_is_slot_vacant (stack, SLOT_BOTTOM), ==, VACANT); - g_object_unref (one); - g_object_unref (two); - - // fill top slot, verify it's occupied, free it, verify again - one = bubble_new (defaults); - g_assert_cmpint (stack_allocate_slot (stack, one, SLOT_TOP), ==, TRUE); - g_assert_cmpint (stack_is_slot_vacant (stack, SLOT_TOP), ==, OCCUPIED); - g_assert_cmpint (stack_free_slot (stack, one), ==, TRUE); - g_assert_cmpint (stack_is_slot_vacant (stack, SLOT_TOP), ==, VACANT); - g_object_unref (one); - - // fill bottom slot, verify it's occupied, free it, verify again - two = bubble_new (defaults); - g_assert_cmpint (stack_allocate_slot (stack, two, SLOT_BOTTOM), ==, TRUE); - g_assert_cmpint (stack_is_slot_vacant (stack, SLOT_BOTTOM), ==, OCCUPIED); - g_assert_cmpint (stack_free_slot (stack, two), ==, TRUE); - g_assert_cmpint (stack_is_slot_vacant (stack, SLOT_BOTTOM), ==, VACANT); - g_object_unref (two); - - // try to free vacant slots - one = bubble_new (defaults); - two = bubble_new (defaults); - g_assert_cmpint (stack_is_slot_vacant (stack, SLOT_TOP), ==, VACANT); - g_assert_cmpint (stack_is_slot_vacant (stack, SLOT_BOTTOM), ==, VACANT); - g_assert_cmpint (stack_free_slot (stack, one), ==, FALSE); - g_assert_cmpint (stack_free_slot (stack, two), ==, FALSE); - g_object_unref (one); - g_object_unref (two); - - // allocate top slot, verify, try to allocate top slot again - one = bubble_new (defaults); - two = bubble_new (defaults); - g_assert_cmpint (stack_allocate_slot (stack, one, SLOT_TOP), ==, TRUE); - g_assert_cmpint (stack_is_slot_vacant (stack, SLOT_TOP), ==, OCCUPIED); - g_assert_cmpint (stack_allocate_slot (stack, two, SLOT_TOP), ==, FALSE); - g_assert_cmpint (stack_free_slot (stack, one), ==, TRUE); - g_assert_cmpint (stack_is_slot_vacant (stack, SLOT_TOP), ==, VACANT); - g_object_unref (one); - g_object_unref (two); - - // allocate bottom slot, verify, try to allocate bottom slot again - one = bubble_new (defaults); - two = bubble_new (defaults); - g_assert_cmpint (stack_allocate_slot (stack, one, SLOT_BOTTOM), ==, TRUE); - g_assert_cmpint (stack_is_slot_vacant (stack, SLOT_BOTTOM), ==, OCCUPIED); - g_assert_cmpint (stack_allocate_slot (stack, two, SLOT_BOTTOM), ==, FALSE); - g_assert_cmpint (stack_free_slot (stack, one), ==, TRUE); - g_assert_cmpint (stack_is_slot_vacant (stack, SLOT_BOTTOM), ==, VACANT); - g_object_unref (one); - g_object_unref (two); - - // check if we can get reasonable values from stack_get_slot_position() - // FIXME: disabled this test for the moment, hopefully it works within - // a real environment - /*stack_get_slot_position (stack, SLOT_TOP, &x, &y); - g_assert_cmpint (x, >, -1); - g_assert_cmpint (y, >, -1); - stack_get_slot_position (stack, SLOT_BOTTOM, &x, &y); - g_assert_cmpint (x, >, -1); - g_assert_cmpint (y, >, -1);*/ - - g_object_unref (G_OBJECT (stack)); -} - GTestSuite * test_stack_create_test_suite (void) { @@ -196,7 +91,6 @@ g_test_suite_add(ts, TC(test_stack_new)); g_test_suite_add(ts, TC(test_stack_del)); g_test_suite_add(ts, TC(test_stack_push)); - g_test_suite_add(ts, TC(test_stack_slots)); return ts; } --- notify-osd-0.9.21.orig/tests/test-dbus.c +++ notify-osd-0.9.21/tests/test-dbus.c @@ -89,7 +89,7 @@ &version, &specver); g_assert (ret); g_assert (g_strrstr (name, "notify-osd")); - g_assert (g_strrstr (specver, "1.1")); + g_assert (g_strrstr (specver, "0.10")); } GTestSuite * --- notify-osd-0.9.21.orig/tests/tests.suppression +++ notify-osd-0.9.21/tests/tests.suppression @@ -0,0 +1,294 @@ +# +# Valgrind suppression file for Gtk+ 2.12 +# +# Format specification: +# http://valgrind.org/docs/manual/manual-core.html#manual-core.suppress +# + +# +# glibc Ubuntu Edgy +# + +{ + libc: getpwnam_r + Memcheck:Addr4 + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/tls/i686/cmov/libc-*.so + obj:/lib/ld-*.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + obj:/lib/tls/i686/cmov/libc-*.so + fun:__nss_passwd_lookup + fun:getpwnam_r + fun:g_get_any_init_do + fun:g_get_home_dir + fun:gtk_rc_add_initial_default_files + fun:_gtk_rc_init + fun:post_parse_hook + fun:g_option_context_parse + fun:gtk_parse_args + fun:gtk_init_check + fun:gtk_init +} + +{ + libc: getpwnam_r + Memcheck:Addr4 + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/tls/i686/cmov/libc-*.so + obj:/lib/ld-*.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + obj:/lib/tls/i686/cmov/libc-*.so + fun:__nss_passwd_lookup + fun:getpwnam_r + fun:g_get_any_init_do + fun:g_get_home_dir + fun:gtk_rc_add_initial_default_files + fun:_gtk_rc_init + fun:post_parse_hook + fun:g_option_context_parse + fun:gtk_parse_args + fun:gtk_init_check + fun:gtk_init +} + +{ + libc: getpwnam_r + Memcheck:Addr4 + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/tls/i686/cmov/libc-*.so + obj:/lib/ld-*.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + fun:__nss_next + fun:getpwnam_r + fun:g_get_any_init_do + fun:g_get_home_dir + fun:gtk_rc_add_initial_default_files + fun:_gtk_rc_init + fun:post_parse_hook + fun:g_option_context_parse + fun:gtk_parse_args + fun:gtk_init_check + fun:gtk_init +} + +{ + libc: getpwnam_r + Memcheck:Addr4 + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/ld-*.so + obj:/lib/tls/i686/cmov/libc-*.so + obj:/lib/ld-*.so + fun:__libc_dlopen_mode + fun:__nss_lookup_function + fun:__nss_next + fun:getpwnam_r + fun:g_get_any_init_do + fun:g_get_home_dir + fun:gtk_rc_add_initial_default_files + fun:_gtk_rc_init + fun:post_parse_hook + fun:g_option_context_parse + fun:gtk_parse_args + fun:gtk_init_check + fun:gtk_init +} + +# +# glibc Ubuntu feisty +# + +{ + getpwnam_r + Memcheck:Leak + fun:malloc + obj:/lib/libc-2.5.so + fun:__nss_database_lookup + obj:* + obj:* + fun:getpwnam_r +} + +# +# X +# + +{ + XSupportsLocale + Memcheck:Addr4 + obj:/lib/ld-*.so + obj:/lib/tls/i686/cmov/libdl-*.so + obj:/lib/ld-*.so + obj:/lib/tls/i686/cmov/libdl-*.so + fun:dlopen + obj:/usr/lib/libX11.so.6.2.0 + fun:_XlcDynamicLoad + fun:_XOpenLC + fun:_XlcCurrentLC + fun:XSupportsLocale + fun:_gdk_x11_initialize_locale + fun:_gdk_windowing_init + fun:gdk_pre_parse_libgtk_only + fun:pre_parse_hook + fun:g_option_context_parse + fun:gtk_parse_args + fun:gtk_init_check + fun:gtk_init + fun:main +} + + +{ + Xcursor + Memcheck:Leak + fun:malloc + obj:/usr/lib/libXcursor.so.1.0.2 + obj:/usr/lib/libXcursor.so.1.0.2 + fun:XcursorXcFileLoadImages + fun:XcursorFileLoadImages + fun:XcursorLibraryLoadImages + fun:XcursorShapeLoadImages + fun:XcursorTryShapeCursor + fun:XCreateGlyphCursor + fun:XCreateFontCursor + fun:gdk_cursor_new_for_display +} + +{ + XcursorGetTheme + Memcheck:Leak + fun:malloc + fun:/usr/lib/libX11.so.6.2.0 + fun:/usr/lib/libX11.so.6.2.0 + fun:XrmGetStringDatabase + fun:XGetDefault + fun:_XcursorGetDisplayInfo + fun:XcursorGetTheme +} + +{ + XOpenDisplay + Memcheck:Leak + fun:calloc + fun:XOpenDisplay +} + +{ + XOpenDisplay + Memcheck:Leak + fun:malloc + fun:XOpenDisplay +} + +# +# fontconfig +# + +{ + fontconfig + Memcheck:Leak + fun:realloc + fun:FcPatternObjectInsertElt + fun:FcPatternObjectAddWithBinding +} + +{ + pango_fc_font_map_load_fontset + Memcheck:Leak + fun:malloc + fun:FcLangSetCreate + fun:FcLangSetCopy + fun:FcValueSave + fun:FcPatternObjectAddWithBinding + fun:FcPatternObjectAdd + fun:FcFontRenderPrepare + fun:pango_fc_font_map_load_fontset + fun:pango_font_map_load_fontset +} + +{ + pango_font_map_load_fontset + Memcheck:Leak + fun:malloc + fun:FcPatternObjectAddWithBinding + fun:FcPatternObjectAdd + fun:FcFontRenderPrepare + fun:pango_fc_font_map_load_fontset + fun:pango_font_map_load_fontset +} + +{ + pango_fc_font_map_load_fontset + Memcheck:Leak + fun:malloc + fun:FcStrStaticName + fun:FcPatternObjectAddWithBinding + fun:FcPatternObjectAdd + fun:FcFontRenderPrepare + fun:pango_fc_font_map_load_fontset +} + +{ + pango_fc_font_map_list_families + Memcheck:Leak + fun:malloc + fun:FcStrStaticName + fun:FcPatternObjectAddWithBinding + fun:FcPatternAdd + fun:FcFontSetList + fun:FcFontList + fun:pango_fc_font_map_list_families +} + +# +# freetype +# + +{ + freetype FT_Init_FreeType + Memcheck:Leak + fun:malloc + obj:/usr/lib/libfreetype.so.6.3.10 + fun:ft_mem_qalloc + fun:ft_mem_alloc + fun:FT_New_Library + fun:FT_Init_FreeType +} + +# +# glib +# + +{ + glib g_rand_new + Memcheck:Leak + fun:calloc + fun:g_malloc0 + fun:g_rand_new_with_seed_array + fun:g_rand_new + fun:g_random_int +} --- notify-osd-0.9.21.orig/tests/test-defaults.c +++ notify-osd-0.9.21/tests/test-defaults.c @@ -164,29 +164,6 @@ g_object_unref (G_OBJECT (defaults)); } -static void -test_defaults_get_slot_allocation () -{ - Defaults* defaults = defaults_new (); - - // upon creation slot-allocation should not be unset - g_assert_cmpint (defaults_get_slot_allocation (defaults), - !=, - SLOT_ALLOCATION_NONE); - - // currently the default value should be SLOT_ALLOCATION_FIXED - g_assert_cmpint (defaults_get_slot_allocation (defaults), - ==, - SLOT_ALLOCATION_FIXED); - - // check if we can pass "crap" to the call without causing a crash - g_assert_cmpint (defaults_get_slot_allocation (NULL), - ==, - SLOT_ALLOCATION_NONE); - - g_object_unref (G_OBJECT (defaults)); -} - GTestSuite * test_defaults_create_test_suite (void) { @@ -207,7 +184,6 @@ g_test_suite_add(ts, TC(test_defaults_get_stack_height)); g_test_suite_add(ts, TC(test_defaults_get_bubble_width)); g_test_suite_add(ts, TC(test_defaults_get_gravity)); - g_test_suite_add(ts, TC(test_defaults_get_slot_allocation)); return ts; } --- notify-osd-0.9.21.orig/tests/notifyosd.py +++ notify-osd-0.9.21/tests/notifyosd.py @@ -0,0 +1,87 @@ +#!/usr/bin/python +import sys +import time +from optparse import OptionParser + +import gtk +import pynotify + +ICON_ONLY_HINT = "x-canonical-private-icon-only" +APPEND_HINT = "x-canonical-append" +SYNCHRONOUS_HINT = "x-canonical-private-synchronous" +VALUE_HINT = "value" + +def create_gauge_notification(title, icon, value): + n = pynotify.Notification(title, "", icon) + n.set_hint_string(SYNCHRONOUS_HINT, "") + n.set_hint_int32(VALUE_HINT, value) + return n + +def create_icon_only_notification(title, icon): + n = pynotify.Notification(title, "", icon) + n.set_hint_string(ICON_ONLY_HINT, "") + return n + +USAGE = \ +"""%prog [options] [<body-text>] + +If body-text is "-" %prog will display the content of stdin. +""" + +def main (): + if not pynotify.init("notifyosd"): + return 1 + + parser = OptionParser() + parser.usage = USAGE + + parser.add_option("-i", "--icon", dest="icon", + help = "Name of the icon to show") + + parser.add_option("--icon-data", dest="icon_data", + help = "Load icon data from a custom file") + + parser.add_option("-v", "--value", dest="value", + help = "Start in value mode and display the percentage VALUE in a gauge") + + parser.add_option("--icon-only", dest="icon_only", + help = "Only show icon, ignoring body", + action="store_true", default=False) + + (options, args) = parser.parse_args() + + if len(args) == 0: + parser.print_usage() + return 1 + title = args[0] + + if len(args) > 1: + if args[1] == "-": + body = sys.stdin.read() + else: + body = " ".join(args[1:]) + else: + body = "" + + if options.value: + if body: + print "Note: ignoring body in value mode" + n = create_gauge_notification(title, options.icon, int(options.value)) + elif options.icon_only: + if body: + print "Note: ignoring body in icon_only mode" + if not options.icon: + print "Error: icon name is missing" + return 1 + n = create_icon_only_notification(title, options.icon) + else: + n = pynotify.Notification(title, body, options.icon) + + if options.icon_data: + pixbuf = gtk.gdk.pixbuf_new_from_file(options.icon_data) + n.set_icon_from_pixbuf(pixbuf) + + n.show () + +if __name__ == "__main__": + sys.exit (main ()) --- notify-osd-0.9.21.orig/tests/test-withlib.c +++ notify-osd-0.9.21/tests/test-withlib.c @@ -60,7 +60,7 @@ g_assert (ret); g_assert (g_strrstr (name, "notify-osd")); - g_assert (g_strrstr (specver, "1.1")); + g_assert (g_strrstr (specver, "0.10")); } static void --- notify-osd-0.9.21.orig/data/org.freedesktop.Notifications.service.in +++ notify-osd-0.9.21/data/org.freedesktop.Notifications.service.in @@ -1,3 +1,3 @@ [D-BUS Service] Name=org.freedesktop.Notifications -Exec=@LIBEXECDIR@/notify-osd +Exec=/bin/sh -c 'if [ ! -x /usr/lib/notification-daemon/notification-daemon ] || [ "${GDMSESSION%.desktop}" = gnome ] || [ "${GDMSESSION%.desktop}" = default -a "$(basename `readlink /etc/alternatives/x-session-manager`)" = gnome-session ]; then exec @LIBEXECDIR@/notify-osd; else exec /usr/lib/notification-daemon/notification-daemon; fi' --- notify-osd-0.9.21.orig/src/bubble.c +++ notify-osd-0.9.21/src/bubble.c @@ -83,6 +83,7 @@ gboolean icon_only; gint future_height; gboolean prevent_fade; + BubblePlacement placement; // these will be replaced by notification_t* later on GString* title; @@ -2250,6 +2251,7 @@ this->priv->tile_body = NULL; this->priv->tile_indicator = NULL; this->priv->prevent_fade = FALSE; + this->priv->placement = PLACEMENT_NEW; update_input_shape (window, 1, 1); @@ -3647,3 +3649,12 @@ bubble_start_timer (self); bubble_start_timer (other); } + +BubblePlacement +bubble_get_placement (Bubble* self) +{ + if (!self || !IS_BUBBLE (self)) + return PLACEMENT_NONE; + + return GET_PRIVATE (self)->placement; +} --- notify-osd-0.9.21.orig/src/stack.c +++ notify-osd-0.9.21/src/stack.c @@ -319,12 +319,10 @@ if (!this) return NULL; - this->defaults = defaults; - this->observer = observer; - this->list = NULL; - this->next_id = 1; - this->slots[SLOT_TOP] = NULL; - this->slots[SLOT_BOTTOM] = NULL; + this->defaults = defaults; + this->observer = observer; + this->list = NULL; + this->next_id = 1; /* hook up handler to act on changes of defaults/settings */ g_signal_connect (G_OBJECT (defaults), @@ -356,9 +354,6 @@ if (n != NULL) { - if (IS_BUBBLE (n)) - stack_free_slot (stack, BUBBLE (n)); - if (IS_BUBBLE (n) && bubble_is_synchronous (BUBBLE (n))) { @@ -741,6 +736,7 @@ if (bubble_is_synchronous (bubble)) { stack_display_sync_bubble (self, bubble); + } else { stack_push_bubble (self, bubble); @@ -754,10 +750,9 @@ /* make sure the sync. bubble is positioned correctly even for the append case */ - // no longer needed since we have the two-slots mechanism now - //if (sync_bubble != NULL - // && bubble_is_visible (sync_bubble)) - // stack_display_position_sync_bubble (self, sync_bubble); + if (sync_bubble != NULL + && bubble_is_visible (sync_bubble)) + stack_display_position_sync_bubble (self, sync_bubble); /* update the layout of the stack; * this will also open the new bubble */ @@ -830,165 +825,7 @@ *out_name = g_strdup ("notify-osd"); *out_vendor = g_strdup ("Canonical Ltd"); *out_version = g_strdup ("1.0"); - *out_spec_ver = g_strdup ("1.1"); + *out_spec_ver = g_strdup ("0.10"); return TRUE; } - -gboolean -stack_is_slot_vacant (Stack* self, - Slot slot) -{ - // sanity checks - if (!self || !IS_STACK (self)) - return FALSE; - - if (slot != SLOT_TOP && slot != SLOT_BOTTOM) - return FALSE; - - return self->slots[slot] == NULL ? VACANT : OCCUPIED; -} - -// return values of -1 for x and y indicate an error by the caller -void -stack_get_slot_position (Stack* self, - Slot slot, - gint bubble_height, - gint* x, - gint* y) -{ - // sanity checks - if (!x && !y) - return; - - if (!self || !IS_STACK (self)) - { - *x = -1; - *y = -1; - return; - } - - if (slot != SLOT_TOP && slot != SLOT_BOTTOM) - { - *x = -1; - *y = -1; - return; - } - - // initialize x and y - defaults_get_top_corner (self->defaults, x, y); - - // differentiate returned top-left corner for top and bottom slot - // depending on the placement - switch (defaults_get_gravity (self->defaults)) - { - Defaults* d; - - case GRAVITY_EAST: - d = self->defaults; - - // the position for the sync./feedback bubble - if (slot == SLOT_TOP) - *y += defaults_get_desktop_height (d) / 2 - - EM2PIXELS (defaults_get_bubble_vert_gap (d) / 2.0f, d) - - bubble_height + - EM2PIXELS (defaults_get_bubble_shadow_size (d), d); - // the position for the async. bubble - else if (slot == SLOT_BOTTOM) - *y += defaults_get_desktop_height (d) / 2 + - EM2PIXELS (defaults_get_bubble_vert_gap (d) / 2.0f, d) - - EM2PIXELS (defaults_get_bubble_shadow_size (d), d); - break; - - case GRAVITY_NORTH_EAST: - d = self->defaults; - - // there's nothing to do for slot == SLOT_TOP as we - // already have correct x and y from the call to - // defaults_get_top_corner() earlier - - // this needs to look at the height of the bubble in the - // top slot - if (slot == SLOT_BOTTOM) - { - switch (defaults_get_slot_allocation (d)) - { - case SLOT_ALLOCATION_FIXED: - *y += EM2PIXELS (defaults_get_icon_size (d), d) + - 2 * EM2PIXELS (defaults_get_margin_size (d), d) + - EM2PIXELS (defaults_get_bubble_vert_gap (d), d); /* + - 2 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d);*/ - break; - - case SLOT_ALLOCATION_DYNAMIC: - g_assert (stack_is_slot_vacant (self, SLOT_TOP) == OCCUPIED); - *y += bubble_get_height (self->slots[SLOT_TOP]) + - EM2PIXELS (defaults_get_bubble_vert_gap (d), d) - - 2 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d); - break; - - default: - break; - } - - } - break; - - default: - g_warning ("Unhandled placement!\n"); - break; - } -} - -// call this _before_ the fade-in animation of the bubble starts -gboolean -stack_allocate_slot (Stack* self, - Bubble* bubble, - Slot slot) -{ - // sanity checks - if (!self || !IS_STACK (self)) - return FALSE; - - if (!bubble || !IS_BUBBLE (bubble)) - return FALSE; - - if (slot != SLOT_TOP && slot != SLOT_BOTTOM) - return FALSE; - - if (stack_is_slot_vacant (self, slot)) - self->slots[slot] = BUBBLE (g_object_ref ((gpointer) bubble)); - else - return FALSE; - - return TRUE; -} - -// call this _after_ the fade-out animation of the bubble is finished -gboolean -stack_free_slot (Stack* self, - Bubble* bubble) -{ - // sanity checks - if (!self || !IS_STACK (self)) - return FALSE; - - if (!bubble || !IS_BUBBLE (bubble)) - return FALSE; - - // check top and bottom slots for bubble pointer equality - if (bubble == self->slots[SLOT_TOP]) - { - g_object_unref (self->slots[SLOT_TOP]); - self->slots[SLOT_TOP] = NULL; - } - else if (bubble == self->slots[SLOT_BOTTOM]) - { - g_object_unref (self->slots[SLOT_BOTTOM]); - self->slots[SLOT_BOTTOM] = NULL; - } - else - return FALSE; - - return TRUE; -} --- notify-osd-0.9.21.orig/src/send-test-notification.sh +++ notify-osd-0.9.21/src/send-test-notification.sh @@ -0,0 +1,63 @@ +#!/bin/sh + +notify-send "Take note" "The next example will test the icon-only layout-case" -i dialog-info +sleep 2 +notify-send "Eject" -i notification-device-eject -h string:x-canonical-private-icon-only: +sleep 2 +notify-send "WiFi signal found" -i notification-network-wireless-medium +sleep 2 +notify-send "WiFi signal lost" -i notification-network-wireless-disconnected +sleep 2 +notify-send "Volume" -i notification-audio-volume-medium -h int:value:75 -h string:x-canonical-private-synchronous: +sleep 2 +notify-send "Volume" -i notification-audio-volume-low -h int:value:30 -h string:x-canonical-private-synchronous: +sleep 2 +notify-send "Brightness" -i notification-display-brightness-high -h int:value:101 -h string:x-canonical-private-synchronous: +sleep 2 +notify-send "Brightness" -i notification-keyboard-brightness-medium -h int:value:45 -h string:x-canonical-private-synchronous: +sleep 2 +notify-send "Testing markup" "Some <b>bold</b>, <u>underlined</u>, <i>italic</i> text. Note, you should not see any marked up text." +sleep 2 +notify-send "Jamshed Kakar" "Hey, what about this restaurant? http://www.blafasel.org + +Would you go from your place by train or should I pick you up from work? What do you think?" +sleep 2 +notify-send "English bubble" "The quick brown fox jumps over the lazy dog." -i network +sleep 2 +notify-send "Bubble from Germany" "Polyfon zwitschernd aßen Mäxchens Vögel Rüben, Joghurt und Quark." -i gnome-system +sleep 2 +notify-send "Very russian" "Съешь ещё этих мягких французских булок, да выпей чаю." -i dialog-info +sleep 2 +notify-send "More from Germany" "Oje, Qualm verwölkt Dix zig Farbtriptychons." -i gnome-globe +sleep 2 +notify-send "Filter the world 1/3" "<a href=\"http://www.ubuntu.com/\">Ubuntu</a> +Don't rock the boat +Kick him while he's down +\"Film spectators are quiet vampires.\" +Peace & Love +War & Peace +Law & Order +Love & War +7 > 3 +7 > 3" +sleep 2 +notify-send "Filter the world 2/3" "7 > 3 +7 > 3 +14 < 42 +14 < 42 +14 < 42 +14 < 42 +>< +<> +< this is not a tag > +<i>Not italic</i>" +sleep 2 +notify-send "Filter the world 3/3" "<b>So broken</i> +<img src=\"foobar.png\" />Nothing to see +<u>Test</u> +<b>Bold</b> +<span>Span</span> +<s>E-flat</s> +<sub>Sandwich</sub> +<small>Fry</small> +<tt>Testing tag</tt>" --- notify-osd-0.9.21.orig/src/defaults.h +++ notify-osd-0.9.21/src/defaults.h @@ -61,61 +61,53 @@ GRAVITY_EAST // vertically centered at right of screen } Gravity; -typedef enum -{ - SLOT_ALLOCATION_NONE = 0, - SLOT_ALLOCATION_FIXED, // async. always in top, sync. always in bottom - SLOT_ALLOCATION_DYNAMIC // async. and sync can take top or bottom -} SlotAllocation; - /* instance structure */ struct _Defaults { GObject parent; /* private */ - GConfClient* context; - guint notifier[6]; - gint desktop_width; - gint desktop_height; - gint desktop_top; - gint desktop_bottom; - gint desktop_left; - gint desktop_right; - gdouble desktop_bottom_gap; - gdouble stack_height; - gdouble bubble_vert_gap; - gdouble bubble_horz_gap; - gdouble bubble_width; - gdouble bubble_min_height; - gdouble bubble_max_height; - gdouble bubble_shadow_size; - GString* bubble_shadow_color; - GString* bubble_bg_color; - GString* bubble_bg_opacity; - GString* bubble_hover_opacity; - gdouble bubble_corner_radius; - gdouble content_shadow_size; - GString* content_shadow_color; - gdouble margin_size; - gdouble icon_size; - gdouble gauge_size; - gdouble gauge_outline_width; - gint fade_in_timeout; - gint fade_out_timeout; - gint on_screen_timeout; - GString* text_font_face; - GString* text_title_color; - gint text_title_weight; - gdouble text_title_size; - GString* text_body_color; - gint text_body_weight; - gdouble text_body_size; - gdouble pixels_per_em; - gdouble system_font_size; - gdouble screen_dpi; - Gravity gravity; - SlotAllocation slot_allocation; + GConfClient* context; + guint notifier[6]; + gint desktop_width; + gint desktop_height; + gint desktop_top; + gint desktop_bottom; + gint desktop_left; + gint desktop_right; + gdouble desktop_bottom_gap; + gdouble stack_height; + gdouble bubble_vert_gap; + gdouble bubble_horz_gap; + gdouble bubble_width; + gdouble bubble_min_height; + gdouble bubble_max_height; + gdouble bubble_shadow_size; + GString* bubble_shadow_color; + GString* bubble_bg_color; + GString* bubble_bg_opacity; + GString* bubble_hover_opacity; + gdouble bubble_corner_radius; + gdouble content_shadow_size; + GString* content_shadow_color; + gdouble margin_size; + gdouble icon_size; + gdouble gauge_size; + gdouble gauge_outline_width; + gint fade_in_timeout; + gint fade_out_timeout; + gint on_screen_timeout; + GString* text_font_face; + GString* text_title_color; + gint text_title_weight; + gdouble text_title_size; + GString* text_body_color; + gint text_body_weight; + gdouble text_body_size; + gdouble pixels_per_em; + gdouble system_font_size; + gdouble screen_dpi; + Gravity gravity; }; /* class structure */ @@ -260,9 +252,6 @@ Gravity defaults_get_gravity (Defaults *self); -SlotAllocation -defaults_get_slot_allocation (Defaults *self); - G_END_DECLS #endif /* __DEFAULTS_H */ --- notify-osd-0.9.21.orig/src/bubble.h +++ notify-osd-0.9.21/src/bubble.h @@ -48,6 +48,13 @@ LAYOUT_TITLE_ONLY } BubbleLayout; +typedef enum +{ + PLACEMENT_NONE = 0, + PLACEMENT_OLD, // top-right of screen + PLACEMENT_NEW // vertically centered at right of screen +} BubblePlacement; + G_BEGIN_DECLS #define BUBBLE_TYPE (bubble_get_type ()) @@ -260,6 +267,9 @@ const char *process_name, gchar **actions); +BubblePlacement +bubble_get_placement (Bubble* self); + G_END_DECLS #endif // __BUBBLE_H --- notify-osd-0.9.21.orig/src/display.c +++ notify-osd-0.9.21/src/display.c @@ -71,119 +71,42 @@ return y1 == y2; } + static void stack_display_position_sync_bubble (Stack *self, Bubble *bubble) { Defaults* d = self->defaults; gint y = 0; gint x = 0; + Bubble* async; defaults_get_top_corner (d, &x, &y); // TODO: with multi-head, in focus follow mode, there may be enough // space left on the top monitor - switch (defaults_get_slot_allocation (d)) + switch (defaults_get_gravity (d)) { - case SLOT_ALLOCATION_FIXED: - if (stack_is_slot_vacant (self, SLOT_TOP)) + case GRAVITY_NORTH_EAST: + async = stack_find_bubble_on_display (self); + if (async != NULL) { - stack_get_slot_position (self, - SLOT_TOP, - bubble_get_height (bubble), - &x, - &y); - if (x == -1 || y == -1) - g_warning ("%s(): No slot-coords!\n", - G_STRFUNC); - else - stack_allocate_slot (self, - bubble, - SLOT_TOP); - } - else - { - g_warning ("%s(): Top slot taken!\n", - G_STRFUNC); + d = self->defaults; + y += bubble_get_future_height (async); + y += EM2PIXELS (defaults_get_bubble_vert_gap (d), d) - + 2 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d); } break; - case SLOT_ALLOCATION_DYNAMIC: - // see if we're call at the wrong moment, when both - // slots are occupied by bubbles - if (!stack_is_slot_vacant (self, SLOT_TOP) && - !stack_is_slot_vacant (self, SLOT_BOTTOM)) - { - g_warning ("%s(): Both slots taken!\n", - G_STRFUNC); - } - else - { - // first check if we can place the sync. bubble - // in the top slot and the bottom slot is still - // vacant, this is to avoid the "gap" between - // bottom slot and panel - if (stack_is_slot_vacant (self, SLOT_TOP) && - stack_is_slot_vacant (self, SLOT_BOTTOM)) - { - stack_get_slot_position (self, - SLOT_TOP, - bubble_get_height (bubble), - &x, - &y); - if (x == -1 || y == -1) - g_warning ("%s(): No coords!\n", - G_STRFUNC); - else - stack_allocate_slot (self, - bubble, - SLOT_TOP); - } - // next check if top is occupied and bottom is - // still vacant, then place sync. bubble in - // bottom slot - else if (!stack_is_slot_vacant (self, - SLOT_TOP) && - stack_is_slot_vacant (self, - SLOT_BOTTOM)) - { - stack_get_slot_position (self, - SLOT_BOTTOM, - bubble_get_height (bubble), - &x, - &y); - if (x == -1 || y == -1) - g_warning ("%s(): No coords!\n", - G_STRFUNC); - else - { - stack_allocate_slot ( - self, - bubble, - SLOT_BOTTOM); - - bubble_sync_with ( - bubble, - self->slots[SLOT_TOP]); - } - } - // this case, top vacant, bottom occupied, - // should never happen for the old placement, - // we want to avoid the "gap" between the bottom - // bubble and the panel - else if (stack_is_slot_vacant (self, - SLOT_TOP) && - !stack_is_slot_vacant (self, - SLOT_BOTTOM)) - { - g_warning ("%s(): Gap, gap, gap!!!\n", - G_STRFUNC); - } - } + case GRAVITY_EAST: + y += defaults_get_desktop_height (d) / 2 - + EM2PIXELS (defaults_get_bubble_vert_gap (d) / 2.0f, d) - + bubble_get_height (bubble) + + EM2PIXELS (defaults_get_bubble_shadow_size (d), d); break; - default : - g_warning ("Unhandled slot-allocation!\n"); + default: + g_warning ("Unhandled gravity!\n"); break; } @@ -191,7 +114,6 @@ } static void - stack_display_sync_bubble (Stack *self, Bubble *bubble) { g_return_if_fail (IS_STACK (self)); @@ -319,104 +241,41 @@ d = self->defaults; - switch (defaults_get_slot_allocation (d)) + switch (defaults_get_gravity (d)) { - case SLOT_ALLOCATION_FIXED: - if (stack_is_slot_vacant (self, SLOT_TOP) && - bubble_is_synchronous (bubble)) - { - stack_get_slot_position (self, - SLOT_TOP, - bubble_get_height (bubble), - &x, - &y); - if (x == -1 || y == -1) - g_warning ("%s(): No coords!\n", - G_STRFUNC); - else - stack_allocate_slot (self, - bubble, - SLOT_TOP); - } - else if (stack_is_slot_vacant (self, SLOT_BOTTOM) && - !bubble_is_synchronous (bubble)) + case GRAVITY_NORTH_EAST: + if (sync_bubble != NULL && bubble_is_visible (sync_bubble)) { - stack_get_slot_position (self, - SLOT_BOTTOM, - bubble_get_height (bubble), - &x, - &y); - if (x == -1 || y == -1) - g_warning ("%s(): No coords!\n", - G_STRFUNC); - else - stack_allocate_slot (self, - bubble, - SLOT_BOTTOM); - } - else - { - g_warning ("%s(): Error while handling fixed " - "slot-allocation!\n", - G_STRFUNC); + d = self->defaults; + y += bubble_get_height (sync_bubble); + y += EM2PIXELS (defaults_get_bubble_vert_gap (d), d) + - 2 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d); + + // synchronize the sync bubble with the timeout of the bubble at + // the bottom + if (stack_is_at_top_corner (self, sync_bubble)) + bubble_sync_with (sync_bubble, bubble); } break; - case SLOT_ALLOCATION_DYNAMIC: - if (stack_is_slot_vacant (self, SLOT_TOP) && - stack_is_slot_vacant (self, SLOT_BOTTOM)) - { - stack_get_slot_position (self, - SLOT_TOP, - bubble_get_height (bubble), - &x, - &y); - if (x == -1 || y == -1) - g_warning ("%s(): No coords!\n", - G_STRFUNC); - else - stack_allocate_slot (self, - bubble, - SLOT_TOP); - } - else if (!stack_is_slot_vacant (self, SLOT_TOP) && - stack_is_slot_vacant (self, SLOT_BOTTOM)) + case GRAVITY_EAST: + if (sync_bubble != NULL && bubble_is_visible (sync_bubble)) { - stack_get_slot_position (self, - SLOT_BOTTOM, - bubble_get_height (bubble), - &x, - &y); - if (x == -1 || y == -1) - g_warning ("%s(): No coords!\n", - G_STRFUNC); - else - { - stack_allocate_slot (self, - bubble, - SLOT_BOTTOM); - - if (sync_bubble != NULL && - bubble_is_visible (sync_bubble)) - { - // synchronize the sync bubble with the timeout - // of the bubble at the bottom - bubble_sync_with (self->slots[SLOT_TOP], - self->slots[SLOT_BOTTOM]); - } - } + y += defaults_get_desktop_height (d) / 2 - + EM2PIXELS (defaults_get_bubble_vert_gap (d) / 2.0f, d) - + bubble_get_height (sync_bubble) + + EM2PIXELS (defaults_get_bubble_shadow_size (d), d); } else { - g_warning ("%s(): Error while handling dynamic " - "slot-allocation!\n", - G_STRFUNC); + y += defaults_get_desktop_height (d) / 2 + + EM2PIXELS (defaults_get_bubble_vert_gap (d) / 2.0f, d) - + EM2PIXELS (defaults_get_bubble_shadow_size (d), d); } break; - default : - g_warning ("%s(): Unhandled slot-allocation scheme!\n", - G_STRFUNC); + default: + g_warning ("Unhandled gravity!\n"); break; } --- notify-osd-0.9.21.orig/src/stack.h +++ notify-osd-0.9.21/src/stack.h @@ -48,18 +48,9 @@ #define MAX_STACK_SIZE 50 -#define VACANT TRUE -#define OCCUPIED FALSE - typedef struct _Stack Stack; typedef struct _StackClass StackClass; -typedef enum -{ - SLOT_TOP = 0, - SLOT_BOTTOM -} Slot; - /* instance structure */ struct _Stack { @@ -70,7 +61,6 @@ Observer* observer; GList* list; guint next_id; - Bubble* slots[2]; // NULL: vacant, non-NULL: occupied }; /* class structure */ @@ -124,26 +114,6 @@ gchar** out_version, gchar** out_spec_ver); -gboolean -stack_is_slot_vacant (Stack* self, - Slot slot); - -void -stack_get_slot_position (Stack* self, - Slot slot, - gint bubble_height, - gint* x, - gint* y); - -gboolean -stack_allocate_slot (Stack* self, - Bubble* bubble, - Slot slot); - -gboolean -stack_free_slot (Stack* self, - Bubble* bubble); - G_END_DECLS #endif /* __STACK_H */ --- notify-osd-0.9.21.orig/src/defaults.c +++ notify-osd-0.9.21/src/defaults.c @@ -864,9 +864,6 @@ _handle_error (self, error); return; } - - // use fixed slot-allocation for async. and sync. bubbles - self->slot_allocation = SLOT_ALLOCATION_FIXED; } static void @@ -2611,12 +2608,3 @@ return gravity; } - -SlotAllocation -defaults_get_slot_allocation (Defaults *self) -{ - if (!self || !IS_DEFAULTS (self)) - return SLOT_ALLOCATION_NONE; - - return self->slot_allocation; -} --- notify-osd-0.9.21.orig/m4/python.m4 +++ notify-osd-0.9.21/m4/python.m4 @@ -0,0 +1,62 @@ +## this one is commonly used with AM_PATH_PYTHONDIR ... +dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]]) +dnl Check if a module containing a given symbol is visible to python. +AC_DEFUN([AM_CHECK_PYMOD], +[AC_REQUIRE([AM_PATH_PYTHON]) +py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` +AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1) +AC_CACHE_VAL(py_cv_mod_$py_mod_var, [ +ifelse([$2],[], [prog=" +import sys +try: + import $1 +except ImportError: + sys.exit(1) +except: + sys.exit(0) +sys.exit(0)"], [prog=" +import $1 +$1.$2"]) +if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC + then + eval "py_cv_mod_$py_mod_var=yes" + else + eval "py_cv_mod_$py_mod_var=no" + fi +]) +py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"` +if test "x$py_val" != xno; then + AC_MSG_RESULT(yes) + ifelse([$3], [],, [$3 +])dnl +else + AC_MSG_RESULT(no) + ifelse([$4], [],, [$4 +])dnl +fi +]) + +dnl a macro to check for ability to create python extensions +dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) +dnl function also defines PYTHON_INCLUDES +AC_DEFUN([AM_CHECK_PYTHON_HEADERS], +[AC_REQUIRE([AM_PATH_PYTHON]) +AC_MSG_CHECKING(for headers required to compile python extensions) +dnl deduce PYTHON_INCLUDES +py_prefix=`$PYTHON -c "import sys; print sys.prefix"` +py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` +PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" +if test "$py_prefix" != "$py_exec_prefix"; then + PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" +fi +AC_SUBST(PYTHON_INCLUDES) +dnl check if the headers exist: +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" +AC_TRY_CPP([#include <Python.h>],dnl +[AC_MSG_RESULT(found) +$1],dnl +[AC_MSG_RESULT(not found) +$2]) +CPPFLAGS="$save_CPPFLAGS" +])