emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/w32term.c


From: Kim F. Storm
Subject: [Emacs-diffs] Changes to emacs/src/w32term.c
Date: Sat, 24 May 2003 18:06:19 -0400

Index: emacs/src/w32term.c
diff -c emacs/src/w32term.c:1.188 emacs/src/w32term.c:1.189
*** emacs/src/w32term.c:1.188   Fri Apr  4 16:15:53 2003
--- emacs/src/w32term.c Sat May 24 18:06:19 2003
***************
*** 256,263 ****
  static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *));
  static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int,
                                   enum text_cursor_kinds));
! static void w32_clip_to_row P_ ((struct window *, struct glyph_row *,
!                                  HDC, int));
  
  static Lisp_Object Qvendor_specific_keysyms;
  
--- 256,262 ----
  static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *));
  static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int,
                                   enum text_cursor_kinds));
! static void w32_clip_to_row P_ ((struct window *, struct glyph_row *, HDC));
  
  static Lisp_Object Qvendor_specific_keysyms;
  
***************
*** 653,659 ****
        {
        HDC hdc = get_frame_dc (f);
        w32_clear_area (f, hdc, 0, y, width, height);
!       w32_clear_area (f, hdc, f->output_data.w32->pixel_width - width,
                        y, width, height);
        release_frame_dc (f, hdc);
        }
--- 652,658 ----
        {
        HDC hdc = get_frame_dc (f);
        w32_clear_area (f, hdc, 0, y, width, height);
!       w32_clear_area (f, hdc, FRAME_PIXEL_WIDTH (f) - width,
                        y, width, height);
        release_frame_dc (f, hdc);
        }
***************
*** 680,686 ****
    hdc = get_frame_dc (f);
  
    /* Must clip because of partially visible lines.  */
