summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2007-12-19 21:38:15 +0000
committerHavoc Pennington <hp@src.gnome.org>2007-12-19 21:38:15 +0000
commitb718f79c47022929cc401cfd35576e4bd71815ca (patch)
tree67bfdc1e5616bf10432c0307695a1fbdfac7ee53 /src
parent72b08c82b16a850fd4f0cd52d58812b4180fe969 (diff)
downloadmetacity-b718f79c47022929cc401cfd35576e4bd71815ca.tar.gz
metacity-b718f79c47022929cc401cfd35576e4bd71815ca.tar.bz2
fix a third warning about %d and long int
2007-12-19 Havoc Pennington <hp@redhat.com> * 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 svn path=/trunk/; revision=3492
Diffstat (limited to 'src')
-rw-r--r--src/core/compositor.c2
-rw-r--r--src/core/delete.c2
-rw-r--r--src/core/display.c2
-rw-r--r--src/core/iconcache.c27
-rw-r--r--src/include/ui.h3
-rw-r--r--src/ui/ui.c14
6 files changed, 32 insertions, 18 deletions
diff --git a/src/core/compositor.c b/src/core/compositor.c
index 1ced8bc..964d637 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 9d5c8e4..01bfd02 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 b0df982..6cc5465 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 88eca53..6f8d01a 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;
+
+ meta_ui_get_fallback_icons(&fallback_icon, &fallback_mini_icon);
- if (theme->fallback_icon == NULL || theme->fallback_mini_icon == NULL)
+ 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 a4d7fea..08dd42f 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 597d945..9cf9c27 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;
+}