Discussion:
FVWM: Forcing a window to remain on a specific page
Glenn Golden
2017-04-12 15:47:54 UTC
Permalink
Is it possible to force a given window to appear and remain only on a
particular page? (Effectively, something like "StartsOnPage", except it
would really be "StaysOnPage", i.e. the page assignment holds for all time,
not just upon initial mapping.)

The need for this arises as follows: I'm running xv with the -poll option,
in order to periodically update the display of an image as the underlying
image file changes. Desired behavior is that the image only ever appears on
fvwm page (x,y). When I try to obtain this behavior via:

Style myxv StartsOnPage x y, SkipMapping

and then invoking xv as

$ xv -name myxv -poll [myfile]

it starts on page (x,y) as desired, but then later, when the image file
changes, the 'new' (i.e., updated) window always pops up on the current page.

(NOTE, fwiw: The updated window(s) seem to maintain the same 'name' and
'Window ID' as the originally-mapped window, as reported by FvwmIdent.)

Thanks!

--------------------------------------------------------------------------
FVWM --version info:

fvwm 2.6.7 compiled on Nov 30 2016 at 13:19:18
with support for: ReadLine, Stroke, XPM, SVG, Shape, XShm, SM, Bidi text,
Xinerama, XRender, XCursor, XFT, NLS
Glenn Golden
2017-04-12 17:17:19 UTC
Permalink
Post by Glenn Golden
Is it possible to force a given window to appear and remain only on a
particular page? (Effectively, something like "StartsOnPage", except it
would really be "StaysOnPage", i.e. the page assignment holds for all time,
not just upon initial mapping.)
The need for this arises as follows: I'm running xv with the -poll option,
in order to periodically update the display of an image as the underlying
image file changes. Desired behavior is that the image only ever appears on
Style myxv StartsOnPage x y, SkipMapping
and then invoking xv as
$ xv -name myxv -poll [myfile]
it starts on page (x,y) as desired, but then later, when the image file
changes, the 'new' (i.e., updated) window always pops up on the current page.
You'd have to use FvwmEvent to do this. Listen on the new_page event and
either iconify or deiconify the window as appropriate.
Thanks! I will take a shot at it with that approach, thank you.

Glenn
Dan Espen
2017-04-12 19:35:30 UTC
Permalink
Post by Glenn Golden
Post by Glenn Golden
Is it possible to force a given window to appear and remain only on a
particular page? (Effectively, something like "StartsOnPage", except it
would really be "StaysOnPage", i.e. the page assignment holds for all time,
not just upon initial mapping.)
The need for this arises as follows: I'm running xv with the -poll option,
in order to periodically update the display of an image as the underlying
image file changes. Desired behavior is that the image only ever appears on
Style myxv StartsOnPage x y, SkipMapping
and then invoking xv as
$ xv -name myxv -poll [myfile]
it starts on page (x,y) as desired, but then later, when the image file
changes, the 'new' (i.e., updated) window always pops up on the current page.
You'd have to use FvwmEvent to do this. Listen on the new_page event and
either iconify or deiconify the window as appropriate.
Thanks! I will take a shot at it with that approach, thank you.
I suggest you just add RandomPlacement.
I confine various windows to a page that way.

DestroyFunc PageR
AddToFunc PageR I Style "$0" StartsOnPage $1 $2 $3, SkipMapping, RandomPlacement
# desk/x/y
PageR "*Outlook Web*" 0 1 2
PageR "Untitled Message*" 0 1 2
PageR Seamonkey-bin 0 0 1
PageR Netscape 0 0 1
PageR Mozilla* 0 0 1
PageR s2.pl 0 1 0
PageR s1.py 0 1 0
PageR xmms 0 1 1
PageR Audacious* 0 1 1
PageR Ryhthmbox* 0 1 1
PageR Music* 0 1 1
--
Dan Espen
Dominik Vogt
2017-04-12 19:56:42 UTC
Permalink
Post by Glenn Golden
Is it possible to force a given window to appear and remain only on a
particular page? (Effectively, something like "StartsOnPage", except it
would really be "StaysOnPage", i.e. the page assignment holds for all time,
not just upon initial mapping.)
The need for this arises as follows: I'm running xv with the -poll option,
in order to periodically update the display of an image as the underlying
image file changes. Desired behavior is that the image only ever appears on
Style myxv StartsOnPage x y, SkipMapping
and then invoking xv as
$ xv -name myxv -poll [myfile]
it starts on page (x,y) as desired, but then later, when the image file
changes, the 'new' (i.e., updated) window always pops up on the current page.
(NOTE, fwiw: The updated window(s) seem to maintain the same 'name' and
'Window ID' as the originally-mapped window, as reported by FvwmIdent.)
Yeah, you can forbid the program and/or the user to move the
window with