!   w32_clip_to_row (w, row, hdc, 1);
  
    if (p->bx >= 0)
      {
--- 679,685 ----
    hdc = get_frame_dc (f);
  
    /* Must clip because of partially visible lines.  */
!   w32_clip_to_row (w, row, hdc);
  
    if (p->bx >= 0)
      {
***************
*** 1834,1842 ****
    if (s->row->full_width_p
        && !s->w->pseudo_window_p)
      {
!       last_x += FRAME_X_RIGHT_FRINGE_WIDTH (s->f);
!       if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (s->f))
!       last_x += FRAME_SCROLL_BAR_WIDTH (s->f) * CANON_X_UNIT (s->f);
      }
  
    /* The glyph that may have a right box line.  */
--- 1833,1842 ----
    if (s->row->full_width_p
        && !s->w->pseudo_window_p)
      {
!       last_x += WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH (s->w);
!       if (s->area != RIGHT_MARGIN_AREA
!         || WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (s->w))
!       last_x += WINDOW_RIGHT_FRINGE_WIDTH (s->w);
      }
  
    /* The glyph that may have a right box line.  */
***************
*** 2258,2264 ****
      {
        /* If `x-stretch-block-cursor' is nil, don't draw a block cursor
         as wide as the stretch glyph.  */
!       int width = min (CANON_X_UNIT (s->f), s->background_width);
  
        /* Draw cursor.  */
        x_draw_glyph_string_bg_rect (s, s->x, s->y, width, s->height);
--- 2258,2264 ----
      {
        /* If `x-stretch-block-cursor' is nil, don't draw a block cursor
         as wide as the stretch glyph.  */
!       int width = min (FRAME_COLUMN_WIDTH (s->f), s->background_width);
  
        /* Draw cursor.  */
        x_draw_glyph_string_bg_rect (s, s->x, s->y, width, s->height);
***************
*** 2603,2610 ****
       without mode lines.  Include in this box the left and right
       fringes of W.  */
    window_box (w, -1, &x, &y, &width, &height);
-   width += FRAME_X_FRINGE_WIDTH (f);
-   x -= FRAME_X_LEFT_FRINGE_WIDTH (f);
  
    from_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->current_y);
    to_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->desired_y);
--- 2603,2608 ----
***************
*** 3072,3086 ****
  {
    Lisp_Object window;
  
!   window = window_from_coordinates (f, x, y, 0, 0);
    if (!NILP (window))
      {
        struct window *w = XWINDOW (window);
        struct glyph_row *r = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
        struct glyph_row *end = r + w->current_matrix->nrows - 1;
  
-       frame_to_window_pixel_xy (w, &x, &y);
- 
        for (; r < end && r->enabled_p; ++r)
        if (r->y <= y && r->y + r->height > y)
          {
--- 3070,3083 ----
  {
    Lisp_Object window;
  
!   window = window_from_coordinates (f, x, y, 0, &x, &y, 0);
! 
    if (!NILP (window))
      {
        struct window *w = XWINDOW (window);
        struct glyph_row *r = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
        struct glyph_row *end = r + w->current_matrix->nrows - 1;
  
        for (; r < end && r->enabled_p; ++r)
        if (r->y <= y && r->y + r->height > y)
          {
***************
*** 3095,3101 ****
            if (x < r->x)
              {
                /* x is to the left of the first glyph in the row.  */
!               rect->left = XINT (w->left);
                rect->right = WINDOW_TO_FRAME_PIXEL_X (w, r->x);
                return 1;
              }
--- 3092,3101 ----
            if (x < r->x)
              {
                /* x is to the left of the first glyph in the row.  */
!               /* Shouldn't this be a pixel value?
!                  WINDOW_LEFT_EDGE_X (w) seems to be the right value.
!                  ++KFS */
!               rect->left = WINDOW_LEFT_EDGE_COL (w);
                rect->right = WINDOW_TO_FRAME_PIXEL_X (w, r->x);
                return 1;
              }
***************
*** 3111,3117 ****
  
            /* x is to the right of the last glyph in the row.  */
            rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx);
!           rect->right = XINT (w->left) + XINT (w->width);
            return 1;
          }
      }
--- 3111,3120 ----
  
            /* x is to the right of the last glyph in the row.  */
            rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx);
!           /* Shouldn't this be a pixel value?  
!              WINDOW_RIGHT_EDGE_X (w) seems to be the right value.
!              ++KFS */
!           rect->right = WINDOW_RIGHT_EDGE_COL (w);
            return 1;
          }
      }
***************
*** 3131,3137 ****
        int width = FRAME_SMALLEST_CHAR_WIDTH (f1);
        int height = FRAME_SMALLEST_FONT_HEIGHT (f1);
  
!       /* Arrange for the division in PIXEL_TO_CHAR_COL etc. to
         round down even for negative values.  */
        if (gx < 0)
        gx -= width - 1;
--- 3134,3140 ----
        int width = FRAME_SMALLEST_CHAR_WIDTH (f1);
        int height = FRAME_SMALLEST_FONT_HEIGHT (f1);
  
!       /* Arrange for the division in FRAME_PIXEL_X_TO_COL etc. to
         round down even for negative values.  */
        if (gx < 0)
        gx -= width - 1;
***************
*** 3572,3602 ****
    struct frame *f = XFRAME (w->frame);
    struct scroll_bar *bar;
    int top, height, left, sb_left, width, sb_width;
!   int window_x, window_y, window_width, window_height;
  
    /* Get window dimensions.  */
!   window_box (w, -1, &window_x, &window_y, &window_width, &window_height);
    top  = window_y;
!   width = FRAME_SCROLL_BAR_COLS (f) * CANON_X_UNIT (f);
    height = window_height;
  
    /* Compute the left edge of the scroll bar area.  */
!   if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f))
!     left = XINT (w->left) + XINT (w->width) - FRAME_SCROLL_BAR_COLS (f);
!   else
!     left = XFASTINT (w->left);
!   left *= CANON_X_UNIT (f);
!   left += FRAME_INTERNAL_BORDER_WIDTH (f);
  
    /* Compute the width of the scroll bar which might be less than
       the width of the area reserved for the scroll bar.  */
!   if (FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0)
!     sb_width = FRAME_SCROLL_BAR_PIXEL_WIDTH (f);
    else
      sb_width = width;
  
    /* Compute the left edge of the scroll bar.  */
!   if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f))
      sb_left = left + width - sb_width - (width - sb_width) / 2;
    else
      sb_left = left + (width - sb_width) / 2;
