Modal windows

Michel Bardiaux
Mon Jun 11 12:27:00 GMT 2007

Phil Betts wrote:
> Michel Bardiaux wrote on Thursday, June 07, 2007 4:01 PM::
>> We have a MOTIF app that works correctly when displayed on a debian
>> sarge (that is, using xfree) or win2k+exceed8.0.
>> With cygwin-xfree on winxp, however, the modal windows do NOT stay on
>> top of the main application window, the main comes up whenever one
>> clicks in it.
>> In all 3 cases, the client libraries are linux/xfree, at exactly the
>> same version.
>> Is that behavior
>> - by design?
>> - a known bug?
>> - due to a user error?
>> - a bug never reported yet?
> Assuming you're using multiwindow mode, each X window is rendered in a
> different Windows window.  Unfortunately, modality in X is not the same 
> as in Windows.  In X, the display (server), window manager, and client 
> are separate processes, and have clearly defined roles.  This is why 
> it's possible to move the parent of a modal window, because the client 
> is not responsible for its window's placement.  In Windows, the client
> process is responsible for handling windows movement events, so the
> entire parent window, including the frame is effectively iced.  I think 
> the decision was taken that rather than inflict Windows' arguably 
> broken concept of modality on an unsuspecting X process, all X windows 
> are created as non-modal Windows windows.  The modality at the client
> level is still maintained (i.e. you can't do anything in the parent),
> but you will still be able to move the parent window about.

OK, its by design. At least it has the merit of being very clear, and if 
there is some hackish solution, at least it wont get in the way.

> If you really need full X-style modality, you should be able to use
> one of the other modes (rootless or fullscreen) and run an external
> window manager.  The only problem with this IIRC, is that all X 
> windows are really just images in a single Windows window, so 
> clicking on any X window brings all X windows to the top.

Its not an acceptable solution for us. The goal is to make a few 
mission-critical Motif apps available on some PCs running XP, where they 
will be used infrequently but their availabibility would be very helpful.

But I am not opposed in principle to adding some ad-hoc code to our 
applications to enforce modality 'a la X' from the client side. For 
that, of course, one has to be able to sense the server is cygwin 
(xdpyinfo shows its possible), and a way either to speak directly to the 
underlying MSWIN stuff, or some WM property that *is* honored by cygwin.

Rough idea: put in the title bar a string like 'pid+z', and run on MSWIN 
a daemon that will restack all windows with a given pid according to Z.

> Note that Windows' notion of stacking order is completely broken.
> Always-on-top windows are frequently rendered on the bottom.  

I have never seen that behavior.

> This
> includes modal windows, 

Application-modal windows are not always-on-top, just on top of specific 
other windows. BTW I also need 'transient-for' behavior. These are 'stay 
on top of application' but do not prevent interaction with the main window.

> which  is just great if they are rendered
> completely beneath the now disabled parent window!

Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02

Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles

Unsubscribe info:
Problem reports:

More information about the Cygwin-xfree mailing list