--- rxvt-unicode/src/init.C 2011/08/15 11:01:54 1.297 +++ rxvt-unicode/src/init.C 2011/11/13 16:03:31 1.301 @@ -57,6 +57,11 @@ # include #endif +#ifdef HAVE_STARTUP_NOTIFICATION +# define SN_API_NOT_YET_FROZEN +# include +#endif + #ifdef DISPLAY_IS_IP /* On Solaris link with -lsocket and -lnsl */ #include @@ -786,10 +791,20 @@ } if (option (Opt_scrollBar)) - scrollBar.state = STATE_IDLE; /* set existence for size calculations */ + scrollBar.state = SB_STATE_IDLE; /* set existence for size calculations */ pty = ptytty::create (); +#ifdef HAVE_AFTERIMAGE + set_application_name ((char *)rs[Rs_name]); + set_output_threshold (OUTPUT_LEVEL_WARNING); +#endif + + // must be called before create_windows, because the latter may call set_icon +#ifdef HAVE_PIXBUF + g_type_init (); +#endif + create_windows (argc, argv); init_xlocale (); @@ -829,16 +844,6 @@ #ifdef BG_IMAGE_FROM_FILE if (rs[Rs_backgroundPixmap]) { - const char *p = rs[Rs_backgroundPixmap]; - - if ((p = strchr (p, ';')) != 0) - { - p++; - bg_set_geometry (p); - } - else - bg_set_default_geometry (); - if (bg_set_file (rs[Rs_backgroundPixmap])) if (!bg_window_position_sensitive ()) update_background (); @@ -872,9 +877,33 @@ } #endif +#if HAVE_STARTUP_NOTIFICATION + SnDisplay *snDisplay; + SnLauncheeContext *snContext; + + snDisplay = sn_display_new (dpy, NULL, NULL); + snContext = sn_launchee_context_new_from_environment (snDisplay, DefaultScreen (dpy)); + + /* Tell the window manager that this window is part of the startup context */ + if (snContext) + sn_launchee_context_setup_window (snContext, parent); +#endif + XMapWindow (dpy, vt); XMapWindow (dpy, parent); +#if HAVE_STARTUP_NOTIFICATION + if (snContext) + { + /* Mark the startup process as complete */ + sn_launchee_context_complete (snContext); + + sn_launchee_context_unref (snContext); + } + + sn_display_unref (snDisplay); +#endif + refresh_check (); }