From: root Date: Mon, 14 Feb 2005 18:47:54 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=5be5aee2a3462f08326feacc48124571d2163bae;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/Changes b/Changes index 55dc7477..d9d5b153 100644 --- a/Changes +++ b/Changes @@ -15,7 +15,7 @@ WISH: just for fun, do shade and tint with XRender. - fix a bug when parsing fontnames and another one for empty keymaps which could result in crashes (Kuang-che Wu). - - new option: -embed. + - new option: -embed (frills). - only warn on X errors, *try* to continue (frills). - add COPYING back, which got lost somehow. - after deciding that LSM is dead, remove all traces of it, diff --git a/doc/rxvt.1.html b/doc/rxvt.1.html index cdbc009f..aaf748cc 100644 --- a/doc/rxvt.1.html +++ b/doc/rxvt.1.html @@ -532,6 +532,9 @@ quite a bit, so don't expect it to keep some specific state. It's best to create an extra subwindow for rxvt and leave it alone.

+

The window will not be destroyed when rxvt exits.

+
+

It might be useful to know that rxvt will not close file descriptors passed to it (except for stdin/out/err, of course), so you can use file descriptors to communicate with the programs within the diff --git a/doc/rxvt.1.man.in b/doc/rxvt.1.man.in index e4b085b4..a6f4bc16 100644 --- a/doc/rxvt.1.man.in +++ b/doc/rxvt.1.man.in @@ -456,6 +456,8 @@ shouldn't be a top-level window. @@RXVT_NAME@@ will also reconfigure it quite a bit, so don't expect it to keep some specific state. It's best to create an extra subwindow for @@RXVT_NAME@@ and leave it alone. .Sp +The window will not be destroyed when @@RXVT_NAME@@ exits. +.Sp It might be useful to know that @@RXVT_NAME@@ will not close file descriptors passed to it (except for stdin/out/err, of course), so you can use file descriptors to communicate with the programs within the diff --git a/doc/rxvt.1.pod b/doc/rxvt.1.pod index 8208d71c..b1c96291 100644 --- a/doc/rxvt.1.pod +++ b/doc/rxvt.1.pod @@ -384,6 +384,8 @@ shouldn't be a top-level window. @@RXVT_NAME@@ will also reconfigure it quite a bit, so don't expect it to keep some specific state. It's best to create an extra subwindow for @@RXVT_NAME@@ and leave it alone. +The window will not be destroyed when @@RXVT_NAME@@ exits. + It might be useful to know that @@RXVT_NAME@@ will not close file descriptors passed to it (except for stdin/out/err, of course), so you can use file descriptors to communicate with the programs within the diff --git a/doc/rxvt.1.txt b/doc/rxvt.1.txt index 1783e122..e8a1ee3a 100644 --- a/doc/rxvt.1.txt +++ b/doc/rxvt.1.txt @@ -325,6 +325,8 @@ OPTIONS a bit, so don't expect it to keep some specific state. It's best to create an extra subwindow for rxvt and leave it alone. + The window will not be destroyed when rxvt exits. + It might be useful to know that rxvt will not close file descriptors passed to it (except for stdin/out/err, of course), so you can use file descriptors to communicate with the programs within the diff --git a/doc/rxvt.7.html b/doc/rxvt.7.html index 92aeb3ea..80afa9f3 100644 --- a/doc/rxvt.7.html +++ b/doc/rxvt.7.html @@ -146,8 +146,8 @@ the rxvt terminfo file with the rxvt-unicode one.

One reason you might want this is that some distributions or operating systems still compile some programs using the long-obsoleted termcap -(Fedora Core's bash is one example) and rely on a termcap entry for -rxvt-unicode. +library (Fedora Core's bash is one example) and rely on a termcap entry +for rxvt-unicode.

You could use rxvt's termcap entry with resonable results in many cases. @@ -165,7 +165,7 @@ like this:

    rxvt-unicode|rxvt-unicode terminal (X Window System):\
            :am:bw:eo:km:mi:ms:xn:xo:\
