Bug#446248: gnome-applets: patch for stickynotes applet

Christian Engwer christi at uni-hd.de
Sat Oct 4 21:12:04 UTC 2008


Package: gnome-applets
Version: 2.22.3-3
Tags: patch
Followup-For: Bug #446248


The issue is still existant. Find a proposed patch attached. With this
patch clicking the applet icon toggles show/hide of the notes.

The patch was written for 2.20, but also copiles with 2.22.

Christian

--- gnome-applets-2.20.1/stickynotes/stickynotes_applet.c	2008-01-07 06:13:10.000000000 +0100
+++ gnome-applets-2.20.1.new/stickynotes/stickynotes_applet.c	2008-04-24 11:03:52.000000000 +0200
@@ -385,8 +385,6 @@
 	/* Connect all signals for applet management */
 	g_signal_connect(G_OBJECT(applet->w_applet), "button-press-event",
 			G_CALLBACK(applet_button_cb), applet);
-	g_signal_connect(G_OBJECT(applet->w_applet), "button-release-event",
-			G_CALLBACK(applet_button_cb), applet);
 	g_signal_connect(G_OBJECT(applet->w_applet), "key-press-event",
 			G_CALLBACK(applet_key_cb), applet);
 	g_signal_connect(G_OBJECT(applet->w_applet), "focus-in-event",
Nur in gnome-applets-2.20.1.new/stickynotes: stickynotes_applet.c~.
diff -u gnome-applets-2.20.1.new/stickynotes/stickynotes_applet_callbacks.c gnome-applets-2.20.1/stickynotes/stickynotes_applet_callbacks.c
--- gnome-applets-2.20.1/stickynotes/stickynotes_applet_callbacks.c	2008-01-07 06:13:10.000000000 +0100
+++ gnome-applets-2.20.1.new/stickynotes/stickynotes_applet_callbacks.c	2008-04-24 11:03:52.000000000 +0200
@@ -61,12 +61,17 @@
 	stickynotes_add (gtk_widget_get_screen (applet->w_applet));
 }
 
+gboolean notes_visible = TRUE;
+
 static void
 stickynote_show_notes (gboolean visible)
 {
 	StickyNote *note;
 	GList *l;
 
+    if (notes_visible == visible) return;
+    notes_visible = visible;
+
 	for (l = stickynotes->notes; l; l = l->next)
 	{
 		note = l->data;
@@ -74,6 +79,12 @@
 	}
 }
 
+static void
+stickynote_toggle_notes_visible ()
+{
+    stickynote_show_notes(!notes_visible);
+}
+
 /* Applet Callback : Mouse button press on the applet. */
 gboolean
 applet_button_cb (GtkWidget         *widget,
@@ -87,7 +98,7 @@
 	}
 	else if (event->button == 1)
 	{
-		stickynote_show_notes (TRUE);
+		stickynote_toggle_notes_visible ();
 		return TRUE;
 	}
 






More information about the pkg-gnome-maintainers mailing list