Can FVWM move an invisible window?

I have created a window in a Java application, but it is not visible yet. I have a C++ shared library I can access from Java (using JNI) which lets me get the window ID for the window, even though it is not yet visible (a Java pack() is sufficient for X to supply the window ID). I then tried to move the window using the FvwmCommand “WindowId $1 MoveToDesk 0 $2” and get an error (nothing very helpful in the log, but the cursor changes to the plus cursor). If the window is visible when I run the command, there is no problem.

Is there anyway around requiring the window be visible in order for FVWM to recognize the window ID. Can FVWM validate the ID with X, even if the window isn’t visible?

The window ID is actually set by X when it is mapped. and not at any other time (so why you think pack() has anything to do with it, I don’t know – that just defines the widget placements.)

Yep. Using the windowid is always going to be an odd choice though. You should use something else, such as the class:

None (Some_Name) MoveToDesk ....

– Thomas Adam

Java uses the isDisplayable() method to determine if a window is connected to the native screen resource.

/** * Determines whether this component is displayable. A component is * displayable when it is connected to a native screen resource. * <p> * A component is made displayable either when it is added to * a displayable containment hierarchy or when its containment * hierarchy is made displayable. * A containment hierarchy is made displayable when its ancestor * window is either packed or made visible. * <p> * A component is made undisplayable either when it is removed from * a displayable containment hierarchy or when its containment hierarchy * is made undisplayable. A containment hierarchy is made * undisplayable when its ancestor window is disposed. * * @return <code>true</code> if the component is displayable, * <code>false</code> otherwise * @see Container#add(Component) * @see Window#pack * @see Window#show * @see Container#remove(Component) * @see Window#dispose * @since 1.2 */ public boolean isDisplayable() {...}

Packing it makes it displayable.

/** * Causes this Window to be sized to fit the preferred size * and layouts of its subcomponents. If the window and/or its owner * are not yet displayable, both are made displayable before * calculating the preferred size. The Window will be validated * after the preferredSize is calculated. * @see Component#isDisplayable */ public void pack() {...}

I don’t want to go into all my details, but I do need to move the windows to different desktops by window ID. Can FVWM handle this if the window is invisible? The window IDs I am getting from my shared library are valid. Once the window is shown, the value matches what I have queried. Only FVWM is giving me grief, not recognizing the window ID until the window is visible.

Like I told you, the window has to be mapped (displayed, seen, etc) before anything can be done. Having a window in the WithDrawn state doesn’t means it’s handled.

– Thomas Adam