Subject: FVWM: Focus for FvwmPager

From: Rafal Bisingier <[email-masked]>
Date: Wed, 29 Sep 2004 12:54:36 +0200

Hi everyone,

Am I missing something or there is no possibility to focus FvwmPager?
The only workaround I found is to swallow FvwmPager into FvwmButtons.
Am I right?

I need it for my panel raising functions on edge hitting.
Here is a (lengthy) sample:

EdgeCommand Top ShowTopPanel
EdgeLeaveCommand Top FocusTopPanel
Module FvwmAuto 100 "Silent TopPanelFunction" "Silent TopPanelLowerFunction"
		
DestroyFunc TopPanelFunction
AddToFunc TopPanelFunction
+ I All (Layer 6, !Focused, ApplicationPanel) Lower
+ I All (Layer 6, !Focused, FvwmPager) Lower
+ I All (Layer 6, !Focused, ApplicationPanel) Layer 0 0
+ I All (Layer 6, !Focused, FvwmPager) Layer 0 0
+ I Current (Layer 0, ApplicationPanel) Raise
+ I Current (Layer 0, FvwmPager) Raise
+ I Current (Layer 0, ApplicationPanel) Layer 0 6
+ I Current (Layer 0, FvwmPager) Layer 0 6

DestroyFunc TopPanelLowerFunction
AddToFunc TopPanelLowerFunction
+ I All (Layer 6, !Focused, ApplicationPanel) Lower
+ I All (Layer 6, !Focused, FvwmPager) Lower
+ I All (Layer 6, !Focused, ApplicationPanel) Layer 0 0
+ I All (Layer 6, !Focused, FvwmPager) Layer 0 0

DestroyFunc ShowTopPanel
AddToFunc ShowTopPanel
+ I All (ApplicationPanel) Raise
+ I All (ApplicationPanel) Layer 0 6
+ I All (FvwmPager) Raise
+ I All (FvwmPager) Layer 0 6

DestroyFunc HideTopPanel
AddToFunc HideTopPanel
+ I All (ApplicationPanel) Lower
+ I All (ApplicationPanel) Layer 0 0
+ I All (FvwmPager) Lower
+ I All (FvwmPager) Layer 0 0

DestroyFunc ShowAndFocusPanel
AddToFunc ShowAndFocusPanel
+ I All ($0) Layer 0 6
+ I All ($0) Raise
+ I All ($0) Focus
+ I All (Layer 6, !Focused, ApplicationPanel) Lower
+ I All (Layer 6, !Focused, FvwmPager) Lower
+ I All (Layer 6, !Focused, ApplicationPanel) Layer 0 0
+ I All (Layer 6, !Focused, FvwmPager) Layer 0 0

DestroyFunc SetPanelCoordinants
AddToFunc SetPanelCoordinants
+ I PipeRead 'echo SetEnv $0Left $1'
+ I PipeRead 'echo SetEnv $0Right $(( $1 + $2 ))'

DestroyFunc FocusTopPanel
AddToFunc FocusTopPanel
+ I Next (ApplicationPanel) SetPanelCoordinants Apps $[w.x] $[w.width]
+ I Next (FvwmPager) SetPanelCoordinants Pager $[w.x] $[w.width]
+ I PipeRead ` if (( ( $[pointer.x] > $[AppsLeft] ) && \
		( $[pointer.x] < $[AppsRight] ) )); \
	then echo ShowAndFocusPanel ApplicationPanel; \
	elif (( ( $[pointer.x] > $[PagerLeft] ) && \
		( $[pointer.x] < $[PagerRight] ) )); \
	then echo ShowAndFocusPanel FvwmPager; \
	else echo HideTopPanel; fi `

This works exactly as I want with ApplicationPanel (FvwmButtons panel)
but not with FvwmPager, because it cannot be focused.

As you can see on top of this way-too-long exapmle I use here my update
for fvwm adding EdgeLeaveCommand, working exactly like EdgeCommand, but
is activated by LeaveEvent

But back to the point: do I have to swallow FvwmPager into FvwmButtons,
or there's some simpler way to do what I want?

PS. If any one interested: patch adding EdgeLeaveCommand was send
sometime ago to fvwm-workers list, and I still have it in my private
repository. ;-)

-- 
Rafal Bisingier
--
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: Dominik Vogt <[email-masked]>
Date: Wed, 29 Sep 2004 19:41:40 +0200

> The only workaround I found is to swallow FvwmPager into FvwmButtons.

No.

[snip]

> or there's some simpler way to do what I want?

FvwmPager does not want the focus and says so (verify with
FvwmIdent).  To ignore that wish, use

  Style FvwmPager Lenient

> sometime ago to fvwm-workers list, and I still have it in my private

I'll get around eximining that patch sooner or later.  Unless
there are no major issues with it, I will commit it.

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]

---

From: Rafal Bisingier <[email-masked]>
Date: Thu, 30 Sep 2004 11:05:53 +0200

> FvwmIdent).  To ignore that wish, use

Thank you very much. I haven't thought about it ;-)
Many times when I was reading manpage I wondered when this Lenient style
could be useful. Now I know. ;-)

> there are no major issues with it, I will commit it.

Thanks one more time. This patch is just a rewrite of EdgeCommand, so
should be OK, but I can't guarantee that ;-) Anyway the only lines I
added by myself are variables definitions, every other thing IIRC was
copy-pasted and a little changed, to react on LeaveEvent.
I use fvwm patched with it for about a month and it works good.

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 30 Sep 2004 15:05:05 +0200

> could be useful. Now I know. ;-)

Me too. I have rewritten the man page section to tell the user
something useful.

Ciao

Dominik ^_^  ^_^