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

Christian Engwer christi at uni-hd.de
Mon Oct 6 20:35:41 UTC 2008


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

> Thanks a lot for the patch, but we can’t apply it as is. Could you
> update it to make notes_visible a member of the StickyNotes structure
> instead of a global variable?

I updated the patch. StickyNotes does have a member visible, which is
initialized during construction and used from there on.

Find the patch attached.

Christian
-------------- next part --------------
diff -u --new-file gnome-applets-2.22.3.orig/stickynotes/stickynotes_applet.c gnome-applets-2.22.3/stickynotes/stickynotes_applet.c
--- gnome-applets-2.22.3.orig/stickynotes/stickynotes_applet.c	2008-05-27 11:58:48.000000000 +0200
+++ gnome-applets-2.22.3/stickynotes/stickynotes_applet.c	2008-10-06 22:12:37.000000000 +0200
@@ -153,6 +153,7 @@
 	stickynotes_make_prelight_icon (stickynotes->icon_prelight,
 			stickynotes->icon_normal, 30);
 	stickynotes->gconf = gconf_client_get_default();
+	stickynotes->visible = TRUE;
 
 	stickynotes_applet_init_icons();
 	stickynotes_applet_init_prefs();
@@ -385,8 +386,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",
diff -u --new-file gnome-applets-2.22.3.orig/stickynotes/stickynotes_applet_callbacks.c gnome-applets-2.22.3/stickynotes/stickynotes_applet_callbacks.c
--- gnome-applets-2.22.3.orig/stickynotes/stickynotes_applet_callbacks.c	2008-05-27 11:58:48.000000000 +0200
+++ gnome-applets-2.22.3/stickynotes/stickynotes_applet_callbacks.c	2008-10-06 22:19:01.000000000 +0200
@@ -67,6 +67,9 @@
 	StickyNote *note;
 	GList *l;
 
+    if (stickynotes->visible == visible) return;
+    stickynotes->visible = visible;
+
 	for (l = stickynotes->notes; l; l = l->next)
 	{
 		note = l->data;
@@ -74,6 +77,12 @@
 	}
 }
 
+static void
+stickynote_toggle_notes_visible ()
+{
+    stickynote_show_notes(!stickynotes->visible);
+}
+
 /* Applet Callback : Mouse button press on the applet. */
 gboolean
 applet_button_cb (GtkWidget         *widget,
@@ -87,7 +96,7 @@
 	}
 	else if (event->button == 1)
 	{
-		stickynote_show_notes (TRUE);
+		stickynote_toggle_notes_visible ();
 		return TRUE;
 	}
 
diff -u --new-file gnome-applets-2.22.3.orig/stickynotes/stickynotes_applet.h gnome-applets-2.22.3/stickynotes/stickynotes_applet.h
--- gnome-applets-2.22.3.orig/stickynotes/stickynotes_applet.h	2008-05-27 11:58:48.000000000 +0200
+++ gnome-applets-2.22.3/stickynotes/stickynotes_applet.h	2008-10-06 22:19:26.000000000 +0200
@@ -65,6 +65,8 @@
 	GConfClient *gconf;		/* GConf Client */
 
 	guint last_timeout_data;
+
+    gboolean visible;       /* Toggle show/hide notes */
 } StickyNotes;
 
 /* Sticky Notes Icons */
diff -u --new-file gnome-applets-2.22.3.orig/stickynotes/stickynotes.c gnome-applets-2.22.3/stickynotes/stickynotes.c
--- gnome-applets-2.22.3.orig/stickynotes/stickynotes.c	2008-05-27 11:58:48.000000000 +0200
+++ gnome-applets-2.22.3/stickynotes/stickynotes.c	2008-10-06 22:18:36.000000000 +0200
@@ -1013,7 +1013,7 @@
 	{
 		StickyNote *note = tmp1->data;
 
-		stickynote_set_visible (note, TRUE);
+		stickynote_set_visible (note, stickynotes->visible);
 		tmp1 = tmp1->next;
 	}
 


More information about the pkg-gnome-maintainers mailing list