--- 3575,3600 ----
    struct frame *f = XFRAME (w->frame);
    struct scroll_bar *bar;
    int top, height, left, sb_left, width, sb_width;
!   int window_y, window_height;
  
    /* Get window dimensions.  */
!   window_box (w, -1, 0, &window_y, 0, &window_height);
    top  = window_y;
!   width = WINDOW_CONFIG_SCROLL_BAR_COLS (w) * FRAME_COLUMN_WIDTH (f);
    height = window_height;
  
    /* Compute the left edge of the scroll bar area.  */
!   left = WINDOW_SCROLL_BAR_AREA_X (w);
  
    /* Compute the width of the scroll bar which might be less than
       the width of the area reserved for the scroll bar.  */
!   if (WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) > 0)
!     sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
    else
      sb_width = width;
  
    /* Compute the left edge of the scroll bar.  */
!   if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
      sb_left = left + width - sb_width - (width - sb_width) / 2;
    else
      sb_left = left + (width - sb_width) / 2;
***************
*** 4248,4254 ****
                  int x = LOWORD (msg.msg.lParam);
                  int y = HIWORD (msg.msg.lParam);
  
!                 window = window_from_coordinates (f, x, y, 0, 0);
  
                  /* Window will be selected only when it is not
                     selected now and last mouse movement event was
--- 4246,4252 ----
                  int x = LOWORD (msg.msg.lParam);
                  int y = HIWORD (msg.msg.lParam);
  
!                 window = window_from_coordinates (f, x, y, 0, 0, 0, 0);
  
                  /* Window will be selected only when it is not
                     selected now and last mouse movement event was
***************
*** 4333,4345 ****
  
                  /* Is this in the tool-bar?  */
                  if (WINDOWP (f->tool_bar_window)
!                     && XFASTINT (XWINDOW (f->tool_bar_window)->height))
                    {
                      Lisp_Object window;
                    int x = XFASTINT (emacs_event.x);
                    int y = XFASTINT (emacs_event.y);
  
!                     window = window_from_coordinates (f, x, y, 0, 1);
  
                      if (EQ (window, f->tool_bar_window))
                        {
--- 4331,4343 ----
  
                  /* Is this in the tool-bar?  */
                  if (WINDOWP (f->tool_bar_window)
!                     && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window)))
                    {
                      Lisp_Object window;
                    int x = XFASTINT (emacs_event.x);
                    int y = XFASTINT (emacs_event.y);
  
!                     window = window_from_coordinates (f, x, y, 0, 0, 0, 1);
  
                      if (EQ (window, f->tool_bar_window))
                        {
***************
*** 4439,4447 ****
          if (f)
            {
              x_check_fullscreen_move(f);
!             if (f->output_data.w32->want_fullscreen & FULLSCREEN_WAIT)
!               f->output_data.w32->want_fullscreen &=
!                 ~(FULLSCREEN_WAIT|FULLSCREEN_BOTH);
            }
          check_visibility = 1;
          break;
--- 4437,4444 ----
          if (f)
            {
              x_check_fullscreen_move(f);
!             if (f->want_fullscreen & FULLSCREEN_WAIT)
!               f->want_fullscreen &= ~(FULLSCREEN_WAIT|FULLSCREEN_BOTH);
            }
          check_visibility = 1;
          break;
***************
*** 4462,4469 ****
              int x, y;
  
              x_real_positions (f, &x, &y);
!             f->output_data.w32->left_pos = x;
!             f->output_data.w32->top_pos = y;
            }
  
          check_visibility = 1;
--- 4459,4466 ----
              int x, y;
  
              x_real_positions (f, &x, &y);
!             f->left_pos = x;
!             f->top_pos = y;
            }
  
          check_visibility = 1;
***************
*** 4535,4542 ****
                           when the Window is iconified, with 3000,3000
                           as the co-ords. */
                        x_real_positions (f, &x, &y);
!                       f->output_data.w32->left_pos = x;
!                       f->output_data.w32->top_pos = y;
  
                      bufp->kind = DEICONIFY_EVENT;
                      XSETFRAME (bufp->frame_or_window, f);
--- 4532,4539 ----
                           when the Window is iconified, with 3000,3000
                           as the co-ords. */
                        x_real_positions (f, &x, &y);
