Stricter MWM support -- with patch

I use a GUI toolkit which is very strict about determining if MWM is running. It isn’t enough to detect the _MOTIF_WM_INFO property (via ModalityIsEvil), but it actually gets the xwininfo of the window ID that is in that property.

Currently, the SetMWM_INFO function just puts the id of it’s parent window (fvwm itself). The problem is that it’s properties don’t match what mwm uses.

If you do an xprop -root |grep _WM_INFO, and then do an xwininfo -id on the second property from xprop, you will get Class InputOutput, coordinates -10,-10, Width/Height 10, along with other information. Motif defines the Class as InputOnly and the coordinates as -100,-100.

The patch below applies to current CVS mainline (cvs diff -u). The code change will apply to the current release, but the whitespace is different.

What do I need to do in order to get this change applied to the code. Is this better suited to the fvwm-workers list?

RCS file: /home/cvs/fvwm/fvwm/fvwm/fvwm.c,v
retrieving revision 1.378
diff -u -r1.378 fvwm.c
--- fvwm/fvwm.c 19 Sep 2006 22:09:55 -0000      1.378
+++ fvwm/fvwm.c 31 Oct 2006 16:52:49 -0000
@@ -1644,10 +1644,19 @@

        if (Scr.bo.is_modality_evil)
        {
+               Window inpWin;
+               XSetWindowAttributes sAttributes;
+
+               sAttributes.override_redirect = True;
+               sAttributes.event_mask = FocusChangeMask | PropertyChangeMask;
+               inpWin=XCreateWindow(dpy, Scr.Root, -100, -100, 10, 10, 0, 0,
+                                    InputOnly, CopyFromParent,
+                                    CWEventMask | CWOverrideRedirect, &sAttributes);
+               XMapWindow(dpy, inpWin);
                /* Set Motif WM_INFO atom to make motif relinquish
                 * broken handling of modal dialogs */
                motif_wm_info.props[0] = 2;
-               motif_wm_info.props[1] = window;
+               motif_wm_info.props[1] = inpWin;
                XChangeProperty(
                        dpy,Scr.Root, _XA_MOTIF_WM, _XA_MOTIF_WM,32,
                        PropModeReplace, (unsigned char *)&motif_wm_info, 2);

This is what you should have done in the first place, yes.

– Thomas Adam

No problem, though based on the amount of searching the web I did to track this down, a post like this would’ve helped me.

Feel free to edit my original post as you see necessary, and I’ll post to the mailing list.

Thanks

The information at fvwm.org is fairly clear about which lists is for which purpose. Sometimes these forums see sporadic patches for all sorts of things, and my reply has been the same to all of them: post to fvwm-workers.

No, I won’t be editing anything.

– Thomas Adam