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.110 by root, Thu Feb 17 15:07:48 2005 UTC vs.
Revision 1.113 by root, Sat Feb 19 04:16:49 2005 UTC

181 "MULTIPLE", 181 "MULTIPLE",
182 "TARGETS", 182 "TARGETS",
183 "TIMESTAMP", 183 "TIMESTAMP",
184 "VT_SELECTION", 184 "VT_SELECTION",
185 "INCR", 185 "INCR",
186 "WM_PROTOCOLS",
186 "WM_DELETE_WINDOW", 187 "WM_DELETE_WINDOW",
187 "CLIPBOARD", 188 "CLIPBOARD",
188#if ENABLE_FRILLS 189#if ENABLE_FRILLS
189 "_NET_WM_PID", 190 "_NET_WM_PID",
190 "_MOTIF_WM_HINTS", 191 "_MOTIF_WM_HINTS",
199 "ESETROOT_PMAP_ID", 200 "ESETROOT_PMAP_ID",
200#endif 201#endif
201#ifdef OFFIX_DND 202#ifdef OFFIX_DND
202 "DndProtocol", 203 "DndProtocol",
203 "DndSelection", 204 "DndSelection",
205#endif
206#if ENABLE_XEMBED
207 "_XEMBED",
204#endif 208#endif
205 }; 209 };
206 210
207bool 211bool
208rxvt_term::init_vars () 212rxvt_term::init_vars ()
973 Get_Colours (); 977 Get_Colours ();
974 978
975 if (!set_fonts ()) 979 if (!set_fonts ())
976 rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n"); 980 rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n");
977 981
978#if ENABLE_FRILLS 982#if ENABLE_XEMBED
979 if (rs[Rs_embed]) 983 if (rs[Rs_embed])
980 { 984 {
985 XWindowAttributes wattr;
986
981 top = strtol (rs[Rs_embed], 0, 0); 987 top = strtol (rs[Rs_embed], 0, 0);
982 988
983 XWindowAttributes wattr;
984 XGetWindowAttributes (disp, top, &wattr); 989 if (!XGetWindowAttributes (disp, top, &wattr))
990 rxvt_fatal ("invalid window-id specified with -embed, aborting.\n");
985 991
986 window_calc (wattr.width, wattr.height); 992 window_calc (wattr.width, wattr.height);
987 993
988#if 0 994#if 0
989 if (wattr.map_state == IsViewable) 995 if (wattr.map_state == IsViewable)
990 { 996 {
991 TermWin.mapped = 1; 997 TermWin.mapped = 1;
992 refresh_type = FAST_REFRESH; 998 refresh_type = FAST_REFRESH;
993 XClearWindow (disp, top); 999 XClearWindow (disp, top);
994 // TODO: make XMapNotify-event-code a function and call it 1000 // TODO: make XMapNotify-event-code a function and call it
995 // TODO: how can I detetc visibility without unmpa/map? 1001 // TODO: how can I detect visibility without unmap/map?
996 // TODO: focusin etc. 1002 // TODO: focusin etc.
997 } 1003 }
998#else 1004#else
999 // it'S easiets just to unmap/map to get all state correctly set-up 1005 // it's easiest just to unmap/map to get all state correctly set-up
1000 XUnmapWindow (disp, top); 1006 XUnmapWindow (disp, top);
1001#endif 1007#endif
1002 } 1008 }
1003 else 1009 else
1004#endif 1010#endif
1009#ifdef PREFER_24BIT 1015#ifdef PREFER_24BIT
1010 attributes.background_pixel = pix_colors_focused[Color_border]; 1016 attributes.background_pixel = pix_colors_focused[Color_border];
1011 attributes.border_pixel = pix_colors_focused[Color_border]; 1017 attributes.border_pixel = pix_colors_focused[Color_border];
1012 attributes.colormap = display->cmap; 1018 attributes.colormap = display->cmap;
1013 top = XCreateWindow (disp, DefaultRootWindow (disp), 1019 top = XCreateWindow (disp, DefaultRootWindow (disp),
1014 szHint.x, szHint.y, 1020 szHint.x, szHint.y,
1015 szHint.width, szHint.height, 1021 szHint.width, szHint.height,
1016 TermWin.ext_bwidth, 1022 TermWin.ext_bwidth,
1017 display->depth, InputOutput, 1023 display->depth, InputOutput,
1018 display->visual, 1024 display->visual,
1019 CWColormap | CWBackPixel | CWBorderPixel, &attributes); 1025 CWColormap | CWBackPixel | CWBorderPixel, &attributes);
1020#else 1026#else
1021 top = XCreateSimpleWindow (disp, DefaultRootWindow (disp), 1027 top = XCreateSimpleWindow (disp, DefaultRootWindow (disp),
1022 szHint.x, szHint.y, 1028 szHint.x, szHint.y,
1023 szHint.width, szHint.height, 1029 szHint.width, szHint.height,
1024 TermWin.ext_bwidth, 1030 TermWin.ext_bwidth,
1025 pix_colors_focused[Color_border], 1031 pix_colors_focused[Color_border],
1026 pix_colors_focused[Color_border]); 1032 pix_colors_focused[Color_border]);
1027#endif 1033#endif
1028 } 1034 }
1029 1035
1030 TermWin.parent[0] = top; 1036 TermWin.parent[0] = top;
1031 1037
1045 1051
1046 XSetWMProperties (disp, top, NULL, NULL, 1052 XSetWMProperties (disp, top, NULL, NULL,
1047 (char **)argv, argc, &szHint, &wmHint, &classHint); 1053 (char **)argv, argc, &szHint, &wmHint, &classHint);
1048 1054
1049 /* Enable delete window protocol */ 1055 /* Enable delete window protocol */
1050 XSetWMProtocols (disp, top, &xa[XA_WMDELETEWINDOW], 1); 1056 XSetWMProtocols (disp, top, &xa[XA_WM_DELETE_WINDOW], 1);
1051 1057
1052#if ENABLE_FRILLS 1058#if ENABLE_FRILLS
1053 long pid = getpid (); 1059 long pid = getpid ();
1054 1060
1055 XChangeProperty (disp, top, 1061 XChangeProperty (disp, top,
1061 KeyPressMask 1067 KeyPressMask
1062#if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ENABLE_FRILLS || ISO_14755 1068#if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ENABLE_FRILLS || ISO_14755
1063 | KeyReleaseMask 1069 | KeyReleaseMask
1064#endif 1070#endif
1065 | FocusChangeMask | VisibilityChangeMask 1071 | FocusChangeMask | VisibilityChangeMask
1066 | ExposureMask
1067 | StructureNotifyMask); 1072 | ExposureMask | StructureNotifyMask);
1073
1068 termwin_ev.start (display, top); 1074 termwin_ev.start (display, top);
1069 1075
1070#if ENABLE_FRILLS 1076#if ENABLE_FRILLS
1071 if (mwmhints.flags) 1077 if (mwmhints.flags)
1072 XChangeProperty (disp, top, xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32, 1078 XChangeProperty (disp, top, xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32,
1097 attributes.bit_gravity = NorthWestGravity; 1103 attributes.bit_gravity = NorthWestGravity;
1098 XChangeWindowAttributes (disp, TermWin.vt, CWBitGravity, &attributes); 1104 XChangeWindowAttributes (disp, TermWin.vt, CWBitGravity, &attributes);
1099 1105
1100 vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask; 1106 vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask;
1101 1107
1102 pointer_unblank ();
1103
1104#ifdef POINTER_BLANK 1108#ifdef POINTER_BLANK
1105 if (options & Opt_pointerBlank) 1109 if (options & Opt_pointerBlank)
1106 vt_emask |= PointerMotionMask; 1110 vt_emask |= PointerMotionMask;
1107 else 1111 else
1108#endif 1112#endif
1177 // initially we are in unfocused state 1181 // initially we are in unfocused state
1178 if (rs[Rs_fade]) 1182 if (rs[Rs_fade])
1179 pix_colors = pix_colors_unfocused; 1183 pix_colors = pix_colors_unfocused;
1180#endif 1184#endif
1181 1185
1186 pointer_unblank ();
1182 scr_recolour (); 1187 scr_recolour ();
1188
1189#if ENABLE_XEMBED
1190 // why this is necessary, I don't know, race condition??
1191 XMoveWindow (disp, TermWin.vt, window_vt_x, window_vt_y);
1192#endif
1183} 1193}
1184 1194
1185/* ------------------------------------------------------------------------- * 1195/* ------------------------------------------------------------------------- *
1186 * GET TTY CURRENT STATE * 1196 * GET TTY CURRENT STATE *
1187 * ------------------------------------------------------------------------- */ 1197 * ------------------------------------------------------------------------- */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines