LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 689|回复: 6

[求助]FVWM设置窗口自动隐藏的问题

[复制链接]
发表于 2005-9-5 13:45:00 | 显示全部楼层 |阅读模式
参照FVWM FAQ做如下设置
[PHP]
     AddToFunc autohide
     + I ThisWindow ($0) Deschedule $[w.id]
     + I TestRc (!Match) Deschedule -$[w.id]
     + I ThisWindow ($0) KeepRc ThisWindow (shaded) \
         autohide_show $1 $3
     + I TestRc (!Match) All ($0, !shaded) autohide_hide $2 $3

     AddToFunc autohide_show
     + I Schedule $0 -$[w.id] WindowShade $1 off
     + I Schedule $0 -$[w.id] Deschedule $[w.id]
     + I Schedule $0 -$[w.id] Deschedule -$[w.id]

     AddToFunc autohide_hide
     + I Schedule $0 $[w.id] WindowShade $1 on
     + I Schedule $0 $[w.id] Deschedule $[w.id]
     + I Schedule $0 $[w.id] Deschedule -$[w.id]

     AddToFunc StartFunction
     + I Module FvwmAuto FvwmAutohide -menter enter_handler

     AddToFunc enter_handler
     + I autohide FvwmButtons 250 500 S
[/PHP]

当在 AddToFunc enter_handler下加多个项时只有最后一个能正常使用
如设置:
[PHP]
     AddToFunc enter_handler
     + I autohide FvwmButtons 250 500 S
     + I autohide FvwmPager    250 500 S
[/PHP]
只有FvwmPager能正常隐藏和自动显示
FvwmButtons只能隐藏,鼠标放在上面时不能自动显示

有没有人知道是什么原因?难不成只能指定一个程序
 楼主| 发表于 2005-9-5 14:06:05 | 显示全部楼层

[PHP]
AddToFunc enter_handler
     + I autohide FvwmButtons 250 500 S
     + I autohide FvwmPager    250 500 S
[/PHP]
换成
[PHP]
AddToFunc enter_handler
     + I autohide FvwmPager    250 500 S
     + I autohide FvwmButtons 250 500 S
[/PHP]
之后FvwmButtons好用,FvwmPager就不能正常显示了。
回复 支持 反对

使用道具 举报

发表于 2005-9-5 15:20:42 | 显示全部楼层
测试了一下,这样就可以啊

  1. AddtoFunc autohide
  2. + I ThisWindow ($0) Deschedule $[w.id]
  3. + I ThisWindow ($0) KeepRc ThisWindow (shaded) WindowShade off
  4. + I TestRc (!Match) All ($0, !shaded) autohide_hide $1 $2

  5. AddtoFunc autohide_hide
  6. + I Schedule $0 $[w.id] WindowShade $1
  7. + I Schedule $0 $[w.id] Deschedule $[w.id]

  8. AddToFunc enter_handler
  9. + I autohide fbpanel 100 N
  10. + I autohide gaim 100 N
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-9-5 17:17:51 | 显示全部楼层
多谢了,回去再看看吧
主要是我想用第二种方法,不希望有些窗口立即出现
回复 支持 反对

使用道具 举报

发表于 2005-12-11 09:42:35 | 显示全部楼层
谢谢Yei,你的问题也正是我遇到的问题

谢谢conwood,你的方法可行  但你的代码里面好象有笔误
  1. #+ I TestRc (!Match) All ($0, !shaded) autohide_hide $1 $2
  2. + I TestRc (!Match) All ($0, !shaded) autohide_hide $2 $3
复制代码


