--- rxvt-unicode/src/init.C 2005/02/17 15:07:48 1.110 +++ rxvt-unicode/src/init.C 2005/02/19 01:07:58 1.112 @@ -183,6 +183,7 @@ "TIMESTAMP", "VT_SELECTION", "INCR", + "WM_PROTOCOLS", "WM_DELETE_WINDOW", "CLIPBOARD", #if ENABLE_FRILLS @@ -202,6 +203,9 @@ "DndProtocol", "DndSelection", #endif +#if ENABLE_XEMBED + "_XEMBED", +#endif }; bool @@ -975,13 +979,15 @@ if (!set_fonts ()) rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n"); -#if ENABLE_FRILLS +#if ENABLE_XEMBED if (rs[Rs_embed]) { + XWindowAttributes wattr; + top = strtol (rs[Rs_embed], 0, 0); - XWindowAttributes wattr; - XGetWindowAttributes (disp, top, &wattr); + if (!XGetWindowAttributes (disp, top, &wattr)) + rxvt_fatal ("invalid window-id specified with -embed, aborting.\n"); window_calc (wattr.width, wattr.height); @@ -1011,19 +1017,19 @@ attributes.border_pixel = pix_colors_focused[Color_border]; attributes.colormap = display->cmap; top = XCreateWindow (disp, DefaultRootWindow (disp), - szHint.x, szHint.y, - szHint.width, szHint.height, - TermWin.ext_bwidth, - display->depth, InputOutput, - display->visual, - CWColormap | CWBackPixel | CWBorderPixel, &attributes); + szHint.x, szHint.y, + szHint.width, szHint.height, + TermWin.ext_bwidth, + display->depth, InputOutput, + display->visual, + CWColormap | CWBackPixel | CWBorderPixel, &attributes); #else top = XCreateSimpleWindow (disp, DefaultRootWindow (disp), - szHint.x, szHint.y, - szHint.width, szHint.height, - TermWin.ext_bwidth, - pix_colors_focused[Color_border], - pix_colors_focused[Color_border]); + szHint.x, szHint.y, + szHint.width, szHint.height, + TermWin.ext_bwidth, + pix_colors_focused[Color_border], + pix_colors_focused[Color_border]); #endif } @@ -1047,7 +1053,7 @@ (char **)argv, argc, &szHint, &wmHint, &classHint); /* Enable delete window protocol */ - XSetWMProtocols (disp, top, &xa[XA_WMDELETEWINDOW], 1); + XSetWMProtocols (disp, top, &xa[XA_WM_DELETE_WINDOW], 1); #if ENABLE_FRILLS long pid = getpid (); @@ -1063,8 +1069,8 @@ | KeyReleaseMask #endif | FocusChangeMask | VisibilityChangeMask - | ExposureMask - | StructureNotifyMask); + | ExposureMask | StructureNotifyMask); + termwin_ev.start (display, top); #if ENABLE_FRILLS