diff options
author | Mike Engber <engber@src.gnome.org> | 2001-01-23 01:13:14 +0000 |
---|---|---|
committer | Mike Engber <engber@src.gnome.org> | 2001-01-23 01:13:14 +0000 |
commit | 0084f858f540652716c142caadeb116d21405e27 (patch) | |
tree | cc863c36e6baa509f1df873454d0dfdf8ad2154e | |
parent | 5baf833f59333ddb3487599735fa61b2d6fcb7ba (diff) | |
download | nautilus-0084f858f540652716c142caadeb116d21405e27.tar.gz |
reviewed by: Ramiro Estrugo
reviewed by: Ramiro Estrugo
* libnautilus-extensions/nautilus-directory-background.c:
(desktop_background_realized),
(nautilus_connect_desktop_background_to_file_metadata),
(image_loading_done_callback),
(nautilus_connect_background_to_file_metadata):
Desktop backgrounds were being drawn before they were initialized.
Bugs 5853 & 5896.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-directory-background.c | 42 | ||||
-rw-r--r-- | libnautilus-private/nautilus-directory-background.c | 42 |
3 files changed, 54 insertions, 42 deletions
@@ -1,3 +1,15 @@ +2001-01-22 Michael Engber <engber@eazel.com> + + reviewed by: Ramiro Estrugo + + * libnautilus-extensions/nautilus-directory-background.c: + (desktop_background_realized), + (nautilus_connect_desktop_background_to_file_metadata), + (image_loading_done_callback), + (nautilus_connect_background_to_file_metadata): + Desktop backgrounds were being drawn before they were initialized. + Bugs 5853 & 5896. + 2001-01-22 Rebecca Schulman <rebecka@eazel.com> Fix bug 5316, that search results code has empty strings marked for translation. diff --git a/libnautilus-extensions/nautilus-directory-background.c b/libnautilus-extensions/nautilus-directory-background.c index c8d5f673c..3ba12aa05 100644 --- a/libnautilus-extensions/nautilus-directory-background.c +++ b/libnautilus-extensions/nautilus-directory-background.c @@ -87,7 +87,8 @@ static const char *default_theme_source = "directory"; static const char *desktop_theme_source = "desktop"; void -static nautilus_background_set_desktop (NautilusIconContainer *icon_container) +nautilus_connect_desktop_background_to_file_metadata (NautilusIconContainer *icon_container, + NautilusFile *file) { NautilusBackground *background; @@ -95,11 +96,20 @@ static nautilus_background_set_desktop (NautilusIconContainer *icon_container) gtk_object_set_data (GTK_OBJECT (background), "theme_source", (gpointer) desktop_theme_source); + /* Strictly speaking, we don't need to know about metadata changes, since + * the desktop setting aren't stored there. But, hooking up to metadata + * changes is actually a small part of what this fn does, and we do need + * the other stuff (hooked up to background & theme changes, initialize + * the background). Being notified of metadata changes on the file is a + * waste, but won't hurt, so I don't think it's worth refactoring the fn + * at this point. + */ + nautilus_connect_background_to_file_metadata (GTK_WIDGET (icon_container), file); - if (GTK_LAYOUT (icon_container)->bin_window == NULL) { - gtk_signal_connect (GTK_OBJECT (icon_container), "realize", GTK_SIGNAL_FUNC (desktop_background_realized), GINT_TO_POINTER (TRUE)); - } else { + if (GTK_WIDGET_REALIZED (icon_container)) { desktop_background_realized (icon_container, GINT_TO_POINTER (FALSE)); + } else { + gtk_signal_connect (GTK_OBJECT (icon_container), "realize", GTK_SIGNAL_FUNC (desktop_background_realized), GINT_TO_POINTER (TRUE)); } nautilus_file_background_receive_root_window_changes (background); @@ -679,6 +689,13 @@ image_loading_done_callback (NautilusBackground *background, gboolean successful gdk_window_set_back_pixmap (nautilus_background_get_desktop_background_window (background), pixmap, FALSE); + /* We'd like to simply unref pixmap here, but due to a bug in gdk's handling of + * foreign pixmaps, we can't - it would free the X resource. + * + * gdk_window_set_back_pixmap does not need the gdk pixmap object to stick around. + * It simply uses X resource inside it. dispose_root_pixmap free's the gdk object + * and not the X resource. + */ dispose_root_pixmap (pixmap); } @@ -1010,23 +1027,6 @@ nautilus_connect_background_to_file_metadata (GtkWidget *widget, } void -nautilus_connect_desktop_background_to_file_metadata (NautilusIconContainer *icon_container, - NautilusFile *file) -{ - nautilus_background_set_desktop (icon_container); - - - /* Strictly speaking, we don't need to know about metadata changes, since - * the desktop setting aren't stored there. But, hooking up to metadata - * changes is actually a small part of what this fn does, and we do need - * the other stuff (hooked up to background & theme changes). Being notified - * of metadata changes on the file is a waste, but won't hurt, so I don't - * think it's worth refactoring the fn at this point. - */ - nautilus_connect_background_to_file_metadata (GTK_WIDGET (icon_container), file); -} - -void nautilus_connect_background_to_file_metadata_by_uri (GtkWidget *widget, const char *uri) { diff --git a/libnautilus-private/nautilus-directory-background.c b/libnautilus-private/nautilus-directory-background.c index c8d5f673c..3ba12aa05 100644 --- a/libnautilus-private/nautilus-directory-background.c +++ b/libnautilus-private/nautilus-directory-background.c @@ -87,7 +87,8 @@ static const char *default_theme_source = "directory"; static const char *desktop_theme_source = "desktop"; void -static nautilus_background_set_desktop (NautilusIconContainer *icon_container) +nautilus_connect_desktop_background_to_file_metadata (NautilusIconContainer *icon_container, + NautilusFile *file) { NautilusBackground *background; @@ -95,11 +96,20 @@ static nautilus_background_set_desktop (NautilusIconContainer *icon_container) gtk_object_set_data (GTK_OBJECT (background), "theme_source", (gpointer) desktop_theme_source); + /* Strictly speaking, we don't need to know about metadata changes, since + * the desktop setting aren't stored there. But, hooking up to metadata + * changes is actually a small part of what this fn does, and we do need + * the other stuff (hooked up to background & theme changes, initialize + * the background). Being notified of metadata changes on the file is a + * waste, but won't hurt, so I don't think it's worth refactoring the fn + * at this point. + */ + nautilus_connect_background_to_file_metadata (GTK_WIDGET (icon_container), file); - if (GTK_LAYOUT (icon_container)->bin_window == NULL) { - gtk_signal_connect (GTK_OBJECT (icon_container), "realize", GTK_SIGNAL_FUNC (desktop_background_realized), GINT_TO_POINTER (TRUE)); - } else { + if (GTK_WIDGET_REALIZED (icon_container)) { desktop_background_realized (icon_container, GINT_TO_POINTER (FALSE)); + } else { + gtk_signal_connect (GTK_OBJECT (icon_container), "realize", GTK_SIGNAL_FUNC (desktop_background_realized), GINT_TO_POINTER (TRUE)); } nautilus_file_background_receive_root_window_changes (background); @@ -679,6 +689,13 @@ image_loading_done_callback (NautilusBackground *background, gboolean successful gdk_window_set_back_pixmap (nautilus_background_get_desktop_background_window (background), pixmap, FALSE); + /* We'd like to simply unref pixmap here, but due to a bug in gdk's handling of + * foreign pixmaps, we can't - it would free the X resource. + * + * gdk_window_set_back_pixmap does not need the gdk pixmap object to stick around. + * It simply uses X resource inside it. dispose_root_pixmap free's the gdk object + * and not the X resource. + */ dispose_root_pixmap (pixmap); } @@ -1010,23 +1027,6 @@ nautilus_connect_background_to_file_metadata (GtkWidget *widget, } void -nautilus_connect_desktop_background_to_file_metadata (NautilusIconContainer *icon_container, - NautilusFile *file) -{ - nautilus_background_set_desktop (icon_container); - - - /* Strictly speaking, we don't need to know about metadata changes, since - * the desktop setting aren't stored there. But, hooking up to metadata - * changes is actually a small part of what this fn does, and we do need - * the other stuff (hooked up to background & theme changes). Being notified - * of metadata changes on the file is a waste, but won't hurt, so I don't - * think it's worth refactoring the fn at this point. - */ - nautilus_connect_background_to_file_metadata (GTK_WIDGET (icon_container), file); -} - -void nautilus_connect_background_to_file_metadata_by_uri (GtkWidget *widget, const char *uri) { |