From: <dom...@us...> - 2019-08-13 02:13:10
|
Revision: 912 http://sourceforge.net/p/fvwm-crystal/code/912 Author: dominique_libre Date: 2019-08-13 02:13:07 +0000 (Tue, 13 Aug 2019) Log Message: ----------- native fvwm Fullscreen support Modified Paths: -------------- ChangeLog fvwm/components/functions/Fullscreen Modified: ChangeLog =================================================================== --- ChangeLog 2019-08-13 01:48:50 UTC (rev 911) +++ ChangeLog 2019-08-13 02:13:07 UTC (rev 912) @@ -7,7 +7,8 @@ bin/fvwm-crystal.generate-menu: Introduce Icon and MiniIcon styles generation, fix for non probable spaces in desktop files. styles/Applications-Icons-22-32: add media players icon styles - + functions/Fullscreen: bump to fvwm native Maximize Fullscreen + jeudi 5 juin 2019 recipes/lap*: fix pager X11 geometry string. recipes/Wing-Commander, recipes/Default: fix font Modified: fvwm/components/functions/Fullscreen =================================================================== --- fvwm/components/functions/Fullscreen 2019-08-13 01:48:50 UTC (rev 911) +++ fvwm/components/functions/Fullscreen 2019-08-13 02:13:07 UTC (rev 912) @@ -1,15 +1,9 @@ # FVWM-Crystal: Fullscreen -# Written by: Maciej Delmanowski <ha...@li...> -# Modifications: Thomas Adam <th...@ed...> -# Bug fixes, disappear and restart functions: Dominique Michel 2008-2013 +# Written by: Dominique Michel 2008-2019 # <dom...@us...> +# replace the Fullscreen functions written when fvwm did not have native Fs support. +# but now (2019) fvwm have that support, so rewrite things around. # -# Fullscreen overview: -# After using this function, current window will lose it's border and title -# and will be maximized to the full screen (wow). After using Fullscreen -# function on a "full-screened" window it will return to it's previous size and -# position and border/title will be brought back. -# # How to use: # Bind "Fullscreen" command somewhere, example: # @@ -23,138 +17,30 @@ # Key KP_Multiply A $[Mod2] Disappear # # The other window size functions are into Window-Buttons. -# -# 'Fullscreen-Start' and 'Fullscreen-Stop' functions shouldn't be called -# directly, use 'Fullscreen' function instead. -# 'Disappear-On' and 'Disappear-Off' functions shouldn't be called -# directly, use 'Disappear' function instead. -# -# Know bugs, limitations: -# - some terminals and gvim does not scale properly in full-screen. This is because -# they use characters instead of pixels to adjust their width. -# Sometime, it work well the second time you put the window in full screen. -# It also depend on the terminal's font and the screnn's width. -# - tell me how I can get the State attributes in the FS function to work -# after a Restart, or provide a patch. that in order to get ride of -# the temporary files. -InfoStoreAdd TmpDirectory "/tmp" - -# Wrapper function {{{1 -# State 19 = FS (fullscreen), State 20 = visible +# Fullscreen function {{{1 DestroyFunc Fullscreen AddToFunc Fullscreen -+ I ThisWindow (State 19, !FvwmButtons, !FvwmPager, !FvwmMiniConsoleNeedsUniqueName, !QuakeConsoleNeedsUniqueName, !FvwmIconMan, !MPlayer) Fullscreen-Stop -+ I TestRc (NoMatch) ThisWindow (!State 19, !FvwmButtons, !FvwmPager, !FvwmMiniConsoleNeedsUniqueName, !QuakeConsoleNeedsUniqueName, !FvwmIconMan, !MPlayer) Fullscreen-Start ++ I ThisWindow (!FvwmButtons, !FvwmPager, !FvwmMiniConsoleNeedsUniqueName, !QuakeConsoleNeedsUniqueName, !FvwmIconMan, !MPlayer) Maximize Fullscreen -# fullscreen {{{2 -DestroyFunc Fullscreen-Start -AddToFunc Fullscreen-Start -+ 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, 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 {{{2 -DestroyFunc Fullscreen-Stop -AddToFunc Fullscreen-Stop -+ I WindowStyle Title, Borders, Handles, HandleWidth $[infostore.handle_width], Iconifiable, !ResizeHintOverride -+ 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 -+ I UpdateStyles -+ I NS-Default - -# Wrapper function {{{1 +# Disapear Wrapper function {{{1 DestroyFunc Disappear AddToFunc Disappear -# if FS; then if !State20; then show; else hide all; fi -+ I PipeRead 'if [ "$(ls $[infostore.TmpDirectory]/fullscreen.19.0x?*.$[page.nx].$[page.ny].tmp 2>/dev/null)" != "" ]; then \ - for i in $(ls $[infostore.TmpDirectory]/fullscreen.19.0x?*.$[page.nx].$[page.ny].tmp 2>/dev/null); \ - do file=`echo "${i}"|sed -e \'s:fullscreen.19:fullscreen.20:\'`; \ - if [ -e "${file}" ]; then echo "WindowId $(echo $file | cut -d . -f 3) Disappear-Off"; exit; \ - fi; \ - 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 (CurrentPage, Fullscreen, Iconic) Disappear-Off ++ I TestRc (NoMatch) All (CurrentPage, Fullscreen) Disappear-On -# disappear {{{2 -# file tmp_dir/fuulscreen.20.* = hidden DestroyFunc Disappear-On AddToFunc Disappear-On -# Those 2 lines are needed if we want to cycle onto the windows original pages -+ I WarpToWindow $[pointer.x]p $[pointer.y]p -+ I Exec exec touch $[infostore.TmpDirectory]/fullscreen.20.$[w.id].$[page.nx].$[page.ny].tmp -+ I WindowStyle !State 20 + I WindowStyle NoIcon + I UpdateStyles + I Iconify true -# appear {{{2 DestroyFunc Disappear-Off AddToFunc Disappear-Off -+ I ThisWindow MoveToPage $[page.nx] 0 + I Iconify false -+ I WindowStyle State 20 + I WindowStyle Icon + I UpdateStyles -+ I Test (f $[infostore.TmpDirectory]/fullscreen.20.$[w.id].$[page.nx].$[page.ny].tmp) Exec exec rm -f $[infostore.TmpDirectory]/fullscreen.20.$[w.id].$[page.nx].$[page.ny].tmp -# Restore Fullscreen after restart {{{1 -# Called by StartFunction -DestroyFunc Fullscreen-Recover -AddToFunc Fullscreen-Recover -+ 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 UpdateStyles - -DestroyFunc Disappear-Recover -AddToFunc Disappear-Recover -+ I WindowStyle !State 20 -+ I WindowStyle NoIcon -+ I UpdateStyles -+ I Iconify true - -DestroyFunc Disappear-Test -AddToFunc Disappear-Test -+ I Test (F $[infostore.TmpDirectory]/fullscreen.20.$[w.id].$[page.nx].$[page.ny].tmp) WindowId $[w.id] Disappear-Recover - -# 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' -PipeRead "for i in $[infostore.TmpDirectory]/fullscreen.20.*; do wid=`basename $i | awk --field-separator . '{print $$3}'`; echo \"+ I WindowId ${wid} Disappear-Recover\"; done" - -AddToFunc StartFunction I Schedule 1000 RecoverFullscreen - -AddToFunc ExitFunction I Test (!ToRestart) Exec rm -f $[infostore.TmpDirectory]/fullscreen.19.* -AddToFunc ExitFunction I Test (!ToRestart) Exec rm -f $[infostore.TmpDirectory]/fullscreen.20.* -AddToFunc ExitFunction I Test (Quit) Exec rm -f $[infostore.TmpDirectory]/fullscreen.* - -# Be sure the temporary files are destroyed when a window is closed -DestroyFunc Window-Fullscreen-Destroy -AddToFunc Window-Fullscreen-Destroy -+ i PipeRead 'for file in /tmp/fullscreen.??.$[w.id].?.?.tmp; do rm $file 2>/dev/null; done' - -DestroyModuleConfig FvwmEvent-Window-Fullscreen-Destroy: * -*FvwmEvent-Window-FullScreen-Destroy: destroy_window Window-Fullscreen-Destroy -Module FvwmEvent FvwmEvent-Window-Fullscreen-Destroy - -# Rearrange in fullscreen -DestroyFunc Fullscreen-Rearrange -AddToFunc Fullscreen-Rearrange -+ I All (CurrentPage, !Iconic, !FvwmButtons, !FvwmPager, !FvwmConsoleNeedsUniqueName, !QuakeConsoleNeedsUniqueName, !FvwmIconMan, !MPlayer) Fullscreen - # Start in full screen at application statup DestroyFunc Window-AutoFS AddToFunc Window-AutoFS This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |