Got a simple problem for which I'm trying to find a good solution. I have two applications running on 1 workstation. This workstation is configured with two displays. What I'm trying to accomplish is to constrain the positions of the windows from one of my apps to one of the displays. No problem figuring out the displayable area, the problem I'm having is enforcing it.
Currently the windows are all top level shells (need the ability to iconify windows). I am using MWM as my window manager and I'm running Motif 1.2.
So right now I have an event handler which subscribes to the StuctureNotifyMask and I get configureNotify eventS on the windowS. Seeing how I am using a window manager I cannot preemptively stop a window from moving outside the viewable area (wish there was a XmNminX and XmNminY resource). So I'm stuck with having to move the window post the window manager actually moving the window. This is OK for the most part, but because I have the Mwm*moveOpaque value set I receive several configureNotify events when the window is being moved by the user. When it begins to move outside the acceptable area (user dragging the window), I start to try and move it to the proper area and then things go bad in a hurry (my app setting calculating correct positions and the user is still moving the window).
I'm I missing something here? It is difficult to figure out when the drag move starts and stops (add button handlers (but don't get notified of MB1 clicks on the window titlebar), motionnotify events and try and set global window states) and the configureNotify events don't contain that information. Things are compounded when the user resizes the window outside of the viewing area...
I've searched online and have found a couple of threads where people were trying to do the same thing, but never any concrete solution.
Please, if you've done this in the past or have some ideas for me I would be very appreciative.