ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/init.C
(Generate patch)

Comparing rxvt-unicode/src/init.C (file contents):
Revision 1.296 by sf-exg, Mon May 30 18:39:03 2011 UTC vs.
Revision 1.303 by sf-exg, Sat Dec 3 11:47:31 2011 UTC

53# endif 53# endif
54#endif 54#endif
55 55
56#ifdef HAVE_NL_LANGINFO 56#ifdef HAVE_NL_LANGINFO
57# include <langinfo.h> 57# include <langinfo.h>
58#endif
59
60#ifdef HAVE_STARTUP_NOTIFICATION
61# define SN_API_NOT_YET_FROZEN
62# include <libsn/sn-launchee.h>
58#endif 63#endif
59 64
60#ifdef DISPLAY_IS_IP 65#ifdef DISPLAY_IS_IP
61/* On Solaris link with -lsocket and -lnsl */ 66/* On Solaris link with -lsocket and -lnsl */
62#include <sys/types.h> 67#include <sys/types.h>
605 rs[Rs_display_name] = ":0"; 610 rs[Rs_display_name] = ":0";
606 611
607 get_options (r_argc, r_argv); 612 get_options (r_argc, r_argv);
608 613
609 if (!(display = displays.get (rs[Rs_display_name]))) 614 if (!(display = displays.get (rs[Rs_display_name])))
610 {
611 free (r_argv);
612 rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); 615 rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]);
613 }
614 616
615 // using a local pointer decreases code size a lot 617 // using a local pointer decreases code size a lot
616 xa = display->xa; 618 xa = display->xa;
617 619
618 set (display); 620 set (display);
627 629
628 for (int i = NUM_RESOURCES; i--; ) 630 for (int i = NUM_RESOURCES; i--; )
629 if (rs [i] == resval_undef) 631 if (rs [i] == resval_undef)
630 rs [i] = 0; 632 rs [i] = 0;
631 633
632#ifdef HAVE_AFTERIMAGE
633 set_application_name ((char *)rs[Rs_name]);
634 set_output_threshold (OUTPUT_LEVEL_WARNING);
635#endif
636
637#ifdef HAVE_PIXBUF
638 g_type_init ();
639#endif
640
641#if ENABLE_PERL 634#if ENABLE_PERL
642 if (!rs[Rs_perl_ext_1]) 635 if (!rs[Rs_perl_ext_1])
643 rs[Rs_perl_ext_1] = "default"; 636 rs[Rs_perl_ext_1] = "default";
644 637
645 if ((rs[Rs_perl_ext_1] && *rs[Rs_perl_ext_1]) 638 if ((rs[Rs_perl_ext_1] && *rs[Rs_perl_ext_1])
648 { 641 {
649 rxvt_perl.init (this); 642 rxvt_perl.init (this);
650 HOOK_INVOKE ((this, HOOK_INIT, DT_END)); 643 HOOK_INVOKE ((this, HOOK_INIT, DT_END));
651 } 644 }
652#endif 645#endif
646
647 // must be called after initialising the perl interpreter as it
648 // may invoke the `on_register_command' hook
649 extract_keysym_resources ();
653 650
654 /* 651 /*
655 * set any defaults not already set 652 * set any defaults not already set
656 */ 653 */
657 if (cmd_argv && cmd_argv[0]) 654 if (cmd_argv && cmd_argv[0])
793 if (chdir (path)) 790 if (chdir (path))
794 rxvt_fatal ("unable to change into specified shell working directory, aborting.\n"); 791 rxvt_fatal ("unable to change into specified shell working directory, aborting.\n");
795 } 792 }
796 793
797 if (option (Opt_scrollBar)) 794 if (option (Opt_scrollBar))
798 scrollBar.state = STATE_IDLE; /* set existence for size calculations */ 795 scrollBar.state = SB_STATE_IDLE; /* set existence for size calculations */
799 796
800 pty = ptytty::create (); 797 pty = ptytty::create ();
798
799#ifdef HAVE_AFTERIMAGE
800 set_application_name ((char *)rs[Rs_name]);
801 set_output_threshold (OUTPUT_LEVEL_WARNING);
802#endif
803
804 // must be called before create_windows, because the latter may call set_icon
805#ifdef HAVE_PIXBUF
806 g_type_init ();
807#endif
801 808
802 create_windows (argc, argv); 809 create_windows (argc, argv);
803 810
804 init_xlocale (); 811 init_xlocale ();
805 812
836#endif 843#endif
837 844
838#ifdef BG_IMAGE_FROM_FILE 845#ifdef BG_IMAGE_FROM_FILE
839 if (rs[Rs_backgroundPixmap]) 846 if (rs[Rs_backgroundPixmap])
840 { 847 {
841 const char *p = rs[Rs_backgroundPixmap];
842
843 if ((p = strchr (p, ';')) != 0)
844 {
845 p++;
846 bg_set_geometry (p);
847 }
848 else
849 bg_set_default_geometry ();
850
851 if (bg_set_file (rs[Rs_backgroundPixmap])) 848 if (bg_set_file (rs[Rs_backgroundPixmap]))
852 if (!bg_window_position_sensitive ()) 849 if (!bg_window_position_sensitive ())
853 update_background (); 850 update_background ();
854 } 851 }
855#endif 852#endif
879 XChangeProperty (dpy, parent, xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO], 876 XChangeProperty (dpy, parent, xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO],
880 32, PropModeReplace, (unsigned char *)&info, 2); 877 32, PropModeReplace, (unsigned char *)&info, 2);
881 } 878 }
882#endif 879#endif
883 880
881#if HAVE_STARTUP_NOTIFICATION
882 SnDisplay *snDisplay;
883 SnLauncheeContext *snContext;
884
885 snDisplay = sn_display_new (dpy, NULL, NULL);
886 snContext = sn_launchee_context_new_from_environment (snDisplay, DefaultScreen (dpy));
887
888 /* Tell the window manager that this window is part of the startup context */
889 if (snContext)
890 sn_launchee_context_setup_window (snContext, parent);
891#endif
892
884 XMapWindow (dpy, vt); 893 XMapWindow (dpy, vt);
885 XMapWindow (dpy, parent); 894 XMapWindow (dpy, parent);
895
896#if HAVE_STARTUP_NOTIFICATION
897 if (snContext)
898 {
899 /* Mark the startup process as complete */
900 sn_launchee_context_complete (snContext);
901
902 sn_launchee_context_unref (snContext);
903 }
904
905 sn_display_unref (snDisplay);
906#endif
886 907
887 refresh_check (); 908 refresh_check ();
888} 909}
889 910
890/*----------------------------------------------------------------------*/ 911/*----------------------------------------------------------------------*/

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines