[mate-desktop] rename patch
Wolfgang Ulbrich
raveit65 at fedoraproject.org
Mon Feb 10 22:33:54 UTC 2014
commit aa58100ecbd9d9d17b532b6ce83b83c2a98e41e7
Author: raveit65 <chat-to-me at raveit.de>
Date: Mon Feb 10 23:34:19 2014 +0100
rename patch
mate-desktop_enable_gnucat-f21.patch | 77 ++++++++++++++++++++++++++++++++++
1 files changed, 77 insertions(+), 0 deletions(-)
---
diff --git a/mate-desktop_enable_gnucat-f21.patch b/mate-desktop_enable_gnucat-f21.patch
new file mode 100644
index 0000000..c0c1e98
--- /dev/null
+++ b/mate-desktop_enable_gnucat-f21.patch
@@ -0,0 +1,77 @@
+diff -upr mate-desktop-1.7.1.orig/mate-about/Makefile.am mate-desktop-1.7.1/mate-about/Makefile.am
+--- mate-desktop-1.7.1.orig/mate-about/Makefile.am 2013-10-06 13:27:15.000000000 +0200
++++ mate-desktop-1.7.1/mate-about/Makefile.am 2014-01-08 21:28:34.949901447 +0100
+@@ -11,6 +11,9 @@ AM_CPPFLAGS = \
+
+ @INTLTOOL_DESKTOP_RULE@
+
++pixmapdir = $(datadir)/pixmaps
++pixmap_DATA = gnu-cat_navideno_v3.png gnu-cat.gif
++
+ desktopdir = $(datadir)/applications
+ desktop_in_files = mate-about.desktop.in
+ desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+diff -upr mate-desktop-1.7.1.orig/mate-about/mate-about.c mate-desktop-1.7.1/mate-about/mate-about.c
+--- mate-desktop-1.7.1.orig/mate-about/mate-about.c 2013-10-06 13:27:15.000000000 +0200
++++ mate-desktop-1.7.1/mate-about/mate-about.c 2014-01-08 21:24:58.828796541 +0100
+@@ -68,6 +68,24 @@
+
+ #endif
+
++// Thanks! http://www.gtkforums.com/viewtopic.php?t=1639
++typedef struct _iter_arg {
++ GtkWidget* widget;
++ GdkPixbufAnimation* animation;
++ GdkPixbufAnimationIter* iter;
++} iter_arg_t;
++gboolean on_animation_frame(iter_arg_t* object)
++{
++ if (object->widget == NULL)
++ return FALSE;
++
++ if (gdk_pixbuf_animation_iter_advance(object->iter, NULL)) {
++ gtk_about_dialog_set_logo((GtkAboutDialog*) object->widget,
++ gdk_pixbuf_animation_iter_get_pixbuf(object->iter));
++ }
++ return TRUE;
++}
++
+ void mate_about_run(void)
+ {
+ mate_about_dialog = (GtkAboutDialog*) gtk_about_dialog_new();
+@@ -85,6 +103,35 @@
+ gtk_about_dialog_set_logo_icon_name(mate_about_dialog, desktop_icon);
+ }
+
++ /* check if it's christmas, to show a different image */
++ gboolean is_christmas = FALSE;
++ GDate* d = g_date_new();
++ g_date_set_time_t(d, (time_t) time(NULL));
++ if (g_date_get_month(d) == G_DATE_DECEMBER) {
++ GDateDay day = g_date_get_day(d);
++ if (day >= 24 && day <=25) {
++ is_christmas = TRUE;
++ }
++ }
++ g_date_free(d);
++ if (is_christmas == TRUE) {
++ GdkPixbuf *p = gdk_pixbuf_new_from_file(PIXMAPS_DIR "gnu-cat_navideno_v3.png", NULL);
++ gtk_about_dialog_set_logo(mate_about_dialog, p);
++ g_object_unref(p);
++ } else {
++ GdkPixbufAnimation *animation = gdk_pixbuf_animation_new_from_file(PIXMAPS_DIR "gnu-cat.gif", NULL);
++ if (animation != NULL) {
++ GdkPixbufAnimationIter *iter = gdk_pixbuf_animation_get_iter(animation, NULL);
++ iter_arg_t obj;
++ obj.animation = animation;
++ obj.iter = iter;
++ obj.widget = (GtkWidget*) mate_about_dialog;
++ gtk_about_dialog_set_logo(mate_about_dialog, gdk_pixbuf_animation_iter_get_pixbuf(iter));
++ g_timeout_add(gdk_pixbuf_animation_iter_get_delay_time(iter),
++ (GSourceFunc) on_animation_frame, (gpointer) &obj);
++ }
++ }
++
+ // name
+ #if GTK_CHECK_VERSION(3, 0, 0) || GTK_CHECK_VERSION(2, 12, 0)
+ gtk_about_dialog_set_program_name(mate_about_dialog, gettext(program_name));
More information about the scm-commits
mailing list