From: <dom...@us...> - 2013-04-23 17:26:07
|
Revision: 282 http://sourceforge.net/p/fvwm-crystal/code/282 Author: dominique_libre Date: 2013-04-23 17:26:01 +0000 (Tue, 23 Apr 2013) Log Message: ----------- functions/Fullscreen: cleanup Modified Paths: -------------- ChangeLog fvwm/components/functions/Fullscreen Modified: ChangeLog =================================================================== --- ChangeLog 2013-04-23 16:03:48 UTC (rev 281) +++ ChangeLog 2013-04-23 17:26:01 UTC (rev 282) @@ -6,6 +6,7 @@ recipes/Fullscreen: make the notification area movable and to appear/ disappear with EWMH-Toggle. Work best with StaloneTray. recipes/Amiga: removed non needed tests + functions/Fullscreen: cleanup Lundi 22 Avril Dominique Michel recipes/*: move some SetEnv to Infostore; include Fullscreen functions Modified: fvwm/components/functions/Fullscreen =================================================================== --- fvwm/components/functions/Fullscreen 2013-04-23 16:03:48 UTC (rev 281) +++ fvwm/components/functions/Fullscreen 2013-04-23 17:26:01 UTC (rev 282) @@ -18,6 +18,7 @@ # When using this function, Fvwm-Crystal will cycle through all the fullscreened # windows and the workbench on the current page. # To use it, bind "Disappear" command somewhere. +# Key KP_Multiply A $[Mod2] Disappear # # The other window size functions are into Window-Buttons. # @@ -26,10 +27,16 @@ # 'Disappear-On' and 'Disappear-Off' functions shouldn't be called # directly, use 'Disappear' function instead. # -# Recipe : Must be included after the styles otherwise strange results will append -# when restarting Fvwm. +# Know bugs, limitations: +# - after a recipe change, if the new desktop geometry is not the same, some +# window(s) can be lost. Is it needed to add a logic fot that? +# - some terminals does not scale corectly in full-screen. As example, Terminator +# scale correctly, Gnome Terminal, ATerm, Xterm and MRxwt does not, URxwt does not scale +# correctly the first time it is put in full screen, but it does scale OK afterward. +# If you know how to fix this, please send me a mail: +# <dom...@us...> # -# Todo: +# TODO: # - restore the position when restoring the "normal" window InfoStoreAdd TmpDirectory "/tmp" @@ -41,26 +48,28 @@ + I ThisWindow (State 19) Fullscreen-Stop + I TestRc (NoMatch) ThisWindow (!State 19) Fullscreen-Start -# fullscreen +# fullscreen {{{2 DestroyFunc Fullscreen-Start AddToFunc Fullscreen-Start + I SetEnv "FSWindowWidth_$[w.id]" "$[w.width]p" + I SetEnv "FSWindowHeight_$[w.id]" "$[w.height]p" -+ I WindowStyle !Title, !Borders, Iconifiable, ResizeHintOverride +#+ I SetEnv "FSWindowX_$[w.id]" "$[cw.x]p" +#+ I SetEnv "FSWindowY_$[w.id]" "$[cw.y]p" ++ I WindowStyle !Title, !Borders, !Handles, Iconifiable, ResizeHintOverride + I UpdateStyles + I WindowStyle State 19 + I WindowStyle State 20 + I Maximize ewmhiwa True 100 100 -+ I WindowStyle !Maximizable, FixedSize ++ I WindowStyle !Maximizable, FixedSize, FixedPosition + I UpdateStyles # We need 1 temporary file for restoring the window state after restart + I Exec exec touch $[infostore.TmpDirectory]/fullscreen.19.$[w.id].$[page.nx].$[page.ny].tmp -# quit fullscreen +# quit fullscreen {{{2 DestroyFunc Fullscreen-Stop AddToFunc Fullscreen-Stop + I WindowStyle Title, Borders, Iconifiable, !ResizeHintOverride -+ I WindowStyle Maximizable, !FixedSize ++ I WindowStyle Maximizable, !FixedSize, !FixedPosition + I WindowStyle !State 19 + I WindowStyle !State 20 + I Test (f $[infostore.TmpDirectory]/fullscreen.19.$[w.id].$[page.nx].$[page.ny].tmp) Exec exec rm -f $[infostore.TmpDirectory]/fullscreen.19.$[w.id].$[page.nx].$[page.ny].tmp @@ -69,6 +78,8 @@ + I PlaceAgain + I UnsetEnv "FSWindowWidth_$[w.id]" + I UnsetEnv "FSWindowHeight_$[w.id]" +#+ I UnsetEnv "FSWindowX_$[w.id]" "$[w.x]p" +#+ I UnsetEnv "FSWindowY_$[w.id]" "$[w.y]p" # Wrapper function {{{1 DestroyFunc Disappear @@ -82,10 +93,8 @@ done; \ for i in $(ls $[infostore.TmpDirectory]/fullscreen.19.0x???????.$[page.nx].$[page.ny].tmp 2>/dev/null); \ do echo "WindowId $(echo $i | cut -d . -f 3) Disappear-On"; done; fi' -#+ I Next (State 19, !State 20) Disappear-Off -#+ I TestRc (NoMatch) All (State 19, State 20, !Iconic) Disappear-On -# disappear +# disappear {{{2 # file tmp_dir/fuulscreen.20.* = hidden DestroyFunc Disappear-On AddToFunc Disappear-On @@ -97,11 +106,9 @@ + I UpdateStyles + I Iconify true -# appear +# appear {{{2 DestroyFunc Disappear-Off AddToFunc Disappear-Off -# Go to the original page of the window -#Test (f $[infostore.TmpDirectory]/fullscreen.20.$[w.id].$[page.nx].$[page.ny].tmp) PipeRead 'page=`ls $[infostore.TmpDirectory] | grep 20.$[w.id] | awk --field-separator . "{print 4}"`; echo "+ I GotoPage $page 0"' + I Iconify false + I WindowStyle State 20 + I WindowStyle Icon @@ -131,7 +138,7 @@ AddToFunc Disappear-Test + I Test (F $[infostore.TmpDirectory]/fullscreen.20.$[w.id].$[page.nx].$[page.ny].tmp) WindowId $[w.id] Disappear-Recover -# wrapper +# wrapper {{{2 DestroyFunc RecoverFullscreen AddToFunc RecoverFullscreen PipeRead 'for i in $[infostore.TmpDirectory]/fullscreen.19.*; do wid=`basename "$i" | awk --field-separator . \'{print $$3}\'`; echo "+ I WindowId ${wid} Fullscreen-Recover"; done' @@ -139,7 +146,6 @@ + I All Test (F $[infostore.TmpDirectory]/fullscreen.20.$[w.id].$[page.ny].$[page.ny].tmp) WindowId $[w.id] Disappear-Recover AddToFunc StartFunction I RecoverFullscreen -#AddToFunc StartFunction I All Test (F $[infostore.TmpDirectory]/fullscreen.19.$[w.id].$[page.nx].$[page.ny].tmp) WindowId $[w.id] Fullscreen-Recover AddToFunc ExitFunction I Test (!ToRestart) Exec rm -f $[infostore.TmpDirectory]/fullscreen.19.* AddToFunc ExitFunction I Test (!ToRestart) Exec rm -f $[infostore.TmpDirectory]/fullscreen.20.* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |