Package: xpad
Version: 4.0-1
Severity: wishlist
Tags: patch
This patch adds the following functionality when clicking on the systray
icon:
- If there are no pads to show, a new pad will be created.
- If all pads are currently shown, they will all be hidden. This is
consistent with most systray applications, where clicking on the
systray icon will show/hide the application.
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.26.8 (SMP w/1 CPU core)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages xpad depends on:
ii libatk1.0-0 1.26.0-1 The ATK accessibility toolkit
ii libc6 2.9-18 GNU C Library: Shared libraries
ii libcairo2 1.8.8-2 The Cairo 2D vector graphics libra
ii libfontconfig1 2.6.0-4 generic font configuration library
ii libfreetype6 2.3.9-5 FreeType 2 font engine, shared lib
ii libglib2.0-0 2.20.4-1 The GLib library of C routines
ii libgtk2.0-0 2.16.4-1 The GTK+ graphical user interface
ii libice6 2:1.0.5-1 X11 Inter-Client Exchange library
ii libpango1.0-0 1.24.3-1 Layout and rendering of internatio
ii libsm6 2:1.1.0-2 X11 Session Management library
xpad recommends no packages.
xpad suggests no packages.
-- no debconf information
commit 01407f7c987f4893e28a476210cc82f7252b69b9
Author: Frédéric Brière <[email protected]>
Date: Mon Jul 6 12:17:22 2009 -0400
Have the systray create/hide pads when appropriate
This adds the following functionality when clicking on the systray icon:
- If there are no pads to show, a new pad will be created.
- If all pads are currently shown, they will all be hidden. This is
consistent with most systray applications, where clicking on the
systray icon will show/hide the application.
diff --git a/src/xpad-tray.c b/src/xpad-tray.c
index f47d099..6ab3b43 100644
--- a/src/xpad-tray.c
+++ b/src/xpad-tray.c
@@ -191,8 +191,16 @@ xpad_tray_popup_menu_cb (GtkStatusIcon *icon, guint
button, guint time)
static void
xpad_tray_activate_cb (GtkStatusIcon *icon)
{
- GSList *pads = xpad_pad_group_get_pads (xpad_app_get_pad_group ());
- g_slist_foreach (pads, (GFunc) gtk_window_present, NULL);
+ XpadPadGroup *group = xpad_app_get_pad_group ();
+ GSList *pads = xpad_pad_group_get_pads (group);
+
+ if (!pads)
+ menu_spawn (group);
+ else if (xpad_pad_group_num_visible_pads (group) == g_slist_length
(pads))
+ xpad_pad_group_close_all (group);
+ else
+ g_slist_foreach (pads, (GFunc) gtk_window_present, NULL);
+
g_slist_free (pads);
}