!                       f->left_pos = x;
!                       f->top_pos = y;
  
                      bufp->kind = DEICONIFY_EVENT;
                      XSETFRAME (bufp->frame_or_window, f);
***************
*** 4568,4575 ****
              height = rect.bottom - rect.top;
              width = rect.right - rect.left;
  
!             rows = PIXEL_TO_CHAR_HEIGHT (f, height);
!             columns = PIXEL_TO_CHAR_WIDTH (f, width);
  
              /* TODO: Clip size to the screen dimensions.  */
  
--- 4565,4572 ----
              height = rect.bottom - rect.top;
              width = rect.right - rect.left;
  
!             rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height);
!             columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width);
  
              /* TODO: Clip size to the screen dimensions.  */
  
***************
*** 4577,4593 ****
                 not changed, the font size may have changed, so we need
                 to check the pixel dimensions as well.  */
  
!             if (columns != f->width
!                 || rows != f->height
!                 || width != f->output_data.w32->pixel_width
!                 || height != f->output_data.w32->pixel_height)
                {
                  change_frame_size (f, rows, columns, 0, 1, 0);
                  SET_FRAME_GARBAGED (f);
                  cancel_mouse_face (f);
!                 f->output_data.w32->pixel_width = width;
!                 f->output_data.w32->pixel_height = height;
!                 f->output_data.w32->win_gravity = NorthWestGravity;
                }
            }
  
--- 4574,4590 ----
                 not changed, the font size may have changed, so we need
                 to check the pixel dimensions as well.  */
  
!             if (columns != FRAME_COLS (f)
!                 || rows != FRAME_LINES (f)
!                 || width != FRAME_PIXEL_WIDTH (f)
!                 || height != FRAME_PIXEL_HEIGHT (f))
                {
                  change_frame_size (f, rows, columns, 0, 1, 0);
                  SET_FRAME_GARBAGED (f);
                  cancel_mouse_face (f);
!                 FRAME_PIXEL_WIDTH (f) = width;
!                 FRAME_PIXEL_HEIGHT (f) = height;
!                 f->win_gravity = NorthWestGravity;
                }
            }
  
***************
*** 4868,4892 ****
  
  /* Set clipping for output in glyph row ROW.  W is the window in which
     we operate.  GC is the graphics context to set clipping in.
-    WHOLE_LINE_P non-zero means include the areas used for truncation
-    mark display and alike in the clipping rectangle.
  
     ROW may be a text row or, e.g., a mode line.  Text rows must be
     clipped to the interior of the window dedicated to text display,
     mode lines must be clipped to the whole window.  */
  
  static void
! w32_clip_to_row (w, row, hdc, whole_line_p)
       struct window *w;
       struct glyph_row *row;
       HDC hdc;