-           :co#80:it#8:li#24:\
+           :co#80:it#8:li#24:lm#0:\
            :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
            :K1=\EOw:K2=\EOu:K3=\EOy:K4=\EOq:K5=\EOs:LE=\E[%dD:\
            :RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:ae=^O:al=\E[L:\
@@ -173,14 +173,14 @@ like this:

:cr=^M:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:do=^J:\ :ec=\E[%dX:ei=\E[4l:ho=\E[H:i1=\E[?47l\E=\E[?1l:ic=\E[@:\ :im=\E[4h:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l:\ - :k0=\E[21~:k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:\ - :k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:\ - :kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:\ - :ke=\E[?1l\E>:kh=\E[7~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\ - :ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:me=\E[m\017:mr=\E[7m:\ - :nd=\E[C:rc=\E8:sc=\E7:se=\E[27m:sf=^J:so=\E[7m:sr=\EM:\ - :st=\EH:ta=^I:te=\E[r\E[?1049l:ti=\E[?1049h:ue=\E[24m:\ - :up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:ve=\E[?25h:vi=\E[?25l:\ + :k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:k5=\E[15~:\ + :k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:kD=\E[3~:\ + :kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:ke=\E[?1l\E>:\ + :kh=\E[7~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:le=^H:\ + :mb=\E[5m:md=\E[1m:me=\E[m\017:mr=\E[7m:nd=\E[C:rc=\E8:\ + :sc=\E7:se=\E[27m:sf=^J:so=\E[7m:sr=\EM:st=\EH:ta=^I:\ + :te=\E[r\E[?1049l:ti=\E[?1049h:ue=\E[24m:up=\E[A:\ + :us=\E[4m:vb=\E[?5h\E[?5l:ve=\E[?25h:vi=\E[?25l:\ :vs=\E[?25h:

diff --git a/doc/rxvt.7.man.in b/doc/rxvt.7.man.in index 5d2c7523..af66d921 100644 --- a/doc/rxvt.7.man.in +++ b/doc/rxvt.7.man.in @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "rxvt 7" -.TH rxvt 7 "2005-02-14" "" "RXVT-UNICODE" +.TH rxvt 7 "2005-02-14" "5.1" "RXVT-UNICODE" .SH "NAME" RXVT REFERENCE \- FAQ, command sequences and other background information .SH "SYNOPSIS" @@ -216,8 +216,8 @@ the rxvt terminfo file with the rxvt-unicode one. .PD One reason you might want this is that some distributions or operating systems still compile some programs using the long-obsoleted termcap -(Fedora Core's bash is one example) and rely on a termcap entry for -\&\f(CW\*(C`rxvt\-unicode\*(C'\fR. +library (Fedora Core's bash is one example) and rely on a termcap entry +for \f(CW\*(C`rxvt\-unicode\*(C'\fR. .Sp You could use rxvt's termcap entry with resonable results in many cases. You can also create a termcap entry by using terminfo's infocmp program @@ -232,7 +232,7 @@ Or you could use this termcap entry, generated by the command above: .Vb 19 \& rxvt-unicode|rxvt-unicode terminal (X Window System):\e \& :am:bw:eo:km:mi:ms:xn:xo:\e -\& :co#80:it#8:li#24:\e +\& :co#80:it#8:li#24:lm#0:\e \& :AL=\eE[%dL:DC=\eE[%dP:DL=\eE[%dM:DO=\eE[%dB:IC=\eE[%d@:\e \& :K1=\eEOw:K2=\eEOu:K3=\eEOy:K4=\eEOq:K5=\eEOs:LE=\eE[%dD:\e \& :RI=\eE[%dC:SF=\eE[%dS:SR=\eE[%dT:UP=\eE[%dA:ae=^O:al=\eE[L:\e @@ -240,14 +240,14 @@ Or you could use this termcap entry, generated by the command above: \& :cr=^M:cs=\eE[%i%d;%dr:ct=\eE[3g:dc=\eE[P:dl=\eE[M:do=^J:\e \& :ec=\eE[%dX:ei=\eE[4l:ho=\eE[H:i1=\eE[?47l\eE=\eE[?1l:ic=\eE[@:\e \& :im=\eE[4h:is=\eE[r\eE[m\eE[2J\eE[H\eE[?7h\eE[?1;3;4;6l\eE[4l:\e -\& :k0=\eE[21~:k1=\eE[11~:k2=\eE[12~:k3=\eE[13~:k4=\eE[14~:\e -\& :k5=\eE[15~:k6=\eE[17~:k7=\eE[18~:k8=\eE[19~:k9=\eE[20~:\e -\& :kD=\eE[3~:kI=\eE[2~:kN=\eE[6~:kP=\eE[5~:kb=\e177:kd=\eEOB:\e -\& :ke=\eE[?1l\eE>:kh=\eE[7~:kl=\eEOD:kr=\eEOC:ks=\eE[?1h\eE=:\e -\& :ku=\eEOA:le=^H:mb=\eE[5m:md=\eE[1m:me=\eE[m\e017:mr=\eE[7m:\e -\& :nd=\eE[C:rc=\eE8:sc=\eE7:se=\eE[27m:sf=^J:so=\eE[7m:sr=\eEM:\e -\& :st=\eEH:ta=^I:te=\eE[r\eE[?1049l:ti=\eE[?1049h:ue=\eE[24m:\e -\& :up=\eE[A:us=\eE[4m:vb=\eE[?5h\eE[?5l:ve=\eE[?25h:vi=\eE[?25l:\e +\& :k1=\eE[11~:k2=\eE[12~:k3=\eE[13~:k4=\eE[14~:k5=\eE[15~:\e +\& :k6=\eE[17~:k7=\eE[18~:k8=\eE[19~:k9=\eE[20~:kD=\eE[3~:\e +\& :kI=\eE[2~:kN=\eE[6~:kP=\eE[5~:kb=\e177:kd=\eEOB:ke=\eE[?1l\eE>:\e +\& :kh=\eE[7~:kl=\eEOD:kr=\eEOC:ks=\eE[?1h\eE=:ku=\eEOA:le=^H:\e +\& :mb=\eE[5m:md=\eE[1m:me=\eE[m\e017:mr=\eE[7m:nd=\eE[C:rc=\eE8:\e +\& :sc=\eE7:se=\eE[27m:sf=^J:so=\eE[7m:sr=\eEM:st=\eEH:ta=^I:\e +\& :te=\eE[r\eE[?1049l:ti=\eE[?1049h:ue=\eE[24m:up=\eE[A:\e +\& :us=\eE[4m:vb=\eE[?5h\eE[?5l:ve=\eE[?25h:vi=\eE[?25l:\e \& :vs=\eE[?25h: .Ve .ie n .IP "Why does ""ls"" no longer have coloured output?" 4 diff --git a/doc/rxvt.7.txt b/doc/rxvt.7.txt index 30f3088d..d6d90322 100644 --- a/doc/rxvt.7.txt +++ b/doc/rxvt.7.txt @@ -72,8 +72,8 @@ FREQUENTLY ASKED QUESTIONS I need a termcap file entry. One reason you might want this is that some distributions or operating systems still compile some programs using the - long-obsoleted termcap (Fedora Core's bash is one example) and rely - on a termcap entry for "rxvt-unicode". + long-obsoleted termcap library (Fedora Core's bash is one example) + and rely on a termcap entry for "rxvt-unicode". You could use rxvt's termcap entry with resonable results in many cases. You can also create a termcap entry by using terminfo's @@ -85,7 +85,7 @@ FREQUENTLY ASKED QUESTIONS rxvt-unicode|rxvt-unicode terminal (X Window System):\ :am:bw:eo:km:mi:ms:xn:xo:\ - :co#80:it#8:li#24:\ + :co#80:it#8:li#24:lm#0:\ :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\ :K1=\EOw:K2=\EOu:K3=\EOy:K4=\EOq:K5=\EOs:LE=\E[%dD:\ :RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:ae=^O:al=\E[L:\ @@ -93,14 +93,14 @@ FREQUENTLY ASKED QUESTIONS :cr=^M:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:do=^J:\ :ec=\E[%dX:ei=\E[4l:ho=\E[H:i1=\E[?47l\E=\E[?1l:ic=\E[@:\ :im=\E[4h:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l:\ - :k0=\E[21~:k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:\ - :k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:\ - :kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:\ - :ke=\E[?1l\E>:kh=\E[7~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\ - :ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:me=\E[m\017:mr=\E[7m:\ - :nd=\E[C:rc=\E8:sc=\E7:se=\E[27m:sf=^J:so=\E[7m:sr=\EM:\ - :st=\EH:ta=^I:te=\E[r\E[?1049l:ti=\E[?1049h:ue=\E[24m:\ - :up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:ve=\E[?25h:vi=\E[?25l:\ + :k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:k5=\E[15~:\ + :k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:kD=\E[3~:\ + :kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:ke=\E[?1l\E>:\ + :kh=\E[7~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:le=^H:\ + :mb=\E[5m:md=\E[1m:me=\E[m\017:mr=\E[7m:nd=\E[C:rc=\E8:\ + :sc=\E7:se=\E[27m:sf=^J:so=\E[7m:sr=\EM:st=\EH:ta=^I:\ + :te=\E[r\E[?1049l:ti=\E[?1049h:ue=\E[24m:up=\E[A:\ + :us=\E[4m:vb=\E[?5h\E[?5l:ve=\E[?25h:vi=\E[?25l:\ :vs=\E[?25h: Why does "ls" no longer have coloured output? diff --git a/src/init.C b/src/init.C index 031955ac..739b075f 100644 --- a/src/init.C +++ b/src/init.C @@ -928,6 +928,7 @@ rxvt_term::create_windows (int argc, const char *const *argv) long vt_emask; XSetWindowAttributes attributes; XWindowAttributes gattr; + Window top; dDisp; #ifdef USING_W11LIB @@ -975,31 +976,62 @@ rxvt_term::create_windows (int argc, const char *const *argv) if (!set_fonts ()) rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n"); - window_calc (0, 0); - old_width = szHint.width; - old_height = szHint.height; +#if ENABLE_FRILLS + if (rs[Rs_embed]) + { + top = strtol (rs[Rs_embed], 0, 0); + + XWindowAttributes wattr; + XGetWindowAttributes (disp, top, &wattr); - /* sub-window placement & size in rxvt_resize_subwindows () */ + window_calc (wattr.width, wattr.height); +#if 0 + if (wattr.map_state == IsViewable) + { + TermWin.mapped = 1; + refresh_type = FAST_REFRESH; + XClearWindow (disp, top); + // TODO: make XMapNotify-event-code a function and call it + // TODO: how can I detetc visibility without unmpa/map? + // TODO: focusin etc. + } +#else + // it'S easiets just to unmap/map to get all state correctly set-up + XUnmapWindow (disp, top); +#endif + } + else +#endif + { + window_calc (0, 0); + + /* sub-window placement & size in rxvt_resize_subwindows () */ #ifdef PREFER_24BIT - attributes.background_pixel = pix_colors_focused[Color_border]; - attributes.border_pixel = pix_colors_focused[Color_border]; - attributes.colormap = display->cmap; - TermWin.parent[0] = XCreateWindow (disp, DefaultRootWindow (disp), - szHint.x, szHint.y, - szHint.width, szHint.height, - TermWin.ext_bwidth, - display->depth, InputOutput, - display->visual, - CWColormap | CWBackPixel | CWBorderPixel, &attributes); + attributes.background_pixel = pix_colors_focused[Color_border]; + 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); #else - TermWin.parent[0] = 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]); + 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]); #endif + } + + TermWin.parent[0] = top; + + old_width = szHint.width; + old_height = szHint.height; process_xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST); process_xterm_seq (XTerm_iconName, rs[Rs_iconName], CHAR_ST); @@ -1010,24 +1042,23 @@ rxvt_term::create_windows (int argc, const char *const *argv) wmHint.flags = InputHint | StateHint | WindowGroupHint; wmHint.input = True; wmHint.initial_state = options & Opt_iconic ? IconicState : NormalState; - wmHint.window_group = TermWin.parent[0]; + wmHint.window_group = top; - XSetWMProperties (disp, TermWin.parent[0], NULL, NULL, + XSetWMProperties (disp, top, NULL, NULL, (char **)argv, argc, &szHint, &wmHint, &classHint); /* Enable delete window protocol */ - XSetWMProtocols (disp, TermWin.parent[0], - &xa[XA_WMDELETEWINDOW], 1); + XSetWMProtocols (disp, top, &xa[XA_WMDELETEWINDOW], 1); #if ENABLE_FRILLS long pid = getpid (); - XChangeProperty (disp, TermWin.parent[0], + XChangeProperty (disp, top, xa[XA_NET_WM_PID], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&pid, 1); #endif - XSelectInput (disp, TermWin.parent[0], + XSelectInput (disp, top, KeyPressMask #if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ENABLE_FRILLS || ISO_14755 | KeyReleaseMask @@ -1035,11 +1066,11 @@ rxvt_term::create_windows (int argc, const char *const *argv) | FocusChangeMask | VisibilityChangeMask | ExposureMask | StructureNotifyMask); - termwin_ev.start (display, TermWin.parent[0]); + termwin_ev.start (display, top); #if ENABLE_FRILLS if (mwmhints.flags) - XChangeProperty (disp, TermWin.parent[0], xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32, + XChangeProperty (disp, top, xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32, PropModeReplace, (unsigned char *)&mwmhints, PROP_MWM_HINTS_ELEMENTS); #endif @@ -1052,7 +1083,7 @@ rxvt_term::create_windows (int argc, const char *const *argv) #endif /* the vt window */ - TermWin.vt = XCreateSimpleWindow (disp, TermWin.parent[0], + TermWin.vt = XCreateSimpleWindow (disp, top, window_vt_x, window_vt_y, TermWin_TotalWidth (), @@ -1084,7 +1115,7 @@ rxvt_term::create_windows (int argc, const char *const *argv) #if defined(MENUBAR) && (MENUBAR_MAX > 1) if (menuBar_height ()) { - menuBar.win = XCreateSimpleWindow (disp, TermWin.parent[0], + menuBar.win = XCreateSimpleWindow (disp, top, window_vt_x, 0, TermWin_TotalWidth (), menuBar_TotalHeight (), diff --git a/src/main.C b/src/main.C index a17d577b..6acf9fda 100644 --- a/src/main.C +++ b/src/main.C @@ -255,7 +255,7 @@ rxvt_term::~rxvt_term () #endif delete TermWin.drawable; // destroy all windows - if (TermWin.parent[0]) + if (TermWin.parent[0] && !rs[Rs_embed]) XDestroyWindow (disp, TermWin.parent[0]); } @@ -714,16 +714,19 @@ rxvt_term::window_calc (unsigned int width, unsigned int height) parsed_geometry = 1; if (rs[Rs_geometry]) flags = XParseGeometry (rs[Rs_geometry], &x, &y, &w, &h); + if (flags & WidthValue) { TermWin.ncol = BOUND_POSITIVE_INT16 (w); szHint.flags |= USSize; } + if (flags & HeightValue) { TermWin.nrow = BOUND_POSITIVE_INT16 (h); szHint.flags |= USSize; } + if (flags & XValue) { szHint.x = x; @@ -734,6 +737,7 @@ rxvt_term::window_calc (unsigned int width, unsigned int height) szHint.win_gravity = NorthEastGravity; } } + if (flags & YValue) { szHint.y = y; diff --git a/src/rxvt.h b/src/rxvt.h index b58d976a..77d45848 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -605,9 +605,8 @@ enum { Rs_ext_bwidth, Rs_int_bwidth, Rs_borderLess, -#endif -#if ENABLE_FRILLS Rs_lineSpace, + Rs_embed, #endif Rs_cutchars, Rs_modifier, diff --git a/src/xdefaults.C b/src/xdefaults.C index 4f3b28f7..d6c16aba 100644 --- a/src/xdefaults.C +++ b/src/xdefaults.C @@ -219,6 +219,7 @@ optList[] = { STRG (Rs_iconName, "iconName", "n", "string", "icon name for window"), STRG (Rs_saveLines, "saveLines", "sl", "number", "number of scrolled lines to save"), #if ENABLE_FRILLS + STRG (Rs_embed, NULL, "embed", "windowid", "window id to embed terminal in"), STRG (Rs_ext_bwidth, "externalBorder", "w", "number", "external border in pixels"), STRG (Rs_ext_bwidth, NULL, "bw", NULL, NULL), STRG (Rs_ext_bwidth, NULL, "borderwidth", NULL, NULL),