diff --git a/ChangeLog b/ChangeLog index 27bb4826f..5b4aed2a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2007-12-19 Havoc Pennington + + * src/core/display.c (meta_display_open): fix a third warning + about %d and long int + + * src/core/delete.c (io_from_ping_dialog): fix another warning + about long int to %d + + * src/core/compositor.c (meta_compositor_new): fix a warning about + long int to %d + + * src/core/iconcache.c (meta_read_icons): use + meta_ui_get_fallback_icons() instead of incorrectly including theme.h + + * src/ui/ui.c (meta_ui_get_fallback_icons): new function + 2007-12-19 Havoc Pennington * src/ui, src/core, src/include: sort source files into these diff --git a/src/core/compositor.c b/src/core/compositor.c index 1ced8bcac..964d637a1 100644 --- a/src/core/compositor.c +++ b/src/core/compositor.c @@ -2216,7 +2216,7 @@ meta_compositor_new (MetaDisplay *display) compositor = g_new (MetaCompositor, 1); compositor->display = display; - meta_verbose ("Creating %d atoms\n", G_N_ELEMENTS (atom_names)); + meta_verbose ("Creating %d atoms\n", (int) G_N_ELEMENTS (atom_names)); XInternAtoms (display->xdisplay, atom_names, G_N_ELEMENTS (atom_names), False, atoms); compositor->atom_x_root_pixmap = atoms[0]; diff --git a/src/core/delete.c b/src/core/delete.c index 9d5c8e42b..01bfd0215 100644 --- a/src/core/delete.c +++ b/src/core/delete.c @@ -271,7 +271,7 @@ io_from_ping_dialog (GIOChannel *channel, meta_topic (META_DEBUG_PING, "Read %d bytes strlen %d \"%s\" from child\n", - len, str ? strlen (str) : 0, str ? str : "NULL"); + len, str ? (int) strlen (str) : 0, str ? str : "NULL"); if (len > 0) { diff --git a/src/core/display.c b/src/core/display.c index b0df98231..6cc546539 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -418,7 +418,7 @@ meta_display_open (void) meta_prefs_add_listener (prefs_changed_callback, display); - meta_verbose ("Creating %d atoms\n", G_N_ELEMENTS (atom_names)); + meta_verbose ("Creating %d atoms\n", (int) G_N_ELEMENTS (atom_names)); XInternAtoms (display->xdisplay, atom_names, G_N_ELEMENTS (atom_names), False, atoms); display->atom_net_wm_name = atoms[0]; diff --git a/src/core/iconcache.c b/src/core/iconcache.c index 88eca535c..6f8d01ab4 100644 --- a/src/core/iconcache.c +++ b/src/core/iconcache.c @@ -817,11 +817,15 @@ meta_read_icons (MetaScreen *screen, if (icon_cache->want_fallback && icon_cache->origin < USING_FALLBACK_ICON) { -#if 0 - /* FIXME this code requires GTK and thus does not belong here in core/ */ - MetaTheme *theme = meta_theme_get_current (); + GdkPixbuf *fallback_icon; + GdkPixbuf *fallback_mini_icon; + + fallback_icon = NULL; + fallback_mini_icon = NULL; - if (theme->fallback_icon == NULL || theme->fallback_mini_icon == NULL) + meta_ui_get_fallback_icons(&fallback_icon, &fallback_mini_icon); + + if (fallback_icon == NULL || fallback_mini_icon == NULL) { get_fallback_icons (screen, iconp, @@ -832,18 +836,15 @@ meta_read_icons (MetaScreen *screen, ideal_mini_height); } - if (theme->fallback_icon != NULL) - *iconp = theme->fallback_icon; - if (theme->fallback_mini_icon != NULL) - *mini_iconp = theme->fallback_mini_icon; - + if (fallback_icon != NULL) + *iconp = fallback_icon; + if (fallback_mini_icon != NULL) + *mini_iconp = fallback_mini_icon; + replace_cache (icon_cache, USING_FALLBACK_ICON, *iconp, *mini_iconp); - + return TRUE; -#else - return FALSE; -#endif } if (!icon_cache->want_fallback && diff --git a/src/include/ui.h b/src/include/ui.h index a4d7fea7d..08dd42f2d 100644 --- a/src/include/ui.h +++ b/src/include/ui.h @@ -204,6 +204,9 @@ MetaUIDirection meta_ui_get_direction (void); GdkPixbuf *meta_ui_get_pixbuf_from_pixmap (Pixmap pmap); +void meta_ui_get_fallback_icons (GdkPixbuf **fallback_icon_p, + GdkPixbuf **fallback_mini_icon_p); + #include "tabpopup.h" #endif diff --git a/src/ui/ui.c b/src/ui/ui.c index 597d9459e..9cf9c2763 100644 --- a/src/ui/ui.c +++ b/src/ui/ui.c @@ -988,6 +988,16 @@ meta_ui_get_pixbuf_from_pixmap (Pixmap pmap) return pixbuf; } + +void +meta_ui_get_fallback_icons (GdkPixbuf **fallback_icon_p, + GdkPixbuf **fallback_mini_icon_p) +{ + MetaTheme *theme = meta_theme_get_current (); - - + if (fallback_icon_p) + *fallback_icon_p = theme->fallback_icon; + + if (fallback_mini_icon_p) + *fallback_mini_icon_p = theme->fallback_mini_icon; +}