-      int whole_line_p;
  {
    struct frame *f = XFRAME (WINDOW_FRAME (w));
    RECT clip_rect;
!   int window_x, window_y, window_width, window_height;
  
!   window_box (w, -1, &window_x, &window_y, &window_width, &window_height);
  
    clip_rect.left = WINDOW_TO_FRAME_PIXEL_X (w, 0);
    clip_rect.top = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
--- 4865,4886 ----
  
  /* Set clipping for output in glyph row ROW.  W is the window in which
     we operate.  GC is the graphics context to set clipping in.
  
     ROW may be a text row or, e.g., a mode line.  Text rows must be
     clipped to the interior of the window dedicated to text display,
     mode lines must be clipped to the whole window.  */
  
  static void
! w32_clip_to_row (w, row, hdc)
       struct window *w;
       struct glyph_row *row;
       HDC hdc;
  {
    struct frame *f = XFRAME (WINDOW_FRAME (w));
    RECT clip_rect;
!   int window_y, window_width;
  
!   window_box (w, -1, 0, &window_y, &window_width, 0);
  
    clip_rect.left = WINDOW_TO_FRAME_PIXEL_X (w, 0);
    clip_rect.top = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
***************
*** 4894,4907 ****
    clip_rect.right = clip_rect.left + window_width;
    clip_rect.bottom = clip_rect.top + row->visible_height;
  
-   /* If clipping to the whole line, including trunc marks, extend
-      the rectangle to the left and increase its width.  */
-   if (whole_line_p)
-     {
-       clip_rect.left -= FRAME_X_LEFT_FRINGE_WIDTH (f);
-       clip_rect.right += FRAME_X_FRINGE_WIDTH (f);
-     }
- 
    w32_set_clip_rectangle (hdc, &clip_rect);
  }
  
--- 4888,4893 ----
***************
*** 4940,4952 ****
    wd = cursor_glyph->pixel_width;
    if (cursor_glyph->type == STRETCH_GLYPH
        && !x_stretch_cursor_p)
!     wd = min (CANON_X_UNIT (f), wd);
    w->phys_cursor_width = wd;
  
    rect.right = rect.left + wd;
    hdc = get_frame_dc (f);
    /* Set clipping, draw the rectangle, and reset clipping again.  */
!   w32_clip_to_row (w, row, hdc, 0);
    FrameRect (hdc, &rect, hb);
    DeleteObject (hb);
    w32_set_clip_rectangle (hdc, NULL);
--- 4926,4938 ----
    wd = cursor_glyph->pixel_width;
    if (cursor_glyph->type == STRETCH_GLYPH
        && !x_stretch_cursor_p)
!     wd = min (FRAME_COLUMN_WIDTH (f), wd);
    w->phys_cursor_width = wd;
  
    rect.right = rect.left + wd;
    hdc = get_frame_dc (f);
    /* Set clipping, draw the rectangle, and reset clipping again.  */
!   w32_clip_to_row (w, row, hdc);
    FrameRect (hdc, &rect, hb);
    DeleteObject (hb);
    w32_set_clip_rectangle (hdc, NULL);
***************
*** 5012,5018 ****
  
  
        hdc = get_frame_dc (f);
!       w32_clip_to_row (w, row, hdc, 0);
  
        if (kind == BAR_CURSOR)
        {
--- 4998,5004 ----
  
  
        hdc = get_frame_dc (f);
!       w32_clip_to_row (w, row, hdc);
  
        if (kind == BAR_CURSOR)
        {
***************
*** 5241,5269 ****
    FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset;
    FRAME_FONTSET (f) = -1;
  
    /* Compute the scroll bar width in character columns.  */
!   if (f->scroll_bar_pixel_width > 0)
      {
!       int wid = FONT_WIDTH (FRAME_FONT (f));
!       f->scroll_bar_cols = (f->scroll_bar_pixel_width + wid-1) / wid;
      }
    else
      {
!       int wid = FONT_WIDTH (FRAME_FONT (f));
!       f->scroll_bar_cols = (14 + wid - 1) / wid;
      }
  
    /* Now make the frame display the given font.  */
    if (FRAME_W32_WINDOW (f) != 0)
      {
-       frame_update_line_height (f);
        if (NILP (tip_frame) || XFRAME (tip_frame) != f)
!         x_set_window_size (f, 0, f->width, f->height);
      }
-   else
-     /* If we are setting a new frame's font for the first time,
-        there are no faces yet, so this font's height is the line height.  */
-     f->output_data.w32->line_height = FONT_HEIGHT (FRAME_FONT (f));
  
    return build_string (fontp->full_name);
  }
--- 5227,5256 ----
    FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset;
    FRAME_FONTSET (f) = -1;
  
+   FRAME_COLUMN_WIDTH (f) = FONT_WIDTH (FRAME_FONT (f));
+   FRAME_LINE_HEIGHT (f) = FONT_HEIGHT (FRAME_FONT (f));
+ 
+   compute_fringe_widths (f, 1);
+ 
    /* Compute the scroll bar width in character columns.  */
!   if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0)
      {
!       int wid = FRAME_COLUMN_WIDTH (f);
!       FRAME_CONFIG_SCROLL_BAR_COLS (f)
!       = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + wid-1) / wid;
      }
    else
      {
!       int wid = FRAME_COLUMN_WIDTH (f);
!       FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid;
      }
  
    /* Now make the frame display the given font.  */
    if (FRAME_W32_WINDOW (f) != 0)
      {
        if (NILP (tip_frame) || XFRAME (tip_frame) != f)
!         x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
      }
  
    return build_string (fontp->full_name);
  }
