1 diff -Nru aterm-1.0.0.orig/README.configure aterm-1.0.0/README.configure
2 --- aterm-1.0.0.orig/README.configure 2005-07-11 20:48:22.000000000 +0200
3 +++ aterm-1.0.0/README.configure 2005-07-11 20:48:41.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.0.orig/autoconf/configure.in aterm-1.0.0/autoconf/configure.in
16 --- aterm-1.0.0.orig/autoconf/configure.in 2005-07-11 20:48:22.000000000 +0200
17 +++ aterm-1.0.0/autoconf/configure.in 2005-07-11 20:48:41.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 diff -Nru aterm-1.0.0.orig/doc/aterm.1 aterm-1.0.0/doc/aterm.1
29 --- aterm-1.0.0.orig/doc/aterm.1 2005-07-11 20:48:22.000000000 +0200
30 +++ aterm-1.0.0/doc/aterm.1 2005-07-11 20:48:41.000000000 +0200
31 @@ -230,6 +230,16 @@
32 .IP "\fB-st\fP|\fB+st\fP"
33 Display scrollbar without/with a trough;
34 resource \fBscrollBar_floating\fP\&.
35 +.IP "\fB-fr\fP|\fB+fr\fP"
36 +Turn on/off making the aterm's parent window an unmanaged one mapped
37 +at the bottom on the stack without cursor change. When turned on, also
38 +provide a 'point-to-focus' behavior model independently
39 +from the X Window Manager.\&
40 +
41 +This is useful combined with other options (\fB-tr\fP, \fB-bw\fP,
42 +\fB-geometry\fP, ...) to provide pseudo-terminals seamlessly integrated
43 +into the X desktop. Please note this will not work as expected with WMs
44 +masquerading the X root window with fake roots; resource \fBfakeRoot\fP\&.
45 .IP "\fB-iconic\fP"
46 Start iconified, if the window manager supports that option\&.
47 .IP "\fB-sl\fP \fInumber\fP"
48 diff -Nru aterm-1.0.0.orig/src/command.c aterm-1.0.0/src/command.c
49 --- aterm-1.0.0.orig/src/command.c 2005-07-11 20:48:22.000000000 +0200
50 +++ aterm-1.0.0/src/command.c 2005-07-11 20:48:41.000000000 +0200
51 @@ -2365,6 +2365,13 @@
52 }
53 break;
54
55 +#ifdef FAKE_ROOT
56 + case EnterNotify:
57 + if (Options&Opt_fake_root)
58 + XGrabKeyboard(Xdisplay,TermWin.parent,True,
59 + GrabModeAsync,GrabModeAsync,CurrentTime);
60 + else break;
61 +#endif
62 case FocusIn:
63 if (!TermWin.focus) {
64 TermWin.focus = 1;
65 @@ -2381,7 +2388,12 @@
66 #endif
67 }
68 break;
69 -
70 +#ifdef FAKE_ROOT
71 + case LeaveNotify:
72 + if (Options&Opt_fake_root)
73 + XUngrabKeyboard(Xdisplay,CurrentTime);
74 + else break;
75 +#endif
76 case FocusOut:
77 if (TermWin.focus) {
78 TermWin.focus = 0;
79 diff -Nru aterm-1.0.0.orig/src/main.c aterm-1.0.0/src/main.c
80 --- aterm-1.0.0.orig/src/main.c 2005-07-11 20:48:22.000000000 +0200
81 +++ aterm-1.0.0/src/main.c 2005-07-11 20:50:18.000000000 +0200
82 @@ -705,7 +705,14 @@
83 &attributes);
84
85 #else
86 - attr_mask |= CWColormap ;
87 +#ifdef FAKE_ROOT
88 + attributes.override_redirect = (Options&Opt_fake_root)?True:False;
89 + mwmhints.flags = 0;
90 +#else
91 + attributes.override_redirect = False;
92 +#endif
93 +
94 + attr_mask |= CWColormap | CWOverrideRedirect ;
95 TermWin.parent = XCreateWindow(Xdisplay, Xroot,
96 szHint.x, szHint.y,
97 szHint.width, szHint.height,
98 @@ -745,8 +752,17 @@
99 }
100
101
102 -/* vt cursor: Black-on-White is standard, but this is more popular */
103 - TermWin_cursor = XCreateFontCursor(Xdisplay, XC_xterm);
104 +/* vt cursor: Black-on-White is standard, but this is more popular,
105 + so let's do the opposite unless we found ourselves in the FAKE_ROOT case
106 +*/
107 + TermWin_cursor = XCreateFontCursor(Xdisplay,
108 +#ifndef FAKE_ROOT
109 + XC_xterm
110 +#else
111 + (Options&Opt_fake_root)?
112 + XC_left_ptr:XC_xterm
113 +#endif
114 +);
115 {
116 XColor fg, bg;
117
118 @@ -754,6 +770,11 @@
119 XQueryColor(Xdisplay, Xcmap, &fg);
120 bg.pixel = PixColors[Color_bg];
121 XQueryColor(Xdisplay, Xcmap, &bg);
122 +#ifdef FAKE_ROOT
123 + if (Options&Opt_fake_root)
124 + XRecolorCursor(Xdisplay, TermWin_cursor, &bg, &fg);
125 + else
126 +#endif
127 XRecolorCursor(Xdisplay, TermWin_cursor, &fg, &bg);
128 }
129
130 @@ -763,7 +784,12 @@
131 ButtonPressMask |
132 ButtonReleaseMask |
133 Button1MotionMask |
134 - Button3MotionMask);
135 + Button3MotionMask
136 +#ifdef FAKE_ROOT
137 + | EnterWindowMask |
138 + LeaveWindowMask
139 +#endif
140 + );
141 attributes.cursor = TermWin_cursor ;
142 /* the vt window */
143 #ifdef HAVE_AFTERIMAGE
144 @@ -1037,12 +1063,12 @@
145 XConfigureEvent *xconf = &(ev->xconfigure);
146
147 while( XCheckTypedWindowEvent( Xdisplay, TermWin.parent, ConfigureNotify, ev ) );
148 - fprintf( stderr, "config_geom = %dx%d\n", xconf->width, xconf->height );
149 +/* fprintf( stderr, "config_geom = %dx%d\n", xconf->width, xconf->height ); */
150 resize_window1(xconf->width, xconf->height);
151 #if 1
152 XTranslateCoordinates (Xdisplay, TermWin.parent, Xroot, 0, 0, &root_x, &root_y, &wdumm);
153
154 - fprintf( stderr, "root_geom = %dx%d%+d%+d, root_size = %dx%d\n", xconf->width, xconf->height, root_x, root_y, XdisplayWidth, XdisplayHeight );
155 +/* fprintf( stderr, "root_geom = %dx%d%+d%+d, root_size = %dx%d\n", xconf->width, xconf->height, root_x, root_y, XdisplayWidth, XdisplayHeight ); */
156 TermWin.root_x = root_x ;
157 TermWin.root_y = root_y ;
158 TermWin.root_width = xconf->width ;
159 @@ -2341,6 +2367,11 @@
160 /* do it now to avoid unneccessary redrawing */
161 XMapWindow(Xdisplay, TermWin.vt);
162 XMapWindow(Xdisplay, TermWin.parent);
163 +#ifdef FAKE_ROOT
164 +/* put the window on the bottom of the stack if we are 'faking root' */
165 + if (Options&Opt_fake_root)
166 + XLowerWindow(Xdisplay, TermWin.parent);
167 +#endif
168
169 #if 0
170 #if defined(BACKGROUND_IMAGE) || defined(TRANSPARENT) || defined(_MYSTYLE_)
171 diff -Nru aterm-1.0.0.orig/src/rxvt.h aterm-1.0.0/src/rxvt.h
172 --- aterm-1.0.0.orig/src/rxvt.h 2005-07-11 20:48:22.000000000 +0200
173 +++ aterm-1.0.0/src/rxvt.h 2005-07-11 20:48:41.000000000 +0200
174 @@ -779,6 +779,7 @@
175 #define Opt_transparent (1LU<<13)
176 #define Opt_transparent_sb (1LU<<14)
177 #define Opt_borderLess (1LU<<16)
178 +#define Opt_fake_root (1LU<<17)
179
180 /* place holder used for parsing command-line options */
181 #define Opt_Reverse (1LU<<30)
182 diff -Nru aterm-1.0.0.orig/src/xdefaults.c aterm-1.0.0/src/xdefaults.c
183 --- aterm-1.0.0.orig/src/xdefaults.c 2005-07-11 20:48:22.000000000 +0200
184 +++ aterm-1.0.0/src/xdefaults.c 2005-07-11 20:48:41.000000000 +0200
185 @@ -80,6 +80,9 @@
186 #ifdef GREEK_SUPPORT
187 static const char *rs_greek_keyboard = NULL;
188 #endif
189 +#ifdef FAKE_ROOT
190 +static const char *rs_fake_root = NULL;
191 +#endif
192 /*}}} */
193
194 /*{{{ monolithic option/resource structure: */
195 @@ -311,6 +314,10 @@
196 "scroll-on-tty-output inhibit"),
197 BOOL(rs_scrollKeypress, "scrollKey", "sk",
198 Opt_scrollKeypress, "scroll-on-keypress"),
199 +#ifdef FAKE_ROOT
200 + BOOL(rs_fake_root, "fakeRoot", "fr", Opt_fake_root,
201 + "fake root window embedding"),
202 +#endif
203 STRG(rs_minBufferWidth, "minBufferWidth", "mbw", "number",
204 "minimum number of columns stored in buffer"),
205 STRG(rs_saveLines, "saveLines", "sl", "number",
|