Re: FVWM: PipeRead and mouse grab

From: Dominik Vogt <fvwm_at_fvwm.org>
Date: Tue, 20 Aug 2002 17:03:23 +0200

On Tue, Aug 20, 2002 at 03:40:15PM +0100, John Latham wrote:
> > From: Dominik Vogt <dominik.vogt_at_gmx.de>
> > Date: Tue, 13 Aug 2002 00:57:34 +0200
>
> > On Mon, Aug 12, 2002 at 06:35:09PM +0100, John Latham wrote:
> > > I have a function that used to work under 2.2, but does not under 2.4.8 nor
> > > 2.5.2. It is part of a window print capture form:
> > >
> > > *CaptureButton continue "Capture" ^M
> > > *CaptureCommand CaptureCommand "$(file)" "$(Options)"
> > >
> > > AddToFunc CaptureCommand
> > > + "I" Current [Capture] Iconify
> > > + "I" PipeRead "exec xwd -out \"$0\" $1"
> > > + "I" Prev [Capture] Iconify
> > >
> > > A message from xwd complains that it cannot grab the mouse. It works fine if I
> > > use an Exec instead of PipeRead, except for the obvious timing: I want the
> > > Capture form to disappear while I grab the window image.
> > >
> > > If there is a good reason for PipeRead being less liberal with X resources
> > > than Exec is,
>
> > That's necessary to display the watch cursor while a function
> > executes. Unfortunately we missed the implications about starting
> > applications that need to grab the mouse and forgot to mention it
> > in big bold letters in the NEWS and man page.
>
> Ah -- of course, I should have guessed.
>
> > > would it be feasible to offer a version of Exec that does not
> > > start a separate thread / process? Or, to offer a WaitExec
> > > command that waits for the most recently started Exec?
>
> > You mean "starts the process syncronously". This has been
> > discussed a few times. The solution is PipeRead again.
>
> Yes, I agree again, now that I understand the problem is merely about the
> cursor, because it would happen during a ``WaitExec'' anyway.
>
> > Try this:
> >
> > AddToFunc CaptureCommand
> > + I BusyCursor read off
> > + I Current (Capture) Iconify
> > + I PipeRead "exec xwd -out \"$0\" $1"
> > + I Prev (Capture) Iconify
> > + I BusyCursor read on
>
> I have tried this but it does not work. :-( I had not switched on BusyCursor
> for read anyway -- off by default -- so no surprise.

No, it's on by default.

> I guess the read /
> PipeRead code currently grabs the mouse even if BusyCursor read is off. I
> shall continue to anticipate a fix in time for 2.6, and use Exec instead for
> this function, for FVWM 2.4 and 2.5 in AnotherLevelUp. ;-)

Yes, that's because it's running in a complex function. Make it a
single command and it works:

  PipeRead "echo 'BusyCursor read off'; echo 'Current (Capture) Iconify'; echo xwd -out out.xwd; echo 'Prev (Capture) Iconify'; echo 'BusyCursor read on'"

Bye

Dominik ^_^ ^_^

 --
Dominik Vogt, mail: dominik.vogt_at_schlund.de, phone: 0721/91374-382
Schlund + Partner AG, Erbprinzenstr. 4-12, D-76133 Karlsruhe
--
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 majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Tue Aug 20 2002 - 10:05:04 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:53 BST