***************
*** 5325,5331 ****
       struct frame *f;
  {
    POINT pt;
!   int flags = f->output_data.w32->size_hint_flags;
  
    pt.x = pt.y = 0;
  
--- 5312,5318 ----
       struct frame *f;
  {
    POINT pt;
!   int flags = f->size_hint_flags;
  
    pt.x = pt.y = 0;
  
***************
*** 5357,5376 ****
    /* Treat negative positions as relative to the leftmost bottommost
       position that fits on the screen.  */
    if (flags & XNegative)
!     f->output_data.w32->left_pos = (FRAME_W32_DISPLAY_INFO (f)->width
!                             - 2 * f->output_data.w32->border_width - pt.x
!                             - PIXEL_WIDTH (f)
!                             + f->output_data.w32->left_pos);
  
    if (flags & YNegative)
!     f->output_data.w32->top_pos = (FRAME_W32_DISPLAY_INFO (f)->height
!                            - 2 * f->output_data.w32->border_width - pt.y
!                            - PIXEL_HEIGHT (f)
!                            + f->output_data.w32->top_pos);
    /* The left_pos and top_pos
       are now relative to the top and left screen edges,
       so the flags should correspond.  */
!   f->output_data.w32->size_hint_flags &= ~ (XNegative | YNegative);
  }
  
  /* CHANGE_GRAVITY is 1 when calling from Fset_frame_position,
--- 5344,5363 ----
    /* Treat negative positions as relative to the leftmost bottommost
       position that fits on the screen.  */
    if (flags & XNegative)
!     f->left_pos = (FRAME_W32_DISPLAY_INFO (f)->width
!                  - 2 * f->border_width - pt.x
!                  - FRAME_PIXEL_WIDTH (f)
!                  + f->left_pos);
  
    if (flags & YNegative)
!     f->top_pos = (FRAME_W32_DISPLAY_INFO (f)->height
!                 - 2 * f->border_width - pt.y
!                 - FRAME_PIXEL_HEIGHT (f)
!                 + f->top_pos);
    /* The left_pos and top_pos
       are now relative to the top and left screen edges,
       so the flags should correspond.  */
!   f->size_hint_flags &= ~ (XNegative | YNegative);
  }
  
  /* CHANGE_GRAVITY is 1 when calling from Fset_frame_position,
***************
*** 5389,5410 ****
  
    if (change_gravity > 0)
      {
!       f->output_data.w32->top_pos = yoff;
!       f->output_data.w32->left_pos = xoff;
!       f->output_data.w32->size_hint_flags &= ~ (XNegative | YNegative);
        if (xoff < 0)
!       f->output_data.w32->size_hint_flags |= XNegative;
        if (yoff < 0)
!       f->output_data.w32->size_hint_flags |= YNegative;
!       f->output_data.w32->win_gravity = NorthWestGravity;
      }
    x_calc_absolute_position (f);
  
    BLOCK_INPUT;
    x_wm_set_size_hint (f, (long) 0, 0);
  
!   modified_left = f->output_data.w32->left_pos;
!   modified_top = f->output_data.w32->top_pos;
  
    my_set_window_pos (FRAME_W32_WINDOW (f),
                     NULL,
--- 5376,5397 ----
  
    if (change_gravity > 0)
      {
!       f->top_pos = yoff;
!       f->left_pos = xoff;
!       f->size_hint_flags &= ~ (XNegative | YNegative);
        if (xoff < 0)
!       f->size_hint_flags |= XNegative;
        if (yoff < 0)
!       f->size_hint_flags |= YNegative;
!       f->win_gravity = NorthWestGravity;
      }
    x_calc_absolute_position (f);
  
    BLOCK_INPUT;
    x_wm_set_size_hint (f, (long) 0, 0);
  
!   modified_left = f->left_pos;
!   modified_top = f->top_pos;
  
    my_set_window_pos (FRAME_W32_WINDOW (f),
                     NULL,
***************
*** 5421,5432 ****
  x_check_fullscreen (f)
       struct frame *f;
  {
!   if (f->output_data.w32->want_fullscreen & FULLSCREEN_BOTH)
      {
        int width, height, ign;
  
!       x_real_positions (f, &f->output_data.w32->left_pos,
!                         &f->output_data.w32->top_pos);
  
        x_fullscreen_adjust (f, &width, &height, &ign, &ign);
  
--- 5408,5418 ----
  x_check_fullscreen (f)
       struct frame *f;
  {
!   if (f->want_fullscreen & FULLSCREEN_BOTH)
      {
        int width, height, ign;
  
!       x_real_positions (f, &f->left_pos, &f->top_pos);
  
        x_fullscreen_adjust (f, &width, &height, &ign, &ign);
  
***************
*** 5434,5447 ****
           when setting WM manager hints.
           If the frame is visible already, the position is checked by
           x_check_fullscreen_move. */
