Subject: Moving windows correctly

From: Dan Espen <[email-masked]>
Date: Mon, 29 May 2000 09:18:51 -0400

Just some information.

A while ago we had some discussions about applications moving windows
and getting them where they want them.

X3270 seems to have the problem solved.

If you create an x3270 window, then add they keyboard popup, then
move the main window, the popup follows along quite nicely.

Heres the logic:

After placing the window:

  XtAppAddTimeOut(appcontext, 250, measure_move, 0);

In measure move:

measure_move(closure, id)
XtPointer closure;
XtIntervalId *id;
{
  Position x, y;
  XtVaGetValues(keypad_shell, XtNx, &x, XtNy, &y, NULL);
  if (x != kmove_x || y != kmove_y) {
    if (kmove_x - x < 0 && kmove_y - y < 0) {
      /*
       * The window manager shifts by exactly the decoration
       * size (mwm, olwm).
       */
      wa_mode = WA_ALL;
    } else {
      /*
       * The window manager shifts by something less than the
       * decoration size (twm).
       */
      wa_mode = WA_PARTIAL;
      XtVaSetValues(keypad_shell,
          XtNx,
        x + decor_width + (decor_width - (kmove_x - x)),
          XtNy,
        y + decor_height + (decor_height - (kmove_y - y)),
          NULL);
    }
  } else {
    /*
     * The window manager leaves the window exactly where we
     * asked (fvwm).
     */
    XtVaSetValues(keypad_shell,
        XtNx, x + decor_width,
        XtNy, y + decor_height,
        NULL);
    wa_mode = WA_NONE;
  }
}

It then uses "wa_mode" to adjust the window position.

As I think we discovered, the underlying problem is that there doesn't
appear to be any clear standard for this.  If we can believe X3270,
there seem to be at least 3 different things that window managers will
do.

-- 
Dan Espen
444 Hoes Lane  Room RRC 1C-214             E-mail: [email-masked]
Piscataway, NJ 08854                       Phone: (732) 699-5570
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 30 May 2000 02:15:46 +0200

> there seem to be at least 3 different things that window managers will

I tried out x3270, and right on the first five attempts this logic
failed to work properly :-)  Often, the keyboard window ends about 10
to 20 pixels far up on the screen:

              +----+
  +----------+|    |
  |          ||    |
  |          ||    |
  |          || kb |
  |  x3270   ||    |
  |          ||    |
  |          ||    |
  |          |+----+
  +----------+

Bye

Dominik ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]