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.96 by root, Sat Dec 11 23:01:36 2004 UTC vs.
Revision 1.97 by root, Wed Dec 15 00:12:58 2004 UTC

167#if TINTING 167#if TINTING
168 NULL, 168 NULL,
169#endif 169#endif
170 }; 170 };
171 171
172const char *const xa_names[NUM_XA] = 172const char *const xa_names[] =
173 { 173 {
174 "TEXT", 174 "TEXT",
175 "COMPOUND_TEXT", 175 "COMPOUND_TEXT",
176 "UTF8_STRING", 176 "UTF8_STRING",
177 "MULTIPLE", 177 "MULTIPLE",
178 "TARGETS", 178 "TARGETS",
179 "TIMESTAMP", 179 "TIMESTAMP",
180 "VT_SELECTION", 180 "VT_SELECTION",
181 "INCR", 181 "INCR",
182 "WM_DELETE_WINDOW", 182 "WM_DELETE_WINDOW",
183 "CLIPBOARD",
184#if ENABLE_FRILLS
185 "_NET_WM_PID",
186 "_MOTIF_WM_HINTS",
187 "_NET_WM_NAME",
188 "_NET_WM_ICON_NAME",
189#endif
190#if USE_XIM
191 "WM_LOCALE_NAME",
192#endif
183#ifdef TRANSPARENT 193#ifdef TRANSPARENT
184 "_XROOTPMAP_ID", 194 "_XROOTPMAP_ID",
195 "_XSETROOT_ID",
185#endif 196#endif
186#ifdef OFFIX_DND 197#ifdef OFFIX_DND
187 "DndProtocol", 198 "DndProtocol",
188 "DndSelection", 199 "DndSelection",
189#endif 200#endif
190 "CLIPBOARD"
191 }; 201 };
192 202
193bool 203bool
194rxvt_term::init_vars () 204rxvt_term::init_vars ()
195{ 205{
611#ifdef USE_XIM 621#ifdef USE_XIM
612 if (!locale) 622 if (!locale)
613 rxvt_warn ("setting locale failed, working without locale support.\n"); 623 rxvt_warn ("setting locale failed, working without locale support.\n");
614 else 624 else
615 { 625 {
616 set_string_property (display->atom ("WM_LOCALE_NAME"), locale); 626 set_string_property (xa[XA_WM_LOCALE_NAME], locale);
617 627
618 if (!XSupportsLocale ()) 628 if (!XSupportsLocale ())
619 { 629 {
620 rxvt_warn ("the locale is not supported by Xlib, working without locale support.\n"); 630 rxvt_warn ("the locale is not supported by Xlib, working without locale support.\n");
621 return; 631 return;
896 XGCValues gcvalue; 906 XGCValues gcvalue;
897 long vt_emask; 907 long vt_emask;
898 XSetWindowAttributes attributes; 908 XSetWindowAttributes attributes;
899 XWindowAttributes gattr; 909 XWindowAttributes gattr;
900 910
901 for (int i = 0; i < NUM_XA; i++)
902 xa[i] = XInternAtom (display->display, xa_names[i], False);
903
904#ifdef USING_W11LIB 911#ifdef USING_W11LIB
905 /* enable W11 callbacks */ 912 /* enable W11 callbacks */
906 W11AddEventHandler (display->display, rxvt_W11_process_x_event); 913 W11AddEventHandler (display->display, rxvt_W11_process_x_event);
907#endif 914#endif
915
916 assert (sizeof (xa_names) / sizeof (char *) == NUM_XA);
917 XInternAtoms (display->display, (char **)xa_names, NUM_XA, False, xa);
908 918
909 if (options & Opt_transparent) 919 if (options & Opt_transparent)
910 { 920 {
911 XGetWindowAttributes (display->display, RootWindow (display->display, display->screen), &gattr); 921 XGetWindowAttributes (display->display, RootWindow (display->display, display->screen), &gattr);
912 display->depth = gattr.depth; // doh //TODO, per-term not per-display? 922 display->depth = gattr.depth; // doh //TODO, per-term not per-display?
989 999
990#if ENABLE_FRILLS 1000#if ENABLE_FRILLS
991 long pid = getpid (); 1001 long pid = getpid ();
992 1002
993 XChangeProperty (display->display, TermWin.parent[0], 1003 XChangeProperty (display->display, TermWin.parent[0],
994 display->atom ("_NET_WM_PID"), XA_CARDINAL, 32, 1004 xa[XA_NET_WM_PID], XA_CARDINAL, 32,
995 PropModeReplace, (unsigned char *)&pid, 1); 1005 PropModeReplace, (unsigned char *)&pid, 1);
996#endif 1006#endif
997 1007
998 XSelectInput (display->display, TermWin.parent[0], 1008 XSelectInput (display->display, TermWin.parent[0],
999 KeyPressMask 1009 KeyPressMask
1005 | StructureNotifyMask); 1015 | StructureNotifyMask);
1006 termwin_ev.start (display, TermWin.parent[0]); 1016 termwin_ev.start (display, TermWin.parent[0]);
1007 1017
1008#if ENABLE_FRILLS 1018#if ENABLE_FRILLS
1009 if (mwmhints.flags) 1019 if (mwmhints.flags)
1010 { 1020 XChangeProperty (display->display, TermWin.parent[0], xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32,
1011 prop = XInternAtom (display->display, "_MOTIF_WM_HINTS", False);
1012 XChangeProperty (display->display, TermWin.parent[0], prop, prop, 32,
1013 PropModeReplace, (unsigned char *)&mwmhints, PROP_MWM_HINTS_ELEMENTS); 1021 PropModeReplace, (unsigned char *)&mwmhints, PROP_MWM_HINTS_ELEMENTS);
1014 }
1015#endif 1022#endif
1016 1023
1017 /* vt cursor: Black-on-White is standard, but this is more popular */ 1024 /* vt cursor: Black-on-White is standard, but this is more popular */
1018 TermWin_cursor = XCreateFontCursor (display->display, XC_xterm); 1025 TermWin_cursor = XCreateFontCursor (display->display, XC_xterm);
1019 1026

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines