diff options
Diffstat (limited to 'media-radio/xlog/files/xlog-1.9-map.patch')
-rw-r--r-- | media-radio/xlog/files/xlog-1.9-map.patch | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/media-radio/xlog/files/xlog-1.9-map.patch b/media-radio/xlog/files/xlog-1.9-map.patch new file mode 100644 index 000000000..5505d78cc --- /dev/null +++ b/media-radio/xlog/files/xlog-1.9-map.patch @@ -0,0 +1,91 @@ +# fix for incorrect handling of country maps +--- src/gui_countrymap.c.orig 2009-01-14 08:32:47.000000000 +0100 ++++ src/gui_countrymap.c 2009-01-14 08:29:54.000000000 +0100 +@@ -29,13 +29,15 @@ + + GtkWidget *countrymap = NULL; + static GdkPixmap *pm = NULL; +- +-extern gchar *prefixformaps; ++static gchar *pxformaps = NULL; ++static gint savew = -1, saveh = -1; + + static gboolean + map_delete (GtkWidget * widget, GdkEvent *event, gpointer user_data) + { + countrymap = NULL; ++ g_free (pxformaps); ++ pxformaps = NULL; + return FALSE; + } + +@@ -60,14 +62,14 @@ + pm = gdk_pixmap_new(da->window, da->allocation.width, da->allocation.height, -1); + gdk_draw_rectangle(pm, da->style->white_gc, TRUE, 0, 0, + da->allocation.width, da->allocation.height); +- if (prefixformaps) ++ if (pxformaps) + { + #ifdef G_OS_WIN32 + gchar *map_location = g_strconcat +- ("maps", G_DIR_SEPARATOR_S, prefixformaps, ".png", NULL); ++ ("maps", G_DIR_SEPARATOR_S, pxformaps, ".png", NULL); + #else + gchar *map_location = g_strconcat (XLOG_DATADIR, G_DIR_SEPARATOR_S, +- "maps", G_DIR_SEPARATOR_S, prefixformaps, ".png", NULL); ++ "maps", G_DIR_SEPARATOR_S, pxformaps, ".png", NULL); + #endif + GdkPixbuf *background = gdk_pixbuf_new_from_file (map_location, NULL); + g_free (map_location); +@@ -92,6 +94,8 @@ + + void countrymap_refresh (gchar *px) + { ++ if (!g_ascii_strcasecmp(px, pxformaps)) return; ++ pxformaps = g_strdup (px); + #ifdef G_OS_WIN32 + gchar *map_location = g_strconcat + ("maps", G_DIR_SEPARATOR_S, px, ".png", NULL); +@@ -101,7 +105,20 @@ + #endif + gint width, height; + GdkPixbufFormat *f = gdk_pixbuf_get_file_info (map_location, &width, &height); +- if (f) gdk_window_resize (countrymap->window, width, height); ++ if (f) ++ { ++ if (width != savew || height != saveh) ++ { ++ gdk_window_resize (countrymap->window, width, height); ++ savew = width; ++ saveh = height; ++ } ++ else ++ { ++ GtkWidget *da = lookup_widget (countrymap, "da"); ++ map_configure (da, NULL, NULL); ++ } ++ } + g_free (map_location); + } + +@@ -128,18 +145,7 @@ + gtk_container_add (GTK_CONTAINER(countrymap), da); + g_signal_connect (da, "expose_event", G_CALLBACK (map_expose), NULL); + g_signal_connect (da, "configure_event", G_CALLBACK (map_configure), NULL); +- ++ GLADE_HOOKUP_OBJECT (countrymap, da, "da"); ++ pxformaps = g_strdup (""); + gtk_widget_show_all (countrymap); +- +-#ifdef G_OS_WIN32 +- gchar *map_location = g_strconcat +- ("maps", G_DIR_SEPARATOR_S, prefixformaps, ".png", NULL); +-#else +- gchar *map_location = g_strconcat (XLOG_DATADIR, G_DIR_SEPARATOR_S, +- "maps", G_DIR_SEPARATOR_S, prefixformaps, ".png", NULL); +-#endif +- gint width, height; +- GdkPixbufFormat *f = gdk_pixbuf_get_file_info (map_location, &width, &height); +- if (f) gdk_window_resize (countrymap->window, width, height); +- g_free (map_location); + } |