emacs-pretest-bug
[Top][All Lists]
Advanced

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

RE: frame position is too low with negative `top'


From: Drew Adams
Subject: RE: frame position is too low with negative `top'
Date: Tue, 5 Jul 2005 16:47:06 -0700

Hi Francis,

I just picked up a Windows binary (from nqmacs) created 2005-06-26, and I
still have this problem.

This is the code that I use to position a frame near the bottom of the
display, but it ends up positioned too low (still):

(modify-frame-parameters
     my-minibuffer-frame
     `((top ,@ (- (frame-char-height my-minibuffer-frame)))))

According to the doc, that should place the bottom of the frame one
character above the bottom of the display (since `top' is negative). In
reality, it places the frame bottom a character or so below the display
bottom, just as before. Since the frame is only two characters high, it is
completely hidden behind the Windows task bar. I'd say that it is,
altogether, about 4 characters too low. My `frame-char-height' is 14.

IOW, I see exactly the same symptoms as before.

FWIW, this works correctly in Emacs 20 - in case the old code can help in
some way.

Thanks,

  Drew


In GNU Emacs 22.0.50.1 (i386-mingw-nt5.1.2600)
 of 2005-06-26 on NONIQPC
X server distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc
(3.3) --cflags -I../../jpeg-6b-3/include -I../../libpng-1.2.8/include -I../.
./tiff-3.6.1-2/include -I../../xpm-nox-4.2.0/include -I../../zlib-1.2.2/incl
ude'


    -----Original Message-----
    From: Drew Adams [mailto:address@hidden
    Sent: Wednesday, May 18, 2005 12:43 PM
    To: Francis Litterio
    Subject: RE: frame position is too low with negative `top'

    Hi Francis,

    Thanks for following up.

    I can't try your C patch out, because I can't build Emacs here.
    But I take your word for it that it's fixed. I will wait until
    it is generally distributed (and I can pick up a Windows binary
    with it).

    Thanks,

      Drew

        -----Original Message-----
        From: Francis Litterio [mailto:address@hidden
        Sent: Wednesday, May 18, 2005 10:34 AM
        To: Drew Adams
        Subject: Re: frame position is too low with negative `top'


        [Drew, I posted this followup to the Emacs pretest list,
         but forgot to CC you. --Fran]

        Drew Adams wrote:

        > I don't mean to pester folks about this bug, but I'd like to
        know whether
        > someone intends to fix this. If not, I'll just hack my local
        code to raise
        > the frame 44 pixels or so, for now.

        Drew,

        I've been running with the below patch for some time with no ill
        effects (under Windows XP).  Does this help your situation?

        I submitted this patch some time ago, but RMS was reluctant
    to take it
        until after I've signed my copyright assigment form (which
    I have now
        down).
        --
        Francis Litterio
        franl <at> world . std . com


        diff -u -w -r1.224 w32term.c
        --- w32term.c   26 Mar 2005 00:19:53 -0000      1.224
        +++ w32term.c   18 May 2005 17:25:19 -0000
        @@ -5413,17 +5413,58 @@
         {
           int flags = f->size_hint_flags;

        -  /* Treat negative positions as relative to the leftmost
    bottommost
        +  /* left_right_borders_width holds the sum of the widths of
        the frame's left
        +     and right borders (in pixels) drawn by Windows. */
        +
        +  unsigned int left_right_borders_width = 8;   /* A sensible
        default value. */
        +
        +  /* top_bottom_borders_height holds the sum of the heights of
        the frame's top and
        +     bottom borders (in pixels) drawn by Windows. */
        +
        +  unsigned int top_bottom_borders_height = 32;  /* A sensible
        default value. */
        +
        +  /* Now obtain the actual values of the above two variables.
        If we fail to
        +     obtain the actual values, we will use the defaults
        assigned above.  We compute
        +     the border width (height) by subtracting the width
        (height) of the frame's
        +     client area from the width (height) of the frame's
    entire window.
        +  */
        +
        +  WINDOWPLACEMENT wp = { 0 };
        +
        +  BOOL status = GetWindowPlacement (FRAME_W32_WINDOW (f), &wp);
        +
        +  if (status != FALSE)
        +  {
        +      RECT client_rect = { 0 };
        +
        +      status = GetClientRect (FRAME_W32_WINDOW (f), &client_rect);
        +
        +      if (status != FALSE)
        +      {
        +         left_right_borders_width =
        +             (wp.rcNormalPosition.right -
    wp.rcNormalPosition.left) -
        +             (client_rect.right - client_rect.left);
        +
        +         top_bottom_borders_height =
        +             (wp.rcNormalPosition.bottom -
    wp.rcNormalPosition.top) -
        +             (client_rect.bottom - client_rect.top);
        +      }
        +  }
        +
        +  /* Treat negative positions as relative to the rightmost
    bottommost
              position that fits on the screen.  */
           if (flags & XNegative)
             f->left_pos = (FRAME_W32_DISPLAY_INFO (f)->width
                           - FRAME_PIXEL_WIDTH (f)
        -                  + f->left_pos);
        +                  + f->left_pos
        +                  - (left_right_borders_width - 1));

           if (flags & YNegative)
             f->top_pos = (FRAME_W32_DISPLAY_INFO (f)->height
                          - FRAME_PIXEL_HEIGHT (f)
        -                 + f->top_pos);
        +                 + f->top_pos
        +                  - (top_bottom_borders_height - 1));
        +
           /* The left_pos and top_pos
              are now relative to the top and left screen edges,
              so the flags should correspond.  */







reply via email to

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