!       if (f->width != width || f->height != height)
          {
            change_frame_size (f, height, width, 0, 1, 0);
            SET_FRAME_GARBAGED (f);
            cancel_mouse_face (f);
  
            /* Wait for the change of frame size to occur */
!           f->output_data.w32->want_fullscreen |= FULLSCREEN_WAIT;
          }
      }
  }
--- 5420,5433 ----
           when setting WM manager hints.
           If the frame is visible already, the position is checked by
           x_check_fullscreen_move. */
!       if (FRAME_COLS (f) != width || FRAME_LINES (f) != height)
          {
            change_frame_size (f, height, width, 0, 1, 0);
            SET_FRAME_GARBAGED (f);
            cancel_mouse_face (f);
  
            /* Wait for the change of frame size to occur */
!           f->want_fullscreen |= FULLSCREEN_WAIT;
          }
      }
  }
***************
*** 5456,5477 ****
  x_check_fullscreen_move (f)
       struct frame *f;
  {
!   if (f->output_data.w32->want_fullscreen & FULLSCREEN_MOVE_WAIT)
    {
!     int expect_top = f->output_data.w32->top_pos;
!     int expect_left = f->output_data.w32->left_pos;
  
!     if (f->output_data.w32->want_fullscreen & FULLSCREEN_HEIGHT)
        expect_top = 0;
!     if (f->output_data.w32->want_fullscreen & FULLSCREEN_WIDTH)
        expect_left = 0;
  
!     if (expect_top != f->output_data.w32->top_pos
!         || expect_left != f->output_data.w32->left_pos)
        x_set_offset (f, expect_left, expect_top, 1);
  
      /* Just do this once */
!     f->output_data.w32->want_fullscreen &= ~FULLSCREEN_MOVE_WAIT;
    }
  }
  
--- 5442,5463 ----
  x_check_fullscreen_move (f)
       struct frame *f;
  {
!   if (f->want_fullscreen & FULLSCREEN_MOVE_WAIT)
    {
!     int expect_top = f->top_pos;
!     int expect_left = f->left_pos;
  
!     if (f->want_fullscreen & FULLSCREEN_HEIGHT)
        expect_top = 0;
!     if (f->want_fullscreen & FULLSCREEN_WIDTH)
        expect_left = 0;
  
!     if (expect_top != f->top_pos
!         || expect_left != f->left_pos)
        x_set_offset (f, expect_left, expect_top, 1);
  
      /* Just do this once */
!     f->want_fullscreen &= ~FULLSCREEN_MOVE_WAIT;
    }
  }
  
***************
*** 5492,5508 ****
    BLOCK_INPUT;
  
    check_frame_size (f, &rows, &cols);
!   f->output_data.w32->vertical_scroll_bar_extra
!     = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f)
!        ? 0
!        : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.w32->font)));
  
    compute_fringe_widths (f, 0);
  
!   pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols);
!   pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows);
  
!   f->output_data.w32->win_gravity = NorthWestGravity;
    x_wm_set_size_hint (f, (long) 0, 0);
  
    {
--- 5478,5492 ----
    BLOCK_INPUT;
  
    check_frame_size (f, &rows, &cols);
!   f->scroll_bar_actual_width
!     = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
  
    compute_fringe_widths (f, 0);
  
!   pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols);
!   pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
  
