… | |
… | |
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); |
… | |
… | |
639 | { |
641 | { |
640 | rxvt_perl.init (this); |
642 | rxvt_perl.init (this); |
641 | HOOK_INVOKE ((this, HOOK_INIT, DT_END)); |
643 | HOOK_INVOKE ((this, HOOK_INIT, DT_END)); |
642 | } |
644 | } |
643 | #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 (); |
644 | |
650 | |
645 | /* |
651 | /* |
646 | * set any defaults not already set |
652 | * set any defaults not already set |
647 | */ |
653 | */ |
648 | if (cmd_argv && cmd_argv[0]) |
654 | if (cmd_argv && cmd_argv[0]) |
… | |
… | |
784 | if (chdir (path)) |
790 | if (chdir (path)) |
785 | 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"); |
786 | } |
792 | } |
787 | |
793 | |
788 | if (option (Opt_scrollBar)) |
794 | if (option (Opt_scrollBar)) |
789 | scrollBar.state = STATE_IDLE; /* set existence for size calculations */ |
795 | scrollBar.state = SB_STATE_IDLE; /* set existence for size calculations */ |
790 | |
796 | |
791 | 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 |
792 | |
808 | |
793 | create_windows (argc, argv); |
809 | create_windows (argc, argv); |
794 | |
810 | |
795 | init_xlocale (); |
811 | init_xlocale (); |
796 | |
812 | |
… | |
… | |
827 | #endif |
843 | #endif |
828 | |
844 | |
829 | #ifdef BG_IMAGE_FROM_FILE |
845 | #ifdef BG_IMAGE_FROM_FILE |
830 | if (rs[Rs_backgroundPixmap]) |
846 | if (rs[Rs_backgroundPixmap]) |
831 | { |
847 | { |
832 | const char *p = rs[Rs_backgroundPixmap]; |
|
|
833 | |
|
|
834 | if ((p = strchr (p, ';')) != 0) |
|
|
835 | { |
|
|
836 | p++; |
|
|
837 | bg_set_geometry (p); |
|
|
838 | } |
|
|
839 | else |
|
|
840 | bg_set_default_geometry (); |
|
|
841 | |
|
|
842 | if (bg_set_file (rs[Rs_backgroundPixmap])) |
848 | if (bg_set_file (rs[Rs_backgroundPixmap])) |
843 | if (!bg_window_position_sensitive ()) |
849 | if (!bg_window_position_sensitive ()) |
844 | update_background (); |
850 | update_background (); |
845 | } |
851 | } |
846 | #endif |
852 | #endif |
… | |
… | |
870 | XChangeProperty (dpy, parent, xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO], |
876 | XChangeProperty (dpy, parent, xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO], |
871 | 32, PropModeReplace, (unsigned char *)&info, 2); |
877 | 32, PropModeReplace, (unsigned char *)&info, 2); |
872 | } |
878 | } |
873 | #endif |
879 | #endif |
874 | |
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 | |
875 | XMapWindow (dpy, vt); |
893 | XMapWindow (dpy, vt); |
876 | 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 |
877 | |
907 | |
878 | refresh_check (); |
908 | refresh_check (); |
879 | } |
909 | } |
880 | |
910 | |
881 | /*----------------------------------------------------------------------*/ |
911 | /*----------------------------------------------------------------------*/ |