Subject: FVWM: FvwmButtons: Action(mouse 1)

From: Jens-U H Petersen <[email-masked]>
Date: Mon, 13 May 96 15:30:39 JST

(Thanks for the new Buttons, Jarl!  It's great.)

Does anyone have a working example of a (mouse) action binding in
a swallowed button: I have the following in ".fvwm2rc"

---- Start of included text -----------------------8<--- cut here -------------
*FvwmButtons(Swallow(UseOld) "xload1" "Exec xload -font 6x10
-background PeachPuff2 -title xload1 -hl yellow -update 5 -scale
2 -geometry -1500-1500 &", Action 'Exec "top@clove" xterm -title
top@clove -e top') 
---- End of included text -------------------------8<--- and here -------------

But the only way that I can run "top" is by pressing the return
key on the button (clicking with the mouse does nothing).

If instead I put

---- Start of included text -----------------------8<--- cut here -------------
*FvwmButtons(Swallow(UseOld) "xload1" "Exec xload -font 6x10
-background PeachPuff2 -title xload1 -hl yellow -update 5 -scale
2 -geometry -1500-1500 &", Action(Mouse 1) 'Exec "top@clove"
xterm -title top@clove -e top') 
---- End of included text -------------------------8<--- and here -------------

Again nothing happens with mouse clicks, but FvwmButtons crashes
with some X error when return is pressed.

Also I don't understand why the examples of UseOld in the manual
all combine it with NoKill, when "NoKill" is the default anyway,
isn't it?  Even with UseOld, is I restart fvwm2 a couple of
times, it seems to miss xload's, swisswatch regularly :-(

Jens
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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: [email-masked] (Albrecht Kadlec)
Date: Mon, 13 May 96 19:50:35 +0200

>>>>> Jens-U H Petersen writes:

J> (Thanks for the new Buttons, Jarl!  It's great.)
I can't just add anything to that. (needed some time to find out HOW
powerful it is)

J> Does anyone have a working example of a (mouse) action binding in
J> a swallowed button: I have the following in ".fvwm2rc"

J> ---- Start of included text -----------------------8<--- cut here -------------
J> *FvwmButtons(Swallow(UseOld) "xload1" "Exec xload -font 6x10
J> -background PeachPuff2 -title xload1 -hl yellow -update 5 -scale
J> 2 -geometry -1500-1500 &", Action 'Exec "top@clove" xterm -title
J> top@clove -e top') 
J> ---- End of included text -------------------------8<--- and here -------------
As I see it, your problem is, that once an application is swallowed, 
X events are handed to it unfiltered (since it could depend on them -
imagine a swallowed pager, which can't receive any mouse event)

The only example I saw, where an action AND a swallow command was
specified, was Jarls example in the man page.
But that's a swallow with a NOP. (capture existing window, or wait 
till a window with that name appears.)
So if no window of that name exists/appears, the "button" is a real 
button, which executes the associated action. 
If the action starts a window with the long-awaited name, the button 
gets REPLACED by the swallowed application, so no more invocations of 
the application are possible.

So I don't think it is possible, what you want to do, unless someone 
modifies FvwmButtons to intercept events for swallowed applications.

That the return does trigger the action... hmm.
Might be that this is because xload sets the Mwmhints input to false 
("I never ever want the keyboard focus." - note: I'm not an X programmer,
I've just been following the discussion here for a long time.)

I just checked: 
	I can reproduce the xload behaviour.
	The action doesn't work, if put on a swallowed perfmeter.
		(this does react to keystrokes.)
	xbiff also refuses keystrokes, and the action works.

Seem like I guessed right with the motif input hint.

Is there any similar hint for mouse input? (some sort of SkipFocus flag?)
Can we simulate that, or can we just filter the Event stream to the
application without any hint.

J> But the only way that I can run "top" is by pressing the return
J> key on the button (clicking with the mouse does nothing).

J> If instead I put

J> ---- Start of included text -----------------------8<--- cut here -------------
J> *FvwmButtons(Swallow(UseOld) "xload1" "Exec xload -font 6x10
J> -background PeachPuff2 -title xload1 -hl yellow -update 5 -scale
J> 2 -geometry -1500-1500 &", Action(Mouse 1) 'Exec "top@clove"
J> xterm -title top@clove -e top') 
J> ---- End of included text -------------------------8<--- and here -------------

J> Again nothing happens with mouse clicks, but FvwmButtons crashes
J> with some X error when return is pressed.

I got this one:

X Error (intercepted): BadDrawable (invalid Pixmap or Window parameter)
Major Request Code   : 62
Minor Request Code   : 0
Resource ID (XID)    : 31457301
Error Serial Number  : 706

Don't know why the generic mouse action does work, and the mouse n doesn't.

J> Also I don't understand why the examples of UseOld in the manual
J> all combine it with NoKill, when "NoKill" is the default anyway,
J> isn't it?  Even with UseOld, is I restart fvwm2 a couple of
J> times, it seems to miss xload's, swisswatch regularly :-(

I think Jarl meant NoClose to be used in conjunction with UseOld, in order
to swallow old apps/unswallow them on exit.

But this only works, when I do a "killmodule FvwmButtons" from FvwmTalk.
If I restart Fvwm2, new xbiff/xclock/console/perfmeter are created, while
the old processes are still alive, though they're NOT mapped anywhere.

(And I deleted the -geometry -1500-1500 as well as I set WindowListHit,
ShowMapping, Icon and Title styles.)

hope this triggers some more thoughts.
albrecht

PS: It's rather quiet on the list: just 14 messages since Friday.
    Or is sth. rotten down here ?
-- 
You can't brush me under the carpet, you can't hide me under the stairs.
The custodian of your private fears, your leading actor of yesteryear,
								-- Marillion
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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: Dave Goldberg <[email-masked]>
Date: Mon, 13 May 1996 16:58:08 -0400

> Does anyone have a working example of a (mouse) action binding in a
> swallowed button: I have the following in ".fvwm2rc"

Unfortunately, I think it can't be done in the obvious (and most
desireable) way because it would be hard to distinguish when the mouse
click is supposed to do a FvwmButtons action and when it should be
passed to the swallowed app.  For example, two of the things I have
FvwmButtons swallow, xbuffy and FvwmPager, both require that mouse
clicks be passed to them or they won't operate properly, and if I
click in the xbuffy to view the headers in a mailbox, which I often do
to see if the mail is important, then I wouldn't want any other
assigned FvwmButton action to happen.

What can work, though not quite as visually pleasing as I suspect
you'd like, is to put the swallowing button inside a container and
assign the action to the container.  If you set the padding to
something >0 in the container, clicking in the pad area will perform
your defined click action.  I didn't have any real use for it, but I
tried the following for grins and when I clicked in the padding to the
left of the xbuffy and the right of the pager, sure enough an xterm
was launched:

*FvwmButtons(26x1, Frame 0, Padding 4 0, \
	Action `Exec "XTerm" xcmd xterm`, \
	Container(Frame 1, Padding 0 0 Rows 1))
*FvwmButtons(Swallow(Kill) XBuffy "Exec xcmd xbuffy")
*FvwmButtons(Swallow(Kill) FvwmPager "Module FvwmPager 0 3")
*FvwmButtons(End)

Hope this helps,

Dave Goldberg
Post: The Mitre Corporation\MS B305\202 Burlington Rd.\Bedford, MA 01730
Phone: 617-271-3887
Email: [email-masked]

---

From: [email-masked] (Albrecht Kadlec)
Date: Tue, 14 May 96 12:32:34 +0200

>>>>> Dave Goldberg writes:

> swallowed button: I have the following in ".fvwm2rc"

D> Unfortunately, I think it can't be done in the obvious (and most
D> desireable) way because it would be hard to distinguish when the mouse
D> click is supposed to do a FvwmButtons action and when it should be
D> passed to the swallowed app.  For example, two of the things I have
D> FvwmButtons swallow, xbuffy and FvwmPager, both require that mouse
D> clicks be passed to them or they won't operate properly, and if I
D> click in the xbuffy to view the headers in a mailbox, which I often do
D> to see if the mail is important, then I wouldn't want any other
D> assigned FvwmButton action to happen.

well all mouse events that don't have any action defined for it, are passed
through. 
It's like the mouse settings, or character bindings under X.
I had to unmap several Meta-anything sequences from mwm, when I wanted to
run emacs under it. (quite some time ago, but it was quite a search then.)

If the user defines a mouse-1 click, for a swallowed Xbuffy, he can't
expect to see the headers any more.

I think this use would be mostly for X apps, that don't need mouse events.

(Note that apps that don't need Keyboard focus, can be used with an action,
but this has to be defined as just "Action cmd" i.e: no mouse button
argument specified. You can invoke this action by pointing the mouse on the
swallowed application and then hitting return. I use this to open the door
at the insitute via the swallowed xload panel, and to start emacsclient
with ~/RMAIL from the swallowed xbiff)

regards,
albrecht
-- 
The chicks are getting cheaper on the not so common market
Stockpile experience before the blonde hairs turn to grey  -- Marillion
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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].