Style myxv FixedUSPosition, FixedPPosition

(US for user movement, P for program movement). You may want to add

Style myxv FixedUSSize, FixedPSize

If that does not fix it, xv is creating a new window with a
different name. You need to figure out the name and add the
apropriate styles. With

bugopts explainwindowplacement on

fvwm prints a detailed explanation of where it places a new window
and why. Also try FvwmIdent on the window in question to figure
out its class and resource name (both can be used in styles).

Ciao

Dominik ^_^ ^_^
--
Dominik Vogt
Glenn Golden
2017-04-12 21:04:49 UTC
Permalink
Post by Dominik Vogt
[ ... ]
(NOTE, fwiw: The updated window(s) seem to maintain the same 'name' and
'Window ID' as the originally-mapped window, as reported by FvwmIdent.)
Yeah, you can forbid the program and/or the user to move the
window with
Style myxv FixedUSPosition, FixedPPosition
Byooteeful. That works out of the box and seems like the simplest approach.
Thanks Dominik!
Brian
2017-04-13 01:14:37 UTC
Permalink
I'm running slackware 14.2-64bit fvwm-2.6.6 and have found that when I
try to generate the fvwm-menu-desktop it is throwing an error
Traceback (most recent call last):
File "/usr/bin/fvwm-menu-desktop", line 59, in <module>
import xdg.Menu
ImportError: No module named xdg.Menu

I thought it was an issue of slackware not having slackware-xdg-menu
support so added that package which had no effect. Still get the same
error after installation.

Where is he xdg.Menu module suppose to come from?

Cheers, Brian
Dan Espen
2017-04-13 01:09:53 UTC
Permalink
Post by Brian
I'm running slackware 14.2-64bit fvwm-2.6.6 and have found that when I
try to generate the fvwm-menu-desktop it is throwing an error
File "/usr/bin/fvwm-menu-desktop", line 59, in <module>
import xdg.Menu
ImportError: No module named xdg.Menu
I thought it was an issue of slackware not having slackware-xdg-menu
support so added that package which had no effect. Still get the same
error after installation.
Where is he xdg.Menu module suppose to come from?
On Fedora:

/usr/lib/python2.7/site-packages/xdg/Menu.py

I don't see it in my 3.5 packages.
You might want to make sure python 2 is being used.
--
Dan Espen
Jaimos Skriletz
2017-04-13 01:52:29 UTC
Permalink
Post by Dan Espen
Post by Brian
I'm running slackware 14.2-64bit fvwm-2.6.6 and have found that when I
try to generate the fvwm-menu-desktop it is throwing an error
File "/usr/bin/fvwm-menu-desktop", line 59, in <module>
import xdg.Menu
ImportError: No module named xdg.Menu
I thought it was an issue of slackware not having slackware-xdg-menu
support so added that package which had no effect. Still get the same
error after installation.
Where is he xdg.Menu module suppose to come from?
/usr/lib/python2.7/site-packages/xdg/Menu.py
I don't see it in my 3.5 packages.
You might want to make sure python 2 is being used.
The python script fvwm-menu-desktop requires the python-xdg module,
seems it is called pyxdg in slackware.

Note, this requires python2, the build process in fvwm doesn't always
enforce this, you may have to edit the shebang on the top of the
script to point at python2 (not python3) and install that module to
work. If you don't have python2 installed, you will need to install it
and the module for python2.

jaimos

Loading...