FvwmButton Shading and transparency

Hi folks,
I’m trying to do some Quake Console using FvwmButtons.
Here’s the relevant code :

[code]Style “QuakeConsole” NoTitle, !Handles, !Borders, Sticky, WindowListSkip,
CirculateSkip, FixedPosition FixedSize, !Iconifiable, ParentalRelativity, WindowShadeSteps 100

DestroyModuleConfig QuakeConsole: *
*QuakeConsole: Geometry 1280x400+0+0@1
*QuakeConsole: Colorset 13
*QuakeConsole: Font “xft:Bitstream Vera Sans Mono:Bold:style=Roman:size=8”
*QuakeConsole: BoxSize Fixed
*QuakeConsole: Columns 1280
*QuakeConsole: Rows 400
*QuakeConsole: Frame 0

On récupère un terminal

*QuakeConsole: (1260x380+10+0, Swallow (UseOld,NoClose,Respawn) “QuakeC” ‘Exec urxvtc -name QuakeC -tr -tint white -sh 60 -bl +sb -bc -geometry -3000-3000’ )

Le titre de la console

*QuakeConsole: (1280x20-0-0, Padding 25 0,Frame 0, Title (Center) ‘-=[ Console ~ $[USER] ]=-’, ActiveTitle “-=[ >> Shade << ]=-”, PressTitle “-=[ !! Shading !! ]=-”, Colorset 11, ActiveColorset 11,Action(Mouse 1) ShadePanel QuakeConsole 500 N)

The binding

Key Escape A C ShadePanel QuakeConsole 500 N

Shading function

$0: Name

$1: milliseconds delay

$2: Orientation (N E S W)

DestroyFunc ShadePanel
AddtoFunc ShadePanel

  • I All ($0) Schedule $1 WindowShade $2

Colorset 13 RootTransparent,fg rgb:00/00/00, bg average,
Tint yellow 0, bgTint white 0
Colorset 11 RootTransparent,fg #FF9C01
This is working great under the same desk, but if I switch to a different desk with a different wallpaper (or even change wallpaper on the same desk) while the FvwmButton is shaded, when I unshade it, the FvwmButton becomes a
1280x400 transparent rectangle with nothing in it.

I have tried :

  • non transparent colorset
  • Transparent / RootTransparent / RootTransparent buffer option in colorsets
  • non transparent urxvt
  • other terms
  • WindowShadeLazy, WindowShadeAlwaysLazy and WindowShadeBusy style

(ugly) workaround : unshade the console then (re)change desk or reset the background

Any ideas, options, style I missed ? Thx for reply

Without looking at the source, it’s entirely likely that the window isn’t redrawing itself on the Expose event. Given that a change of desks involves the window to be remapped, you could try something like this:

DestroyModuleConfig: FE-grr:*
*FE-grr: new_desk "Next (mybuttonsname, CurrentDesk) RefreshWindow"

Module FvwmEvent FE-grr

This will cause it to flicker.

– Thomas Adam

Thx for reply thomasadam, I’ve tried your function without luck, here is the config : http://arnaud.fortier.free.fr/fvwm/config ( a little messy due to the multiple tries )

I’ve also tried to use different softs for setting the background wallpaper (feh fvwm-root, Esetroot)

It’s probably not exactly what you expected, but a workaround could be not to shade the console window, but just move it out of scope.

I preffer that method because I hate having that 1 pix line at the top of the screen or wherever the window is shaded.

What I do is this: first, I define the panel, in a similar way to yours, then I define a function to just move it instead of shading. A variable controls the current state of the window (shown/hidden). I don’t use transparencies on my terms because I find them annoying, so I dont really know if the issue has to do anything with shading/unshadding windows. If it has, this alternative method could work, if not, well, then just forget about the post.

This code illustrates the whole idea:

# -1 hidden, any other value means it is visible
SetEnv kuake_pos        -1

DestroyModuleConfig FvwmKuakeitor: *
*FvwmKuakeitor: Frame 0
*FvwmKuakeitor: Font $[ThemeFont]
*FvwmKuakeitor: Colorset 9
*FvwmKuakeitor: Rows 21
*FvwmKuakeitor: Columns 2
*FvwmKuakeitor: (2x20, Padding 3 0, Swallow (Respawn, UseOld, NoClose) 'tabbed_URxvt' 'Exec exec urxvt -name tabbed_URxvt -e screen -S Kuake -R')
*FvwmKuakeitor: (2x1, Padding 10 0, Icon terminal.png, ActiveIcon terminal_bright.png, PressIcon terminal_pressed.png, \
    Title (Side,Left) "Quakeitor, by Johnny Valderrama's Inc. (c)", Action (Mouse 1) toggle_kuakeitor)
Piperead 'echo SetEnv i $(($(($[vp.height] - $[bottom_margin]))/2))'
Piperead 'echo SetEnv j $(($[vp.width] - 2* $[small_margin]))'
Module FvwmButtons -g $[j]x$[i]+0-10000 FvwmKuakeitor

DestroyFunc toggle_kuakeitor
AddToFunc toggle_kuakeitor
+ I Test (EnvMatch kuake_pos -1) All (FvwmKuakeitor) AnimatedMove +$[small_margin]p +0p
+ I Test (EnvMatch kuake_pos -1) All (FvwmKuakeitor) Focus
+ I Test (EnvMatch kuake_pos -1) All (FvwmKuakeitor) WarpToWindow 90 90
+ I Test (EnvMatch kuake_pos 1) All (FvwmKuakeitor) AnimatedMove +$[small_margin]p -10000p
+ I Piperead 'echo SetEnv kuake_pos $((${kuake_pos} * -1))'

Key     z       A   4   toggle_kuakeitor

Don’t pay too much attention to the bunch of variables that I use in the panel, they are widely used to auto adjust the desktop layout to any arbitrary resolution, because this config is used in many different resolutions. I just pasted the whole panel as I use it, but the only really relevant piece of info here is the variable to control the status and the function to move the window. As you see, each time I use that function I end it multiplying the kuake_pos var by -1, that way, on each execution it alternates between 1 and -1, and fulfills its purpose.


thx 6thpink I’ll try it, anyway the above code already has the bug I related when the term is not transparent, also when the colorset had not trace of transparency in it.

Mmmm, now that I think about it…

If the bug is not directly related to colorsets or transparency, try my solution above. If it does work, the bug is in the shading code. I remember seeing patches related to the shade thing in the fvwm-workers list, so, it could easily be something that broke a few days ago.

I think you did not say which fvwm version you are using. If you are using some recent cvs snapshot that could be the problem. Maybe ThomasAdam can say anything more about this, since I don’t really remember what the latest patches related to shading were about, and maybe they have nothing to do with this.

It’s just an idea…


Can you try:

Style *   WindowShadeSteps 0, WindowShadeScrolls

– Thomas Adam

Thx all for reply,
I experience the same problem under 2.5.19 with tons of patches and also with a clean 2.5.21. The weirdest part is that when I use another script for shaded console (not yours 6thpink, but this one : http://fvwm.lair.be/viewtopic.php?t=1608 who only shade a window not a FvwmButton) it needs to close the term when restarting fvwm otherwise I got exactly the same behavior (invisible console) and changing background leads also to some invisible term.

thomasadmas, with

Style *   WindowShadeSteps 0, WindowShadeScrolls

it’s already happening.

\o/ thx for the script 6thpink it works, I have to tweak it a bit :stuck_out_tongue: but works well ( missing transparency is not a problem, missing the complete term is worse )
Edit : it also works with transparent colorsets ^^

I used this style:

Style "FvwmKuakeitor" NoTitle, !Handles, !Borders, Sticky, WindowListSkip, CirculateSkip

Thx so much!

Should I mark this post fixed ?

Haven’t tried it with composite, I suppose that it will do strange things, as xcompmgr always do strange things. Using transparent colosets and/or fake console transparencies should be no problem at all. It is just like any other panel window, it just moves on a keystroke. There is no real shade/unshade not anything like that.

I use this style for it:

Style "FvwmKuakeitor" NoTitle, Sticky, !Iconifiable, FixedSize, \
    WindowListSkip, CirculateSkip, GrabFocus, \
    Layer 6, Borderwidth 1, HandleWidth 1, !RoundedCorners, RoundedCornersBottom

cool ! Layer and Grabfocus styles are great.
I don’t use xcompmgr neither, I’ve just RootTransparent Colorset and slightly transparent urxvtc.

Thx again ! :wink:

Well, here is a slightly “improved” quake console using no FvwmButtons, and starting only when needed :slight_smile: :

[code]#Function who start the console
DestroyFunc StartConsole
AddtoFunc StartConsole

  • I Exec exec urxvtc +tr -name quake -bc +sb -geometry 120x30+0+0
  • I Wait quake
  • I SetEnv quake_pos -1
  • I Next (quake) Maximize ewmhiwa 100 0

Function that shade/unshade the console

DestroyFunc ToggleConsole
AddToFunc ToggleConsole

  • I None (quake) StartConsole
  • I Test (EnvMatch quake_pos -1) All (quake) AnimatedMove +0p +0p
  • I Test (EnvMatch quake_pos -1) All (quake) Focus
  • I Test (EnvMatch quake_pos -1) All (quake) WarpToWindow 50 50
  • I Test (EnvMatch quake_pos 1) All (quake) AnimatedMove +0p -3000p
  • I Piperead ‘echo SetEnv quake_pos $((${quake_pos} * -1))’

Style quake WindowListSkip, BorderWidth 5, !Handles, !Title, WarpToWindow 50 50, Sticky[/code]

I have to deal with some pixel for the Borderwidth so the console feets well on the screen.
Thx again for the trick :slight_smile: