Subject: FVWM: lastX-a new contribution to X

From: [email-masked]
Date: Sat, 30 Dec 2000 08:35:16 -0500

<!--

l a s t X   provides X with a new feature:
The capability of recovering the last closed window
(in the event for instance it was closed by error).

At this time (200012) it is just a pre-project.

I ask for your orientation-help on two matters:

1- The very idea of a "window-undelete" option for a window
system may be the object of a patent, and I feel
the Xfree organization should be the owner of it.
This requires it to be proven a novelty, which I am not
completely sure about.
Surely you know the answer (if not you... who else?:-).

2- Although I have managed to implement lastX on fvwm2,
(to see how, copy this whole text to a file, call it lastx.htm
and open it with any internet browser),
development for other window managers will require coordination
with their respective development teams.

It would be nice, however, to keep some uniformity
among the implementations of lastX on different environments.

That's why I think discussion about lastX should be done
outside any of them, ideally hosted by the Xfree org. itself.

The message part ends here.

-->
<HTML>

<HEAD>
<META name="Author" content="Juanjo  Garcia Carré">
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<TITLE>lastX - fvwm2</TITLE></HEAD>

<BODY bgcolor="#fee6c2" text="#000000">
<BR>
<CENTER><FONT color="#0088fe"><H1>l a s t X</H1></FONT></CENTER>
<BR>
&nbsp Author: <B><FONT color="#59c6fe"><A href="mailto:[email-masked]"
>Juanjo</A></FONT></B>
<FONT color="#0000ff">Garc&iacute;a Carr&eacute;</FONT>
<BR><BR>
<B><FONT color="red">"Oh!, NO!. I have mistakingly closed the window
that costed me so many clicks to arrive at!".<BR></FONT>
Or: <FONT color="red">   
"Wish I could remember what result showed the calculator window!".
</FONT></B><BR>
<BR>
  <FONT color="#0000ff">lastX</FONT> is the utility for recovering
the contents of the last window closed,
hopefully even reactivating the corresponding process.
<BR><BR>
&nbsp It is -in this way- analogous to the "last x" key
found in some pocket calculators, notably Hewlett-Packard ones,
to restore numbers as they were before operating on them.
<BR><BR>
<BR><BR>
<FONT color="#0088fe"><H3>fvwm2</H3></FONT>
&nbsp Unlike other window managers (KDE, GNome...),
fvwm does not have any means to restore applications
(for instance when the current X session is saved),
neither has ever had the aim to do it.
<BR><BR>
&nbsp It can be, however, configured to save the image of the window
just prior to its closing, so it can still be viewed after the process has 
died.
<BR><BR>
&nbsp A detailed description follows of how to do this in fvwm2:
<BR><BR>
<LI>&nbsp 0- Make sure you have fvwm2 installed, as well as the executables
xwd, xwud.
<BR><BR>
<Li>&nbsp 1- First step is to find the configuration file to edit:
<BR><BR>
<CENTER>locate .fvwm2rc</CENTER>
<BR><BR>
&nbsp If no result, then run:
<BR><BR>
&nbsp <CENTER>updatedb &</CENTER>
<BR><BR>
&nbsp and re-run the locate command.<BR>
&nbsp If many, then choose to edit the most precedental file.<BR>
&nbsp The order of precedence is:
<BR><BR>
<CENTER>$HOME/.fvwm2rc > /etc/X11/fvwm2/.fvwm2rc > 
/etc/X11/fvwm2/system.fvwm2rc
> /etc/X11/fvwm2/example.fvwm2rc </CENTER>
<BR><BR>
<Li>&nbsp 2- Once opened the rc file with a normal text editor, search for
a line like this:
<BR><BR>
&nbsp Mouse 1 2      A      Close<B
R>
<BR>
&nbsp and change it to:
<BR><BR>
&nbsp Mouse 1 2      A      Close-a
nd-Dump<BR>
<BR><BR>
<Li>&nbsp 3- Similarly, search for all (if any) the lines:
<BR><BR>
&nbsp +       "&Close"       Close<
BR>
<BR>
&nbsp and modify them so:
<BR><BR>
&nbsp +       "&Close"       Close-
and-Dump<BR>
<BR><BR>
<Li>&nbsp 4- What has been done is simply to refer to a function "Close-and
-Dump" what was before
related to the window operation Close.
<BR><BR>
&nbsp Now the function "Close-and-Dump" must be defined:
<BR><BR>
&nbsp Searching for the strings "Sample Functions" or "AddToFunc" leads
to the zone of the rc file
where many of this kind of functions are defined.
<BR><BR>
&nbsp Append there the following group of lines:
<BR><BR>
&nbsp AddToFunc Close-and-Dump "I" Raise<BR>
&nbsp + "I" Exec xwd -silent -id $w -out $HOME/.lastx.xwd<BR>
&nbsp + "C" Close<BR>
<BR><BR>
<Li>&nbsp 5- Search for the word "ClickTime", usually at the beginning of t
he file,
or -if unfound- create the line:
<BR><BR>
&nbsp ClickTime 300<BR>
<BR><BR>
&nbsp The value can be other than 300, depending on the processor speed.
Try values just big enough to allow the capture of large windows
in the moment of closing, but not so big as to cause strange overall window 
beha
vior.
<BR><BR>
<Li>&nbsp 6- Create this new menu line under "AddToMenu RootMenu":
<BR><BR>
&nbsp + "last X closed" Exec exec xwud -in $HOME/.lastx.xwd<BR>
<BR><BR>
<Li>&nbsp 7- Launch fvwm2: <BR>
Every time a window is closed, an image of it
will be written in the hidden file .lastx.xwd of the user's home directory,
overwriting the previous one.<BR>
<BR>
  This image can be retreived simply by selecting the lastX item
on the window manager's main menu.<BR>
<BR>
  If no "last X closed" item appears in the menu when Left-clicking
the screen, then probably the edited file had not the most precedence
among all fvwm2rc files.<BR><BR>
<BR><BR>
&nbsp 
<BR><BR>
&nbsp 
<BR><BR>
&nbsp 
<BR><BR>
</BODY>
</HTML>
__________________________________________________________________
Get your own FREE, personal Netscape Webmail account today at 
http://webmail.netscape.com/
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 30 Dec 2000 20:47:10 -0600

On 30 Dec 2000 08:35:16 -0500, [email-masked] wrote:
> 
>  AddToFunc Close-and-Dump "I" Raise
>  + "I" Exec xwd -silent -id $w -out $HOME/.lastx.xwd
>  + "C" Close
> 
>  ClickTime 300

It will work with any ClickTime and not only on "C" if you use synchronous
PipeRead instead of asynchronous Exec:

  + I PipeRead `xwd -silent -id $w -out $HOME/.lastx.xwd >/dev/null`

Regards,
Mikhael.