emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs geometry


From: YAMAMOTO Mitsuharu
Subject: Re: Emacs geometry
Date: Fri, 28 Jul 2006 11:57:04 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/22.0.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Tue, 25 Jul 2006 23:41:47 +0300, Eli Zaretskii <address@hidden> said:

> you should instead honor f->left_pos and f->top_pos, if they were
> set from initial-frame-alist.  The problem is to decide correctly
> when to honor them.

Maybe XSizeHints emulation on the Mac Carbon port is relevant to this.

1. `struct mac_output' (in macterm.h) has a member for size hints.

#define FRAME_SIZE_HINTS(f) ((f)->output_data.mac->size_hints)

2. `x_make_frame_visible' (in macterm.c) checks the flag in the size
   hints to see if f->left_pos and f->top_pos are set by the user.  If
   not, reposition the frame to the center of the main screen when
   there is no selected frame, and to the cascading position with
   respect to the selected frame when it is available.

      if (! FRAME_ICONIFIED_P (f)
          && ! f->output_data.mac->asked_for_visible)
        {
#if TARGET_API_MAC_CARBON
          if (!(FRAME_SIZE_HINTS (f)->flags & (USPosition | PPosition)))
            {
              struct frame *sf = SELECTED_FRAME ();
              if (!FRAME_MAC_P (sf))
                RepositionWindow (FRAME_MAC_WINDOW (f), NULL,
                                  kWindowCenterOnMainScreen);
              else
                RepositionWindow (FRAME_MAC_WINDOW (f),
                                  FRAME_MAC_WINDOW (sf),
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
                                  kWindowCascadeStartAtParentWindowScreen
#else
                                  kWindowCascadeOnParentWindowScreen
#endif
                                  );
              x_real_positions (f, &f->left_pos, &f->top_pos);
            }
          else
#endif
            x_set_offset (f, f->left_pos, f->top_pos, 0);
        }

3. `x_set_offset' (in macterm.c) enforces a constraint that the title
   bar should be visible at least partially.  We have a menu bar at
   the top of screen on Mac, so it is needed in order to prevent the
   title bar from being hidden when f->top_pos == 0.

#if TARGET_API_MAC_CARBON
  MoveWindowStructure (FRAME_MAC_WINDOW (f), f->left_pos, f->top_pos);
  /* If the title bar is completely outside the screen, adjust the
     position. */
  ConstrainWindowToScreen (FRAME_MAC_WINDOW (f), kWindowTitleBarRgn,
                           kWindowConstrainMoveRegardlessOfFit
                           | kWindowConstrainAllowPartial, NULL, NULL);
  x_real_positions (f, &f->left_pos, &f->top_pos);
#else

                                     YAMAMOTO Mitsuharu
                                address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]