1 diff -Nru aterm-1.0.1.orig/README.configure aterm-1.0.1/README.configure
2 --- aterm-1.0.1.orig/README.configure 2007-08-02 14:35:31.000000000 +0200
3 +++ aterm-1.0.1/README.configure 2007-08-02 14:23:19.000000000 +0200
4 @@ -56,6 +56,10 @@
5 the mouse button down on a scrollbar arrow
6 --disable-mousewheel
7 remove support for scrolling via mouse wheel or buttons 4 & 5
8 +--enable-fake-root
9 + add support for pseudo root terminals. Associated with
10 + transparency options, this enables pseudo-terminals
11 + looking like they are part of X root window
12 --enable-old-selection
13 revert mouse selection to something similar to v2.20 (and prior) -
14 this implies word selection of those versions (i.e. next option)
15 diff -Nru aterm-1.0.1.orig/autoconf/configure.in aterm-1.0.1/autoconf/configure.in
16 --- aterm-1.0.1.orig/autoconf/configure.in 2007-08-02 14:35:30.000000000 +0200
17 +++ aterm-1.0.1/autoconf/configure.in 2007-08-02 15:00:51.000000000 +0200
18 @@ -82,6 +82,9 @@
19 AC_ARG_ENABLE(mousewheel, [ --disable-mousewheel disable scrolling via mouse wheel or buttons 4 & 5],
20 [if test x$enableval = xno; then AC_DEFINE(NO_MOUSE_WHEEL,1,[Use wheel events (button4 and button5) to scroll]) fi])
21
22 +AC_ARG_ENABLE(fake-root, [ --enable-fake-root enable fake root support],
23 + [if test x$enableval = xyes; then AC_DEFINE(FAKE_ROOT,1,[Define to enable fake root pseudo-terminals]) fi])
24 +
25 AC_ARG_ENABLE(old-selection, [ --enable-old-selection enable v2.20 (and prior) mouse selection
26 - this implies old word selection],
27 [if test x$enableval = xyes; then AC_DEFINE(OLD_SELECTION,1,[Define to use old rxvt (ver 2.20 and before) style selection, not xterm style.]) fi])
28 @@ -635,7 +638,7 @@
29 [setlocale(LC_CTYPE, "");],
30 rxvt_cv_func_xsetlocale=yes, rxvt_cv_func_xsetlocale=no)])
31 if test "${rxvt_cv_func_xsetlocale}" = no; then
32 - AC_DEFINE(NO_XSETLOCALE)
33 + AC_DEFINE(NO_XSETLOCALE,1,[Define if xsetlocale doesn't work])
34 fi
35
36 AC_CACHE_CHECK(for working plain setlocale, rxvt_cv_func_setlocale,
37 diff -Nru aterm-1.0.1.orig/doc/aterm.1 aterm-1.0.1/doc/aterm.1
38 --- aterm-1.0.1.orig/doc/aterm.1 2007-08-02 14:35:30.000000000 +0200
39 +++ aterm-1.0.1/doc/aterm.1 2007-08-02 14:23:19.000000000 +0200
40 @@ -230,6 +230,16 @@
41 .IP "\fB-st\fP|\fB+st\fP"
42 Display scrollbar without/with a trough;
43 resource \fBscrollBar_floating\fP\&.
44 +.IP "\fB-fr\fP|\fB+fr\fP"
45 +Turn on/off making the aterm's parent window an unmanaged one mapped
46 +at the bottom on the stack without cursor change. When turned on, also
47 +provide a 'point-to-focus' behavior model independently
48 +from the X Window Manager.\&
49 +
50 +This is useful combined with other options (\fB-tr\fP, \fB-bw\fP,
51 +\fB-geometry\fP, ...) to provide pseudo-terminals seamlessly integrated
52 +into the X desktop. Please note this will not work as expected with WMs
53 +masquerading the X root window with fake roots; resource \fBfakeRoot\fP\&.
54 .IP "\fB-iconic\fP"
55 Start iconified, if the window manager supports that option\&.
56 .IP "\fB-sl\fP \fInumber\fP"
57 diff -Nru aterm-1.0.1.orig/src/command.c aterm-1.0.1/src/command.c
58 --- aterm-1.0.1.orig/src/command.c 2007-08-02 14:35:31.000000000 +0200
59 +++ aterm-1.0.1/src/command.c 2007-08-02 15:48:46.000000000 +0200
60 @@ -1886,9 +1886,9 @@
61 case XK_F2: /* "\033[12~" */
62 case XK_F3: /* "\033[13~" */
63 case XK_F4: /* "\033[14~" */
64 - FKEY(11, XK_F1);
65 + FKEY(11, XK_F1);
66 break;
67 -#endif
68 +#endif
69 case XK_F5: /* "\033[15~" */
70 FKEY(15, XK_F5);
71 break;
72 @@ -2411,6 +2411,13 @@
73 }
74 break;
75
76 +#ifdef FAKE_ROOT
77 + case EnterNotify:
78 + if (Options&Opt_fake_root)
79 + XGrabKeyboard(Xdisplay,TermWin.parent,True,
80 + GrabModeAsync,GrabModeAsync,CurrentTime);
81 + else break;
82 +#endif
83 case FocusIn:
84 if (!TermWin.focus) {
85 TermWin.focus = 1;
86 @@ -2427,7 +2434,12 @@
87 #endif
88 }
89 break;
90 -
91 +#ifdef FAKE_ROOT
92 + case LeaveNotify:
93 + if (Options&Opt_fake_root)
94 + XUngrabKeyboard(Xdisplay,CurrentTime);
95 + else break;
96 +#endif
97 case FocusOut:
98 if (TermWin.focus) {
99 TermWin.focus = 0;
100 diff -Nru aterm-1.0.1.orig/src/main.c aterm-1.0.1/src/main.c
101 --- aterm-1.0.1.orig/src/main.c 2007-08-02 14:35:30.000000000 +0200
102 +++ aterm-1.0.1/src/main.c 2007-08-02 14:23:19.000000000 +0200
103 @@ -705,7 +705,14 @@
104 &attributes);
105
106 #else
107 - attr_mask |= CWColormap ;
108 +#ifdef FAKE_ROOT
109 + attributes.override_redirect = (Options&Opt_fake_root)?True:False;
110 + mwmhints.flags = 0;
111 +#else
112 + attributes.override_redirect = False;
113 +#endif
114 +
115 + attr_mask |= CWColormap | CWOverrideRedirect ;
116 TermWin.parent = XCreateWindow(Xdisplay, Xroot,
117 szHint.x, szHint.y,
118 szHint.width, szHint.height,
119 @@ -745,8 +752,17 @@
120 }
121
122
123 -/* vt cursor: Black-on-White is standard, but this is more popular */
124 - TermWin_cursor = XCreateFontCursor(Xdisplay, XC_xterm);
125 +/* vt cursor: Black-on-White is standard, but this is more popular,
126 + so let's do the opposite unless we found ourselves in the FAKE_ROOT case
127 +*/
128 + TermWin_cursor = XCreateFontCursor(Xdisplay,
129 +#ifndef FAKE_ROOT
130 + XC_xterm
131 +#else
132 + (Options&Opt_fake_root)?
133 + XC_left_ptr:XC_xterm
134 +#endif
135 +);
136 {
137 XColor fg, bg;
138
139 @@ -754,6 +770,11 @@
140 XQueryColor(Xdisplay, Xcmap, &fg);
141 bg.pixel = PixColors[Color_bg];
142 XQueryColor(Xdisplay, Xcmap, &bg);
143 +#ifdef FAKE_ROOT
144 + if (Options&Opt_fake_root)
145 + XRecolorCursor(Xdisplay, TermWin_cursor, &bg, &fg);
146 + else
147 +#endif
148 XRecolorCursor(Xdisplay, TermWin_cursor, &fg, &bg);
149 }
150
151 @@ -763,7 +784,12 @@
152 ButtonPressMask |
153 ButtonReleaseMask |
154 Button1MotionMask |
155 - Button3MotionMask);
156 + Button3MotionMask
157 +#ifdef FAKE_ROOT
158 + | EnterWindowMask |
159 + LeaveWindowMask
160 +#endif
161 + );
162 attributes.cursor = TermWin_cursor ;
163 /* the vt window */
164 #ifdef HAVE_AFTERIMAGE
165 @@ -2361,6 +2387,11 @@
166 /* do it now to avoid unneccessary redrawing */
167 XMapWindow(Xdisplay, TermWin.vt);
168 XMapWindow(Xdisplay, TermWin.parent);
169 +#ifdef FAKE_ROOT
170 +/* put the window on the bottom of the stack if we are 'faking root' */
171 + if (Options&Opt_fake_root)
172 + XLowerWindow(Xdisplay, TermWin.parent);
173 +#endif
174
175 #if 0
176 #if defined(BACKGROUND_IMAGE) || defined(TRANSPARENT) || defined(_MYSTYLE_)
177 diff -Nru aterm-1.0.1.orig/src/rxvt.h aterm-1.0.1/src/rxvt.h
178 --- aterm-1.0.1.orig/src/rxvt.h 2007-08-02 14:35:31.000000000 +0200
179 +++ aterm-1.0.1/src/rxvt.h 2007-08-02 14:33:42.000000000 +0200
180 @@ -785,6 +785,7 @@
181 #define Opt_transparent (1LU<<13)
182 #define Opt_transparent_sb (1LU<<14)
183 #define Opt_borderLess (1LU<<16)
184 +#define Opt_fake_root (1LU<<17)
185
186 /* place holder used for parsing command-line options */
187 #define Opt_Reverse (1LU<<30)
188 diff -Nru aterm-1.0.1.orig/src/xdefaults.c aterm-1.0.1/src/xdefaults.c
189 --- aterm-1.0.1.orig/src/xdefaults.c 2007-08-02 14:35:30.000000000 +0200
190 +++ aterm-1.0.1/src/xdefaults.c 2007-08-02 14:23:19.000000000 +0200
191 @@ -80,6 +80,9 @@
192 #ifdef GREEK_SUPPORT
193 static const char *rs_greek_keyboard = NULL;
194 #endif
195 +#ifdef FAKE_ROOT
196 +static const char *rs_fake_root = NULL;
197 +#endif
198 /*}}} */
199
200 /*{{{ monolithic option/resource structure: */
201 @@ -316,6 +319,10 @@
202 "scroll-on-tty-output inhibit"),
203 BOOL(rs_scrollKeypress, "scrollKey", "sk",
204 Opt_scrollKeypress, "scroll-on-keypress"),
205 +#ifdef FAKE_ROOT
206 + BOOL(rs_fake_root, "fakeRoot", "fr", Opt_fake_root,
207 + "fake root window embedding"),
208 +#endif
209 STRG(rs_minBufferWidth, "minBufferWidth", "mbw", "number",
210 "minimum number of columns stored in buffer"),
211 STRG(rs_saveLines, "saveLines", "sl", "number",
|