rpms/eel2/devel eel-2.23.92-fade.patch, NONE, 1.1 eel2.spec, 1.95, 1.96
Ray Strode
rstrode at fedoraproject.org
Fri Sep 19 03:34:54 UTC 2008
Author: rstrode
Update of /cvs/pkgs/rpms/eel2/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv1639
Modified Files:
eel2.spec
Added Files:
eel-2.23.92-fade.patch
Log Message:
- When switching desktop backgrounds fade between them
eel-2.23.92-fade.patch:
--- NEW FILE eel-2.23.92-fade.patch ---
--- a/eel/eel-background.c
+++ b/eel/eel-background.c
@@ -43,6 +43,7 @@
#include <stdio.h>
#define GNOME_DESKTOP_USE_UNSTABLE_API
#include <libgnomeui/gnome-bg.h>
+#include <gdk/gdkx.h>
static void eel_background_class_init (gpointer klass);
static void eel_background_init (gpointer object,
@@ -78,6 +79,7 @@ struct EelBackgroundDetails {
/* Realized data: */
gboolean background_changes_with_size;
GdkPixmap *background_pixmap;
+ GnomeBGCrossfade *fade;
int background_entire_width;
int background_entire_height;
GdkColor default_color;
@@ -182,6 +184,11 @@ eel_background_finalize (GObject *object)
background = EEL_BACKGROUND (object);
g_free (background->details->color);
+ if (background->details->fade != NULL) {
+ gnome_bg_crossfade_stop (background->details->fade);
+ g_object_unref (background->details->fade);
+ background->details->fade = NULL;
+ }
eel_background_remove_current_image (background);
if (background->details->background_pixmap != NULL) {
@@ -610,6 +619,25 @@ eel_background_reset (EelBackground *background)
g_signal_emit (GTK_OBJECT (background), signals[RESET], 0);
}
+static gboolean
+fade_to_pixmap (EelBackground *background,
+ GdkWindow *window,
+ GdkPixmap *pixmap)
+{
+ if (background->details->fade == NULL) {
+ return FALSE;
+ }
+
+ if (!gnome_bg_crossfade_set_end_pixmap (background->details->fade,
+ pixmap)) {
+ return FALSE;
+ }
+
+ gnome_bg_crossfade_start (background->details->fade, window, NULL);
+
+ return gnome_bg_crossfade_is_started (background->details->fade);
+}
+
static void
eel_background_set_up_widget (EelBackground *background, GtkWidget *widget)
{
@@ -644,14 +672,15 @@ eel_background_set_up_widget (EelBackground *background, GtkWidget *widget)
} else {
window = widget->window;
}
-
- if (!changes_with_size || background->details->is_desktop) {
- gdk_window_set_back_pixmap (window, pixmap, FALSE);
- } else {
- gdk_window_set_back_pixmap (window, NULL, FALSE);
- gdk_window_set_background (window, &color);
+ if (background->details->fade == NULL ||
+ !fade_to_pixmap (background, window, pixmap)) {
+ if (!changes_with_size || background->details->is_desktop) {
+ gdk_window_set_back_pixmap (window, pixmap, FALSE);
+ } else {
+ gdk_window_set_back_pixmap (window, NULL, FALSE);
+ gdk_window_set_background (window, &color);
+ }
}
-
background->details->background_changes_with_size =
gnome_bg_changes_with_size (background->details->bg);
@@ -679,6 +708,18 @@ eel_background_set_up_widget (EelBackground *background, GtkWidget *widget)
static void
eel_widget_background_changed (GtkWidget *widget, EelBackground *background)
{
+ if (GTK_WIDGET_REALIZED (widget)) {
+ int width, height;
+
+ if (background->details->fade != NULL) {
+ gnome_bg_crossfade_stop (background->details->fade);
+ g_object_unref (background->details->fade);
+ }
+ gdk_drawable_get_size (widget->window, &width, &height);
+ background->details->fade = gnome_bg_crossfade_new (width, height);
+ gnome_bg_crossfade_set_start_pixmap (background->details->fade, background->details->background_pixmap);
+ }
+
eel_background_unrealize (background);
eel_background_set_up_widget (background, widget);
@@ -741,11 +782,22 @@ static void
widget_realize_cb (GtkWidget *widget, gpointer data)
{
EelBackground *background;
+ int width, height;
background = EEL_BACKGROUND (data);
widget_realized_setup (widget, data);
-
+
+ if (background->details->fade != NULL) {
+ gnome_bg_crossfade_stop (background->details->fade);
+ g_object_unref (background->details->fade);
+ }
+
+ gdk_drawable_get_size (widget->window, &width, &height);
+ background->details->fade = gnome_bg_crossfade_new (width, height);
+
+ gnome_bg_crossfade_set_start_pixmap (background->details->fade, NULL);
+
eel_background_set_up_widget (background, widget);
}
Index: eel2.spec
===================================================================
RCS file: /cvs/pkgs/rpms/eel2/devel/eel2.spec,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -r1.95 -r1.96
--- eel2.spec 8 Sep 2008 23:32:06 -0000 1.95
+++ eel2.spec 19 Sep 2008 03:34:24 -0000 1.96
@@ -17,7 +17,7 @@
Name: eel2
Summary: Eazel Extensions Library
Version: 2.23.92
-Release: 1%{?dist}
+Release: 2%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
Source: http://download.gnome.org/sources/eel/2.23/eel-%{version}.tar.bz2
@@ -45,6 +45,8 @@
BuildRequires: gettext
BuildRequires: perl(XML::Parser)
+Patch0: eel-2.23.92-fade.patch
+
%description
Eazel Extensions Library is a collection of widgets and functions for
use with GNOME.
@@ -71,6 +73,8 @@
%prep
%setup -q -n eel-%{version}
+%patch0 -p1 -b .fade
+
# Fix spurious exec permissions
chmod a-x COPYING
@@ -108,6 +112,9 @@
%{_includedir}/eel-2
%changelog
+* Thu Sep 18 2008 Ray Strode <rstrode at redhat.com> - 2.23.92-2
+- When switching desktop backgrounds fade between them
+
* Mon Sep 8 2008 Matthias Clasen <mclasen at redhat.com> - 2.23.92-1
- Update to 2.23.92
More information about the fedora-extras-commits
mailing list