!   f->win_gravity = NorthWestGravity;
    x_wm_set_size_hint (f, (long) 0, 0);
  
    {
***************
*** 5537,5544 ****
       We pass 1 for DELAY since we can't run Lisp code inside of
       a BLOCK_INPUT.  */
    change_frame_size (f, rows, cols, 0, 1, 0);
!   PIXEL_WIDTH (f) = pixelwidth;
!   PIXEL_HEIGHT (f) = pixelheight;
  
    /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to
       receive in the ConfigureNotify event; if we get what we asked
--- 5521,5528 ----
       We pass 1 for DELAY since we can't run Lisp code inside of
       a BLOCK_INPUT.  */
    change_frame_size (f, rows, cols, 0, 1, 0);
!   FRAME_PIXEL_WIDTH (f) = pixelwidth;
!   FRAME_PIXEL_HEIGHT (f) = pixelheight;
  
    /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to
       receive in the ConfigureNotify event; if we get what we asked
***************
*** 5569,5582 ****
  {
    int pix_x, pix_y;
  
!   pix_x = CHAR_TO_PIXEL_COL (f, x) + FONT_WIDTH  (f->output_data.w32->font) / 
2;
!   pix_y = CHAR_TO_PIXEL_ROW (f, y) + f->output_data.w32->line_height / 2;
  
    if (pix_x < 0) pix_x = 0;
!   if (pix_x > PIXEL_WIDTH (f)) pix_x = PIXEL_WIDTH (f);
  
    if (pix_y < 0) pix_y = 0;
!   if (pix_y > PIXEL_HEIGHT (f)) pix_y = PIXEL_HEIGHT (f);
  
    x_set_mouse_pixel_position (f, pix_x, pix_y);
  }
--- 5553,5566 ----
  {
    int pix_x, pix_y;
  
!   pix_x = FRAME_COL_TO_PIXEL_X (f, x) + FRAME_COLUMN_WIDTH (f) / 2;
!   pix_y = FRAME_LINE_TO_PIXEL_Y (f, y) + FRAME_LINE_HEIGHT (f) / 2;
  
    if (pix_x < 0) pix_x = 0;
!   if (pix_x > FRAME_PIXEL_WIDTH (f)) pix_x = FRAME_PIXEL_WIDTH (f);
  
    if (pix_y < 0) pix_y = 0;
!   if (pix_y > FRAME_PIXEL_HEIGHT (f)) pix_y = FRAME_PIXEL_HEIGHT (f);
  
    x_set_mouse_pixel_position (f, pix_x, pix_y);
  }
***************
*** 5744,5750 ****
         before the window gets really visible.  */
        if (! FRAME_ICONIFIED_P (f)
          && ! f->output_data.w32->asked_for_visible)
!       x_set_offset (f, f->output_data.w32->left_pos, 
f->output_data.w32->top_pos, 0);
  
        f->output_data.w32->asked_for_visible = 1;
  
--- 5728,5734 ----
         before the window gets really visible.  */
        if (! FRAME_ICONIFIED_P (f)
          && ! f->output_data.w32->asked_for_visible)
!       x_set_offset (f, f->left_pos, f->top_pos, 0);
  
        f->output_data.w32->asked_for_visible = 1;
  
***************
*** 5932,5941 ****
  
    enter_crit ();
  
!   SetWindowLong (window, WND_FONTWIDTH_INDEX, FONT_WIDTH 
(f->output_data.w32->font));
!   SetWindowLong (window, WND_LINEHEIGHT_INDEX, 
f->output_data.w32->line_height);
!   SetWindowLong (window, WND_BORDER_INDEX, 
f->output_data.w32->internal_border_width);
!   SetWindowLong (window, WND_SCROLLBAR_INDEX, 
f->output_data.w32->vertical_scroll_bar_extra);
  
    leave_crit ();
  }
--- 5916,5925 ----
  
    enter_crit ();
  
!   SetWindowLong (window, WND_FONTWIDTH_INDEX, FRAME_COLUMN_WIDTH (f));
!   SetWindowLong (window, WND_LINEHEIGHT_INDEX, FRAME_LINE_HEIGHT (f));
!   SetWindowLong (window, WND_BORDER_INDEX, FRAME_INTERNAL_BORDER_WIDTH (f));
!   SetWindowLong (window, WND_SCROLLBAR_INDEX, f->scroll_bar_actual_width);
  
    leave_crit ();
  }




reply via email to

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