在yei给出的代码中直接注释第三行也可以:

  1. AddToFunc autohide
  2. + I ThisWindow ($0) Deschedule $[w.id]
  3. #+ I TestRc (!Match) Deschedule -$[w.id]
  4. + I ThisWindow ($0) KeepRc ThisWindow (shaded)
  5.          autohide_show $1 $3
  6. + I TestRc (!Match) All ($0, !shaded) autohide_hide $2 $3
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-12-12 17:35:03 | 显示全部楼层
conwood的代码没错,我的那个方法多一个参数,用来指定窗口显示的延迟时间。仔细看看这里就知道了

  1. 7.17  Autohiding FvwmButtons or other windows.

  2.    Some applications have a feature usually called "autohiding"
  3.    which allows to withdraw a window to a location where it does
  4.    not use precious desktop space.  It is possible to write some
  5.    small functions in fvwm that can hide any window you like:

  6.    fvwm-2.5.11 or later:

  7.      # The autohiding functions
  8.      AddToFunc autohide
  9.      + I ThisWindow ($0) Deschedule $[w.id]
  10.      + I ThisWindow ($0) KeepRc ThisWindow (shaded) WindowShade off
  11.      + I TestRc (!Match) All ($0, !shaded) autohide_hide $1 $2

  12.      AddToFunc autohide_hide
  13.      + I Schedule $0 $[w.id] WindowShade $1
  14.      + I Schedule $0 $[w.id] Deschedule $[w.id]

  15.      # Start FvwmAuto
  16.      AddToFunc StartFunction
  17.      + I Module FvwmAuto FvwmAutohide -menter enter_handler

  18.      # Add the windows you want to autohide
  19.      AddToFunc enter_handler
  20.      + I autohide FvwmButtons 500 S
  21.      #            ^           ^   ^
  22.      #            |           |   |___  Shade direction (optional)
  23.      #            |           |_______  Hide delay (milliseconds)
  24.      #            |___________________  Unique window name/resource

  25.    Simply add any windows you like to the enter_handler function
  26.    as in the example above.  The autohide function is called with
  27.    two or three parameters.  The first one is the window's name or
  28.    class, which must be unique.  The second is the delay in
  29.    milliseconds before the window is hidden after the pointer
  30.    leaves it, and the last - optional - one indicates the
  31.    direction in which it is hidden (N, S, E, W, NW, NE, SW or SE).

  32.    You can find a slightly more complicated version below.  The
  33.    difference is that showing the window does not happen
  34.    immediately, but can be delayed too.

  35.    fvwm-2.5.11 or later:

  36.      AddToFunc autohide
  37.      + I ThisWindow ($0) Deschedule $[w.id]
  38.      + I TestRc (!Match) Deschedule -$[w.id]
  39.      + I ThisWindow ($0) KeepRc ThisWindow (shaded) \
  40.          autohide_show $1 $3
  41.      + I TestRc (!Match) All ($0, !shaded) autohide_hide $2 $3

  42.      AddToFunc autohide_show
  43.      + I Schedule $0 -$[w.id] WindowShade $1 off
  44.      + I Schedule $0 -$[w.id] Deschedule $[w.id]
  45.      + I Schedule $0 -$[w.id] Deschedule -$[w.id]

  46.      AddToFunc autohide_hide
  47.      + I Schedule $0 $[w.id] WindowShade $1 on
  48.      + I Schedule $0 $[w.id] Deschedule $[w.id]
  49.      + I Schedule $0 $[w.id] Deschedule -$[w.id]

  50.      AddToFunc StartFunction
  51.      + I Module FvwmAuto FvwmAutohide -menter enter_handler

  52.      AddToFunc enter_handler
  53.      + I autohide FvwmButtons 250 500 S
  54.      #            ^           ^   ^   ^
  55.      #            |           |   |   |__  Shade direction (optional)
  56.      #            |           |   |______  Hide delay
  57.      #            |           |__________  Show delay
  58.      #            |______________________  Unique window name/resource

  59.    These functions work too in 2.5.8 to 2.5.10, but you may have
  60.    to remove the KeepRc command from the autohide function in both
  61.    versions.
复制代码
回复 支持 反对

使用道具 举报

发表于 2005-12-13 08:45:29 | 显示全部楼层
我……以前回过这个帖子吗,完全没印象了  -______________-
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表