Loading ...
Sorry, an error occurred while loading the content.

950Re: Patch for winpos

Expand Messages
  • dany.stamant@sympatico.ca
    May 19, 2003
    • 0 Attachment
      The system didn't like my attachement. Back to the old cut'n'paste.

      Le lundi, 19 mai 2003, à 16:42 Canada/Eastern,
      dany.stamant@... a écrit :

      > Hi,
      >
      > Could someone test the following patch on MacOS 9?
      > The patch is over 6.2d
      >
      > Patch purpose:
      >
      > make :winpos and :winpos x y use the same coordinate set (the frame
      > of the window)
      >
      >
      > Dany

      *** gui_mac.c.orig Mon May 19 16:25:39 2003
      --- gui_mac.c Mon May 19 16:02:56 2003
      ***************
      *** 2874,2879 ****
      --- 2874,2900 ----
      /* TODO: Should make sure the window is move within range
      * e.g.: y > ~16 [Menu bar], x > 0, x < screen width
      */
      +
      + /* Since MoveWindow use the "kWindowContentRgn" location,
      + * and that Vim wants to refer to the "kWindowStructureRgn"
      + * location, we need to tune the value
      + */
      + #ifdef USE_CARBONIZED
      + Rect cont_bounds;
      + Rect struct_bounds;
      + OSStatus status_cont;
      + OSStatus status_struct;
      +
      + /* Carbon >= 1.0.2, MacOS >= 8.5 */
      + status_cont = GetWindowBounds (gui.VimWindow, kWindowContentRgn,
      &cont_bounds);
      + status_struct = GetWindowBounds (gui.VimWindow,
      kWindowStructureRgn, &struct_bounds);
      +
      + if ((status_cont == noErr) && (status_struct == noErr))
      + {
      + x += (cont_bounds.left - struct_bounds.left);
      + y += (cont_bounds.top - struct_bounds.top);
      + }
      + #endif
      MoveWindow(gui.VimWindow, x, y, TRUE);
      }
    • Show all 5 messages in this topic