diff --git a/midori.desktop.in b/midori.desktop.in index a4bf004e..ad78064a 100644 --- a/midori.desktop.in +++ b/midori.desktop.in @@ -1,14 +1,13 @@ - [Desktop Entry] Version=1.0 Encoding=UTF-8 Type=Application -_Name=Midori Web Browser +_Name=Midori _GenericName=Web Browser _Comment=Lightweight web browser Categories=GTK;Network; MimeType=text/html;text/xml;application/xhtml+xml;application/xml; Exec=midori %u -Icon=web-browser +Icon=midori Terminal=false StartupNotify=true diff --git a/src/midori-browser.c b/src/midori-browser.c index eef95662..b3f2c2f6 100644 --- a/src/midori-browser.c +++ b/src/midori-browser.c @@ -2312,7 +2312,7 @@ midori_browser_destroy_cb (MidoriBrowser* browser) // Destroy tabs first, so widgets can still see window elements on destroy gtk_container_foreach (GTK_CONTAINER (priv->notebook), - G_CALLBACK (gtk_widget_destroy), NULL); + (GtkCallback) gtk_widget_destroy, NULL); } static const gchar* ui_markup = @@ -2435,6 +2435,20 @@ static const gchar* ui_markup = "" ""; +static void +midori_browser_realize_cb (GtkStyle* style, MidoriBrowser* browser) +{ + GdkScreen* screen = gtk_widget_get_screen (GTK_WIDGET (browser)); + if (screen) + { + GtkIconTheme* icon_theme = gtk_icon_theme_get_for_screen (screen); + if (gtk_icon_theme_has_icon (icon_theme, "midori")) + gtk_window_set_icon_name (GTK_WINDOW (browser), "midori"); + else + gtk_window_set_icon_name (GTK_WINDOW (browser), "web-browser"); + } +} + static void midori_browser_init (MidoriBrowser* browser) { @@ -2443,13 +2457,14 @@ midori_browser_init (MidoriBrowser* browser) MidoriBrowserPrivate* priv = browser->priv; // Setup the window metrics + g_signal_connect (browser, "realize", + G_CALLBACK (midori_browser_realize_cb), browser); g_signal_connect (browser, "window-state-event", G_CALLBACK (midori_browser_window_state_event_cb), NULL); g_signal_connect (browser, "size-allocate", G_CALLBACK (midori_browser_size_allocate_cb), NULL); g_signal_connect (browser, "destroy", G_CALLBACK (midori_browser_destroy_cb), NULL); - // FIXME: Use custom program icon gtk_window_set_icon_name (GTK_WINDOW (browser), "web-browser"); gtk_window_set_title (GTK_WINDOW (browser), g_get_application_name ()); GtkWidget* vbox = gtk_vbox_new (FALSE, 0); diff --git a/wscript b/wscript index 2b1b66c8..0d1eec38 100644 --- a/wscript +++ b/wscript @@ -2,7 +2,8 @@ # WAF build script for midori import Params -import subprocess +import pproc as subprocess +import Common APPNAME = 'midori' VERSION = '0.0.18' @@ -58,7 +59,7 @@ def configure (conf): conf.define ('SOKOKE_DEBUG_', '-') conf.write_config_header ('config.h') -def set_options(opt): +def set_options (opt): opt.tool_options ('compiler_cc') opt.tool_options ('intltool') @@ -82,3 +83,14 @@ def build (bld): Params.pprint ('BLUE', "File midori.desktop not generated") if bld.env ()['INTLTOOL']: install_files ('DATADIR', 'applications', 'midori.desktop') + +def shutdown (): + dir = Common.path_install('DATADIR', 'icons/hicolor') + if Params.g_commands['install']: + if not Params.g_options.destdir: + # update the pixmap cache directory + Params.pprint('YELLOW', "Updating Gtk icon cache.") + subprocess.call (['gtk-update-icon-cache', '-q', '-f', '-t', dir]) + else: + Params.pprint('YELLOW', "Icon cache not updated. After install, run this:") + Params.pprint('YELLOW', "gtk-update-icon-cache -q -f -t %s" % dir)