/[emacs]/emacs/src/xterm.c
ViewVC logotype

Diff of /emacs/src/xterm.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.793 by fx, Wed May 21 22:11:50 2003 UTC revision 1.794 by kfstorm, Sat May 24 22:10:17 2003 UTC
# Line 346  static void x_draw_hollow_cursor P_ ((st Line 346  static void x_draw_hollow_cursor P_ ((st
346  static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int,  static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int,
347                                     enum text_cursor_kinds));                                     enum text_cursor_kinds));
348    
349  static void x_clip_to_row P_ ((struct window *, struct glyph_row *,  static void x_clip_to_row P_ ((struct window *, struct glyph_row *, GC));
                                GC, int));  
350  static void x_flush P_ ((struct frame *f));  static void x_flush P_ ((struct frame *f));
351  static void x_update_begin P_ ((struct frame *));  static void x_update_begin P_ ((struct frame *));
352  static void x_update_window_begin P_ ((struct window *));  static void x_update_window_begin P_ ((struct window *));
# Line 675  x_after_update_window_line (desired_row) Line 674  x_after_update_window_line (desired_row)
674        x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),        x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
675                      0, y, width, height, False);                      0, y, width, height, False);
676        x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),        x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
677                      f->output_data.x->pixel_width - width,                      FRAME_PIXEL_WIDTH (f) - width,
678                      y, width, height, False);                      y, width, height, False);
679        UNBLOCK_INPUT;        UNBLOCK_INPUT;
680      }      }
# Line 694  x_draw_fringe_bitmap (w, row, p) Line 693  x_draw_fringe_bitmap (w, row, p)
693    struct face *face = p->face;    struct face *face = p->face;
694    
695    /* Must clip because of partially visible lines.  */    /* Must clip because of partially visible lines.  */
696    x_clip_to_row (w, row, gc, 1);    x_clip_to_row (w, row, gc);
697    
698    if (p->bx >= 0)    if (p->bx >= 0)
699      {      {
# Line 2078  x_draw_glyph_string_box (s) Line 2077  x_draw_glyph_string_box (s)
2077    if (s->row->full_width_p    if (s->row->full_width_p
2078        && !s->w->pseudo_window_p)        && !s->w->pseudo_window_p)
2079      {      {
2080        last_x += FRAME_X_RIGHT_FRINGE_WIDTH (s->f);        last_x += WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH (s->w);
2081        if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (s->f))        if (s->area != RIGHT_MARGIN_AREA
2082          last_x += FRAME_SCROLL_BAR_WIDTH (s->f) * CANON_X_UNIT (s->f);            || WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (s->w))
2083            last_x += WINDOW_RIGHT_FRINGE_WIDTH (s->w);
2084      }      }
2085    
2086    /* The glyph that may have a right box line.  */    /* The glyph that may have a right box line.  */
# Line 2468  x_draw_stretch_glyph_string (s) Line 2468  x_draw_stretch_glyph_string (s)
2468      {      {
2469        /* If `x-stretch-block-cursor' is nil, don't draw a block cursor        /* If `x-stretch-block-cursor' is nil, don't draw a block cursor
2470           as wide as the stretch glyph.  */           as wide as the stretch glyph.  */
2471        int width = min (CANON_X_UNIT (s->f), s->background_width);        int width = min (FRAME_COLUMN_WIDTH (s->f), s->background_width);
2472    
2473        /* Draw cursor.  */        /* Draw cursor.  */
2474        x_draw_glyph_string_bg_rect (s, s->x, s->y, width, s->height);        x_draw_glyph_string_bg_rect (s, s->x, s->y, width, s->height);
# Line 2821  XTflash (f) Line 2821  XTflash (f)
2821    
2822      {      {
2823        /* Get the height not including a menu bar widget.  */        /* Get the height not including a menu bar widget.  */
2824        int height = CHAR_TO_PIXEL_HEIGHT (f, FRAME_HEIGHT (f));        int height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, FRAME_LINES (f));
2825        /* Height of each line to flash.  */        /* Height of each line to flash.  */
2826        int flash_height = FRAME_LINE_HEIGHT (f);        int flash_height = FRAME_LINE_HEIGHT (f);
2827        /* These will be the left and right margins of the rectangles.  */        /* These will be the left and right margins of the rectangles.  */
2828        int flash_left = FRAME_INTERNAL_BORDER_WIDTH (f);        int flash_left = FRAME_INTERNAL_BORDER_WIDTH (f);
2829        int flash_right = PIXEL_WIDTH (f) - FRAME_INTERNAL_BORDER_WIDTH (f);        int flash_right = FRAME_PIXEL_WIDTH (f) - FRAME_INTERNAL_BORDER_WIDTH (f);
2830    
2831        int width;        int width;
2832    
# Line 2854  XTflash (f) Line 2854  XTflash (f)
2854            XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,            XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
2855                            flash_left,                            flash_left,
2856                            (FRAME_INTERNAL_BORDER_WIDTH (f)                            (FRAME_INTERNAL_BORDER_WIDTH (f)
2857                             + FRAME_TOOL_BAR_LINES (f) * CANON_Y_UNIT (f)),                             + FRAME_TOOL_BAR_LINES (f) * FRAME_LINE_HEIGHT (f)),
2858                            width, flash_height);                            width, flash_height);
2859            XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,            XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
2860                            flash_left,                            flash_left,
# Line 2908  XTflash (f) Line 2908  XTflash (f)
2908            XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,            XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
2909                            flash_left,                            flash_left,
2910                            (FRAME_INTERNAL_BORDER_WIDTH (f)                            (FRAME_INTERNAL_BORDER_WIDTH (f)
2911                             + FRAME_TOOL_BAR_LINES (f) * CANON_Y_UNIT (f)),                             + FRAME_TOOL_BAR_LINES (f) * FRAME_LINE_HEIGHT (f)),
2912                            width, flash_height);                            width, flash_height);
2913            XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,            XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc,
2914                            flash_left,                            flash_left,
# Line 3000  x_scroll_run (w, run) Line 3000  x_scroll_run (w, run)
3000       without mode lines.  Include in this box the left and right       without mode lines.  Include in this box the left and right
3001       fringe of W.  */       fringe of W.  */
3002    window_box (w, -1, &x, &y, &width, &height);    window_box (w, -1, &x, &y, &width, &height);
   width += FRAME_X_FRINGE_WIDTH (f);  
   x -= FRAME_X_LEFT_FRINGE_WIDTH (f);  
3003    
3004    from_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->current_y);    from_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->current_y);
3005    to_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->desired_y);    to_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->desired_y);
# Line 3576  glyph_rect (f, x, y, rect) Line 3574  glyph_rect (f, x, y, rect)
3574    Lisp_Object window;    Lisp_Object window;
3575    int found = 0;    int found = 0;
3576    
3577    window = window_from_coordinates (f, x, y, 0, 0);    window = window_from_coordinates (f, x, y, 0, &x, &y, 0);
3578    if (!NILP (window))    if (!NILP (window))
3579      {      {
3580        struct window *w = XWINDOW (window);        struct window *w = XWINDOW (window);
3581        struct glyph_row *r = MATRIX_FIRST_TEXT_ROW (w->current_matrix);        struct glyph_row *r = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
3582        struct glyph_row *end = r + w->current_matrix->nrows - 1;        struct glyph_row *end = r + w->current_matrix->nrows - 1;
3583    
       frame_to_window_pixel_xy (w, &x, &y);  
   
3584        for (; !found && r < end && r->enabled_p; ++r)        for (; !found && r < end && r->enabled_p; ++r)
3585          if (r->y >= y)          if (r->y >= y)
3586            {            {
# Line 3804  XTmouse_position (fp, insist, bar_window Line 3800  XTmouse_position (fp, insist, bar_window
3800                  gx = win_x;                  gx = win_x;
3801                  gy = win_y;                  gy = win_y;
3802    
3803                  /* Arrange for the division in PIXEL_TO_CHAR_COL etc. to                  /* Arrange for the division in FRAME_PIXEL_X_TO_COL etc. to
3804                     round down even for negative values.  */                     round down even for negative values.  */
3805                  if (gx < 0)                  if (gx < 0)
3806                    gx -= width - 1;                    gx -= width - 1;
# Line 4590  x_set_toolkit_scroll_bar_thumb (bar, por Line 4586  x_set_toolkit_scroll_bar_thumb (bar, por
4586       its size, the update will often happen too late.       its size, the update will often happen too late.
4587       If you don't believe it, check out revision 1.650 of xterm.c to see       If you don't believe it, check out revision 1.650 of xterm.c to see
4588       what hoops we were going through and the still poor behavior we got.  */       what hoops we were going through and the still poor behavior we got.  */
4589    portion = XFASTINT (XWINDOW (bar->window)->height) * 30;    portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
4590    /* When the thumb is at the bottom, position == whole.    /* When the thumb is at the bottom, position == whole.
4591       So we need to increase `whole' to make space for the thumb.  */       So we need to increase `whole' to make space for the thumb.  */
4592    whole += portion;    whole += portion;
# Line 4958  XTset_vertical_scroll_bar (w, portion, w Line 4954  XTset_vertical_scroll_bar (w, portion, w
4954    struct frame *f = XFRAME (w->frame);    struct frame *f = XFRAME (w->frame);
4955    struct scroll_bar *bar;    struct scroll_bar *bar;
4956    int top, height, left, sb_left, width, sb_width;    int top, height, left, sb_left, width, sb_width;
4957    int window_x, window_y, window_width, window_height;    int window_y, window_height;
4958    
4959    /* Get window dimensions.  */    /* Get window dimensions.  */
4960    window_box (w, -1, &window_x, &window_y, &window_width, &window_height);    window_box (w, -1, 0, &window_y, 0, &window_height);
4961    top = window_y;    top = window_y;
4962    width = FRAME_SCROLL_BAR_COLS (f) * CANON_X_UNIT (f);    width = WINDOW_CONFIG_SCROLL_BAR_COLS (w) * FRAME_COLUMN_WIDTH (f);
4963    height = window_height;    height = window_height;
4964    
4965    /* Compute the left edge of the scroll bar area.  */    /* Compute the left edge of the scroll bar area.  */
4966    if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f))    left = WINDOW_SCROLL_BAR_AREA_X (w);
     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);  
4967    
4968    /* Compute the width of the scroll bar which might be less than    /* Compute the width of the scroll bar which might be less than
4969       the width of the area reserved for the scroll bar.  */       the width of the area reserved for the scroll bar.  */
4970    if (FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0)    if (WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) > 0)
4971      sb_width = FRAME_SCROLL_BAR_PIXEL_WIDTH (f);      sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
4972    else    else
4973      sb_width = width;      sb_width = width;
4974    
4975    /* Compute the left edge of the scroll bar.  */    /* Compute the left edge of the scroll bar.  */
4976  #ifdef USE_TOOLKIT_SCROLL_BARS  #ifdef USE_TOOLKIT_SCROLL_BARS
4977    if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f))    if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
4978      sb_left = left + width - sb_width - (width - sb_width) / 2;      sb_left = left + width - sb_width - (width - sb_width) / 2;
4979    else    else
4980      sb_left = left + (width - sb_width) / 2;      sb_left = left + (width - sb_width) / 2;
4981  #else  #else
4982    if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f))    if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
4983      sb_left = left + width - sb_width;      sb_left = left + width - sb_width;
4984    else    else
4985      sb_left = left;      sb_left = left;
# Line 5073  XTset_vertical_scroll_bar (w, portion, w Line 5064  XTset_vertical_scroll_bar (w, portion, w
5064           previous mode line display is cleared after C-x 2 C-x 1, for           previous mode line display is cleared after C-x 2 C-x 1, for
5065           example.  */           example.  */
5066        {        {
5067          int area_width = FRAME_SCROLL_BAR_COLS (f) * CANON_X_UNIT (f);          int area_width = WINDOW_CONFIG_SCROLL_BAR_COLS (w) * FRAME_COLUMN_WIDTH (f);
5068          int rest = area_width - sb_width;          int rest = area_width - sb_width;
5069          if (rest > 0 && height > 0)          if (rest > 0 && height > 0)
5070            {            {
5071              if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f))              if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
5072                x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),                x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
5073                              left + area_width -  rest, top,                              left + area_width -  rest, top,
5074                              rest, height, False);                              rest, height, False);
# Line 5864  handle_one_xevent (dpyinfo, eventp, bufp Line 5855  handle_one_xevent (dpyinfo, eventp, bufp
5855    
5856              if (f)              if (f)
5857                {                {
5858                  f->output_data.x->left_pos = new_x;                  f->left_pos = new_x;
5859                  f->output_data.x->top_pos = new_y;                  f->top_pos = new_y;
5860                }                }
5861            }            }
5862  #ifdef HACK_EDITRES  #ifdef HACK_EDITRES
# Line 5992  handle_one_xevent (dpyinfo, eventp, bufp Line 5983  handle_one_xevent (dpyinfo, eventp, bufp
5983            int x, y;            int x, y;
5984            f->output_data.x->parent_desc = event.xreparent.parent;            f->output_data.x->parent_desc = event.xreparent.parent;
5985            x_real_positions (f, &x, &y);            x_real_positions (f, &x, &y);
5986            f->output_data.x->left_pos = x;            f->left_pos = x;
5987            f->output_data.x->top_pos = y;            f->top_pos = y;
5988          }          }
5989        goto OTHER;        goto OTHER;
5990        break;        break;
# Line 6012  handle_one_xevent (dpyinfo, eventp, bufp Line 6003  handle_one_xevent (dpyinfo, eventp, bufp
6003                SET_FRAME_GARBAGED (f);                SET_FRAME_GARBAGED (f);
6004              }              }
6005            else            else
6006              expose_frame (x_window_to_frame (dpyinfo,              expose_frame (f,
6007                                               event.xexpose.window),                            event.xexpose.x, event.xexpose.y,
                           event.xexpose.x, event.xexpose.y,  
6008                            event.xexpose.width, event.xexpose.height);                            event.xexpose.width, event.xexpose.height);
6009          }          }
6010        else        else
# Line 6659  handle_one_xevent (dpyinfo, eventp, bufp Line 6649  handle_one_xevent (dpyinfo, eventp, bufp
6649    
6650                  window = window_from_coordinates (f,                  window = window_from_coordinates (f,
6651                                                    event.xmotion.x, event.xmotion.y,                                                    event.xmotion.x, event.xmotion.y,
6652                                                    0, 0);                                                    0, 0, 0, 0);
6653    
6654                  /* Window will be selected only when it is not selected now and                  /* Window will be selected only when it is not selected now and
6655                     last mouse movement event was not in it.  Minibuffer window                     last mouse movement event was not in it.  Minibuffer window
# Line 6730  handle_one_xevent (dpyinfo, eventp, bufp Line 6720  handle_one_xevent (dpyinfo, eventp, bufp
6720               do this one, the right one will come later.               do this one, the right one will come later.
6721               The toolkit version doesn't seem to need this, but we               The toolkit version doesn't seem to need this, but we
6722               need to reset it below.  */               need to reset it below.  */
6723            int dont_resize =            int dont_resize
6724              ((f->output_data.x->want_fullscreen & FULLSCREEN_WAIT)              = ((f->want_fullscreen & FULLSCREEN_WAIT)
6725               && FRAME_NEW_WIDTH (f) != 0);                 && f->new_text_cols != 0);
6726            int rows = PIXEL_TO_CHAR_HEIGHT (f, event.xconfigure.height);            int rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, event.xconfigure.height);
6727            int columns = PIXEL_TO_CHAR_WIDTH (f, event.xconfigure.width);            int columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, event.xconfigure.width);
6728    
6729            if (dont_resize)            if (dont_resize)
6730              goto OTHER;              goto OTHER;
6731    
# Line 6745  handle_one_xevent (dpyinfo, eventp, bufp Line 6736  handle_one_xevent (dpyinfo, eventp, bufp
6736            /* Even if the number of character rows and columns has            /* Even if the number of character rows and columns has
6737               not changed, the font size may have changed, so we need               not changed, the font size may have changed, so we need
6738               to check the pixel dimensions as well.  */               to check the pixel dimensions as well.  */
6739            if (columns != f->width            if (columns != FRAME_COLS (f)
6740                || rows != f->height                || rows != FRAME_LINES (f)
6741                || event.xconfigure.width != f->output_data.x->pixel_width                || event.xconfigure.width != FRAME_PIXEL_WIDTH (f)
6742                || event.xconfigure.height != f->output_data.x->pixel_height)                || event.xconfigure.height != FRAME_PIXEL_HEIGHT (f))
6743              {              {
6744                change_frame_size (f, rows, columns, 0, 1, 0);                change_frame_size (f, rows, columns, 0, 1, 0);
6745                SET_FRAME_GARBAGED (f);                SET_FRAME_GARBAGED (f);
# Line 6757  handle_one_xevent (dpyinfo, eventp, bufp Line 6748  handle_one_xevent (dpyinfo, eventp, bufp
6748  #endif /* not USE_GTK */  #endif /* not USE_GTK */
6749  #endif  #endif
6750    
6751            f->output_data.x->pixel_width = event.xconfigure.width;            FRAME_PIXEL_WIDTH (f) = event.xconfigure.width;
6752            f->output_data.x->pixel_height = event.xconfigure.height;            FRAME_PIXEL_HEIGHT (f) = event.xconfigure.height;
6753    
6754  #ifdef USE_GTK  #ifdef USE_GTK
6755            /* GTK creates windows but doesn't map them.            /* GTK creates windows but doesn't map them.
6756               Only get real positions and check fullscreen when mapped. */               Only get real positions and check fullscreen when mapped. */
6757            if (FRAME_GTK_OUTER_WIDGET (f)            if (FRAME_GTK_OUTER_WIDGET (f)
6758                && GTK_WIDGET_MAPPED (FRAME_GTK_OUTER_WIDGET (f)))                && GTK_WIDGET_MAPPED (FRAME_GTK_OUTER_WIDGET (f)))
             {  
6759  #endif  #endif
6760            /* What we have now is the position of Emacs's own window.              {
6761               Convert that to the position of the window manager window.  */                /* What we have now is the position of Emacs's own window.
6762            x_real_positions (f, &f->output_data.x->left_pos,                   Convert that to the position of the window manager window.  */
6763                              &f->output_data.x->top_pos);                x_real_positions (f, &f->left_pos, &f->top_pos);
6764    
6765            x_check_fullscreen_move (f);                x_check_fullscreen_move (f);
6766            if (f->output_data.x->want_fullscreen & FULLSCREEN_WAIT)                if (f->want_fullscreen & FULLSCREEN_WAIT)
6767              f->output_data.x->want_fullscreen &=                  f->want_fullscreen &= ~(FULLSCREEN_WAIT|FULLSCREEN_BOTH);
               ~(FULLSCREEN_WAIT|FULLSCREEN_BOTH);  
 #ifdef USE_GTK  
6768              }              }
6769  #endif  
6770  #ifdef HAVE_X_I18N  #ifdef HAVE_X_I18N
6771            if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMStatusArea))            if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMStatusArea))
6772              xic_set_statusarea (f);              xic_set_statusarea (f);
# Line 6788  handle_one_xevent (dpyinfo, eventp, bufp Line 6776  handle_one_xevent (dpyinfo, eventp, bufp
6776              {              {
6777                /* Since the WM decorations come below top_pos now,                /* Since the WM decorations come below top_pos now,
6778                   we must put them below top_pos in the future.  */                   we must put them below top_pos in the future.  */
6779                f->output_data.x->win_gravity = NorthWestGravity;                f->win_gravity = NorthWestGravity;
6780                x_wm_set_size_hint (f, (long) 0, 0);                x_wm_set_size_hint (f, (long) 0, 0);
6781              }              }
6782          }          }
# Line 6816  handle_one_xevent (dpyinfo, eventp, bufp Line 6804  handle_one_xevent (dpyinfo, eventp, bufp
6804            {            {
6805              /* Is this in the tool-bar?  */              /* Is this in the tool-bar?  */
6806              if (WINDOWP (f->tool_bar_window)              if (WINDOWP (f->tool_bar_window)
6807                  && XFASTINT (XWINDOW (f->tool_bar_window)->height))                  && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window)))
6808                {                {
6809                  Lisp_Object window;                  Lisp_Object window;
6810                  int x = event.xbutton.x;                  int x = event.xbutton.x;
6811                  int y = event.xbutton.y;                  int y = event.xbutton.y;
6812    
6813                  window = window_from_coordinates (f, x, y, 0, 1);                  window = window_from_coordinates (f, x, y, 0, 0, 0, 1);
6814                  if (EQ (window, f->tool_bar_window))                  if (EQ (window, f->tool_bar_window))
6815                    {                    {
6816                      if (event.xbutton.type == ButtonPress)                      if (event.xbutton.type == ButtonPress)
# Line 6905  handle_one_xevent (dpyinfo, eventp, bufp Line 6893  handle_one_xevent (dpyinfo, eventp, bufp
6893              /* Verify the event is really within the menu bar              /* Verify the event is really within the menu bar
6894                 and not just sent to it due to grabbing.  */                 and not just sent to it due to grabbing.  */
6895              && event.xbutton.x >= 0              && event.xbutton.x >= 0
6896              && event.xbutton.x < f->output_data.x->pixel_width              && event.xbutton.x < FRAME_PIXEL_WIDTH (f)
6897              && event.xbutton.y >= 0              && event.xbutton.y >= 0
6898              && event.xbutton.y < f->output_data.x->menubar_height              && event.xbutton.y < f->output_data.x->menubar_height
6899              && event.xbutton.same_screen)              && event.xbutton.same_screen)
# Line 7206  XTread_socket (sd, bufp, numchars, expec Line 7194  XTread_socket (sd, bufp, numchars, expec
7194    
7195  /* Set clipping for output in glyph row ROW.  W is the window in which  /* Set clipping for output in glyph row ROW.  W is the window in which
7196     we operate.  GC is the graphics context to set clipping in.     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.  
7197    
7198     ROW may be a text row or, e.g., a mode line.  Text rows must be     ROW may be a text row or, e.g., a mode line.  Text rows must be
7199     clipped to the interior of the window dedicated to text display,     clipped to the interior of the window dedicated to text display,
7200     mode lines must be clipped to the whole window.  */     mode lines must be clipped to the whole window.  */
7201    
7202  static void  static void
7203  x_clip_to_row (w, row, gc, whole_line_p)  x_clip_to_row (w, row, gc)
7204       struct window *w;       struct window *w;
7205       struct glyph_row *row;       struct glyph_row *row;
7206       GC gc;       GC gc;
      int whole_line_p;  
7207  {  {
7208    struct frame *f = XFRAME (WINDOW_FRAME (w));    struct frame *f = XFRAME (WINDOW_FRAME (w));
7209    XRectangle clip_rect;    XRectangle clip_rect;
7210    int window_x, window_y, window_width, window_height;    int window_y, window_width;
7211    
7212    window_box (w, -1, &window_x, &window_y, &window_width, &window_height);    window_box (w, -1, 0, &window_y, &window_width, 0);
7213    
7214    clip_rect.x = WINDOW_TO_FRAME_PIXEL_X (w, 0);    clip_rect.x = WINDOW_TO_FRAME_PIXEL_X (w, 0);
7215    clip_rect.y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);    clip_rect.y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
# Line 7232  x_clip_to_row (w, row, gc, whole_line_p) Line 7217  x_clip_to_row (w, row, gc, whole_line_p)
7217    clip_rect.width = window_width;    clip_rect.width = window_width;
7218    clip_rect.height = row->visible_height;    clip_rect.height = row->visible_height;
7219    
   /* 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.x -= FRAME_X_LEFT_FRINGE_WIDTH (f);  
       clip_rect.width += FRAME_X_FRINGE_WIDTH (f);  
     }  
   
7220    XSetClipRectangles (FRAME_X_DISPLAY (f), gc, 0, 0, &clip_rect, 1, Unsorted);    XSetClipRectangles (FRAME_X_DISPLAY (f), gc, 0, 0, &clip_rect, 1, Unsorted);
7221  }  }
7222    
# Line 7279  x_draw_hollow_cursor (w, row) Line 7256  x_draw_hollow_cursor (w, row)
7256    wd = cursor_glyph->pixel_width - 1;    wd = cursor_glyph->pixel_width - 1;
7257    if (cursor_glyph->type == STRETCH_GLYPH    if (cursor_glyph->type == STRETCH_GLYPH
7258        && !x_stretch_cursor_p)        && !x_stretch_cursor_p)
7259      wd = min (CANON_X_UNIT (f), wd);      wd = min (FRAME_COLUMN_WIDTH (f), wd);
7260    w->phys_cursor_width = wd;    w->phys_cursor_width = wd;
7261    
7262    /* The foreground of cursor_gc is typically the same as the normal    /* The foreground of cursor_gc is typically the same as the normal
# Line 7293  x_draw_hollow_cursor (w, row) Line 7270  x_draw_hollow_cursor (w, row)
7270    gc = dpyinfo->scratch_cursor_gc;    gc = dpyinfo->scratch_cursor_gc;
7271    
7272    /* Set clipping, draw the rectangle, and reset clipping again.  */    /* Set clipping, draw the rectangle, and reset clipping again.  */
7273    x_clip_to_row (w, row, gc, 0);    x_clip_to_row (w, row, gc);
7274    XDrawRectangle (dpy, FRAME_X_WINDOW (f), gc, x, y, wd, h);    XDrawRectangle (dpy, FRAME_X_WINDOW (f), gc, x, y, wd, h);
7275    XSetClipMask (dpy, gc, None);    XSetClipMask (dpy, gc, None);
7276  }  }
# Line 7365  x_draw_bar_cursor (w, row, width, kind) Line 7342  x_draw_bar_cursor (w, row, width, kind)
7342        width = min (cursor_glyph->pixel_width, width);        width = min (cursor_glyph->pixel_width, width);
7343    
7344        w->phys_cursor_width = width;        w->phys_cursor_width = width;
7345        x_clip_to_row (w, row, gc, 0);        x_clip_to_row (w, row, gc);
7346    
7347        if (kind == BAR_CURSOR)        if (kind == BAR_CURSOR)
7348            XFillRectangle (dpy, window, gc,            XFillRectangle (dpy, window, gc,
# Line 7884  x_new_font (f, fontname) Line 7861  x_new_font (f, fontname)
7861    if (!fontp)    if (!fontp)
7862      return Qnil;      return Qnil;
7863    
7864    f->output_data.x->font = (XFontStruct *) (fontp->font);    FRAME_FONT (f) = (XFontStruct *) (fontp->font);
7865    f->output_data.x->baseline_offset = fontp->baseline_offset;    FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset;
7866    f->output_data.x->fontset = -1;    FRAME_FONTSET (f) = -1;
7867    
7868      FRAME_COLUMN_WIDTH (f) = FONT_WIDTH (FRAME_FONT (f));
7869      FRAME_LINE_HEIGHT (f) = FONT_HEIGHT (FRAME_FONT (f));
7870    
7871    compute_fringe_widths (f, 1);    compute_fringe_widths (f, 1);
7872    
7873    /* Compute the scroll bar width in character columns.  */    /* Compute the scroll bar width in character columns.  */
7874    if (f->scroll_bar_pixel_width > 0)    if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0)
7875      {      {
7876        int wid = FONT_WIDTH (f->output_data.x->font);        int wid = FRAME_COLUMN_WIDTH (f);
7877        f->scroll_bar_cols = (f->scroll_bar_pixel_width + wid-1) / wid;        FRAME_CONFIG_SCROLL_BAR_COLS (f)
7878            = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + wid-1) / wid;
7879      }      }
7880    else    else
7881      {      {
7882        int wid = FONT_WIDTH (f->output_data.x->font);        int wid = FRAME_COLUMN_WIDTH (f);
7883        f->scroll_bar_cols = (14 + wid - 1) / wid;        FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid;
7884      }      }
7885    
7886    /* Now make the frame display the given font.  */    /* Now make the frame display the given font.  */
7887    if (FRAME_X_WINDOW (f) != 0)    if (FRAME_X_WINDOW (f) != 0)
7888      {      {
7889        XSetFont (FRAME_X_DISPLAY (f), f->output_data.x->normal_gc,        XSetFont (FRAME_X_DISPLAY (f), f->output_data.x->normal_gc,
7890                  f->output_data.x->font->fid);                  FRAME_FONT (f)->fid);
7891        XSetFont (FRAME_X_DISPLAY (f), f->output_data.x->reverse_gc,        XSetFont (FRAME_X_DISPLAY (f), f->output_data.x->reverse_gc,
7892                  f->output_data.x->font->fid);                  FRAME_FONT (f)->fid);
7893        XSetFont (FRAME_X_DISPLAY (f), f->output_data.x->cursor_gc,        XSetFont (FRAME_X_DISPLAY (f), f->output_data.x->cursor_gc,
7894                  f->output_data.x->font->fid);                  FRAME_FONT (f)->fid);
   
       frame_update_line_height (f);  
7895    
7896        /* Don't change the size of a tip frame; there's no point in        /* Don't change the size of a tip frame; there's no point in
7897           doing it because it's done in Fx_show_tip, and it leads to           doing it because it's done in Fx_show_tip, and it leads to
7898           problems because the tip frame has no widget.  */           problems because the tip frame has no widget.  */
7899        if (NILP (tip_frame) || XFRAME (tip_frame) != f)        if (NILP (tip_frame) || XFRAME (tip_frame) != f)
7900          x_set_window_size (f, 0, f->width, f->height);          x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
7901      }      }
   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.x->line_height = FONT_HEIGHT (f->output_data.x->font);  
7902    
7903    return build_string (fontp->full_name);    return build_string (fontp->full_name);
7904  }  }
# Line 7944  x_new_fontset (f, fontsetname) Line 7919  x_new_fontset (f, fontsetname)
7919    if (fontset < 0)    if (fontset < 0)
7920      return Qnil;      return Qnil;
7921    
7922    if (f->output_data.x->fontset == fontset)    if (FRAME_FONTSET (f) == fontset)
7923      /* This fontset is already set in frame F.  There's nothing more      /* This fontset is already set in frame F.  There's nothing more
7924         to do.  */         to do.  */
7925      return fontset_name (fontset);      return fontset_name (fontset);
# Line 7956  x_new_fontset (f, fontsetname) Line 7931  x_new_fontset (f, fontsetname)
7931      return Qnil;      return Qnil;
7932    
7933    /* Since x_new_font doesn't update any fontset information, do it now.  */    /* Since x_new_font doesn't update any fontset information, do it now.  */
7934    f->output_data.x->fontset = fontset;    FRAME_FONTSET (f) = fontset;
7935    
7936  #ifdef HAVE_X_I18N  #ifdef HAVE_X_I18N
7937    if (FRAME_XIC (f)    if (FRAME_XIC (f)
# Line 8191  x_calc_absolute_position (f) Line 8166  x_calc_absolute_position (f)
8166  {  {
8167    Window child;    Window child;
8168    int win_x = 0, win_y = 0;    int win_x = 0, win_y = 0;
8169    int flags = f->output_data.x->size_hint_flags;    int flags = f->size_hint_flags;
8170    int this_window;    int this_window;
8171    
8172    /* We have nothing to do if the current position    /* We have nothing to do if the current position
# Line 8249  x_calc_absolute_position (f) Line 8224  x_calc_absolute_position (f)
8224    /* Treat negative positions as relative to the leftmost bottommost    /* Treat negative positions as relative to the leftmost bottommost
8225       position that fits on the screen.  */       position that fits on the screen.  */
8226    if (flags & XNegative)    if (flags & XNegative)
8227      f->output_data.x->left_pos = (FRAME_X_DISPLAY_INFO (f)->width      f->left_pos = (FRAME_X_DISPLAY_INFO (f)->width
8228                                    - 2 * f->output_data.x->border_width - win_x                     - 2 * f->border_width - win_x
8229                                    - PIXEL_WIDTH (f)                     - FRAME_PIXEL_WIDTH (f)
8230                                    + f->output_data.x->left_pos);                     + f->left_pos);
8231    
8232    {    {
8233      int height = PIXEL_HEIGHT (f);      int height = FRAME_PIXEL_HEIGHT (f);
8234    
8235  #if defined USE_X_TOOLKIT && defined USE_MOTIF  #if defined USE_X_TOOLKIT && defined USE_MOTIF
8236      /* Something is fishy here.  When using Motif, starting Emacs with      /* Something is fishy here.  When using Motif, starting Emacs with
# Line 8274  x_calc_absolute_position (f) Line 8249  x_calc_absolute_position (f)
8249  #endif  #endif
8250    
8251    if (flags & YNegative)    if (flags & YNegative)
8252      f->output_data.x->top_pos = (FRAME_X_DISPLAY_INFO (f)->height      f->top_pos = (FRAME_X_DISPLAY_INFO (f)->height
8253                                   - 2 * f->output_data.x->border_width                    - 2 * f->border_width
8254                                   - win_y                    - win_y
8255                                   - height                    - height
8256                                   + f->output_data.x->top_pos);                    + f->top_pos);
8257    }    }
8258    
8259    /* The left_pos and top_pos    /* The left_pos and top_pos
8260       are now relative to the top and left screen edges,       are now relative to the top and left screen edges,
8261       so the flags should correspond.  */       so the flags should correspond.  */
8262    f->output_data.x->size_hint_flags &= ~ (XNegative | YNegative);    f->size_hint_flags &= ~ (XNegative | YNegative);
8263  }  }
8264    
8265  /* CHANGE_GRAVITY is 1 when calling from Fset_frame_position,  /* CHANGE_GRAVITY is 1 when calling from Fset_frame_position,
# Line 8303  x_set_offset (f, xoff, yoff, change_grav Line 8278  x_set_offset (f, xoff, yoff, change_grav
8278    
8279    if (change_gravity > 0)    if (change_gravity > 0)
8280      {      {
8281        f->output_data.x->top_pos = yoff;        f->top_pos = yoff;
8282        f->output_data.x->left_pos = xoff;        f->left_pos = xoff;
8283        f->output_data.x->size_hint_flags &= ~ (XNegative | YNegative);        f->size_hint_flags &= ~ (XNegative | YNegative);
8284        if (xoff < 0)        if (xoff < 0)
8285          f->output_data.x->size_hint_flags |= XNegative;          f->size_hint_flags |= XNegative;
8286        if (yoff < 0)        if (yoff < 0)
8287          f->output_data.x->size_hint_flags |= YNegative;          f->size_hint_flags |= YNegative;
8288        f->output_data.x->win_gravity = NorthWestGravity;        f->win_gravity = NorthWestGravity;
8289      }      }
8290    x_calc_absolute_position (f);    x_calc_absolute_position (f);
8291    
8292    BLOCK_INPUT;    BLOCK_INPUT;
8293    x_wm_set_size_hint (f, (long) 0, 0);    x_wm_set_size_hint (f, (long) 0, 0);
8294    
8295    modified_left = f->output_data.x->left_pos;    modified_left = f->left_pos;
8296    modified_top = f->output_data.x->top_pos;    modified_top = f->top_pos;
8297  #if 0 /* Running on psilocin (Debian), and displaying on the NCD X-terminal,  #if 0 /* Running on psilocin (Debian), and displaying on the NCD X-terminal,
8298           this seems to be unnecessary and incorrect.  rms, 4/17/97.  */           this seems to be unnecessary and incorrect.  rms, 4/17/97.  */
8299    /* It is a mystery why we need to add the border_width here    /* It is a mystery why we need to add the border_width here
8300       when the frame is already visible, but experiment says we do.  */       when the frame is already visible, but experiment says we do.  */
8301    if (change_gravity != 0)    if (change_gravity != 0)
8302      {      {
8303        modified_left += f->output_data.x->border_width;        modified_left += f->border_width;
8304        modified_top += f->output_data.x->border_width;        modified_top += f->border_width;
8305      }      }
8306  #endif  #endif
8307    
# Line 8341  static void Line 8316  static void
8316  x_check_fullscreen (f)  x_check_fullscreen (f)
8317       struct frame *f;       struct frame *f;
8318  {  {
8319    if (f->output_data.x->want_fullscreen & FULLSCREEN_BOTH)    if (f->want_fullscreen & FULLSCREEN_BOTH)
8320      {      {
8321        int width, height, ign;        int width, height, ign;
8322    
8323        x_real_positions (f, &f->output_data.x->left_pos,        x_real_positions (f, &f->left_pos, &f->top_pos);
                         &f->output_data.x->top_pos);  
8324    
8325        x_fullscreen_adjust (f, &width, &height, &ign, &ign);        x_fullscreen_adjust (f, &width, &height, &ign, &ign);
8326    
# Line 8354  x_check_fullscreen (f) Line 8328  x_check_fullscreen (f)
8328           when setting WM manager hints.           when setting WM manager hints.
8329           If the frame is visible already, the position is checked by           If the frame is visible already, the position is checked by
8330           x_check_fullscreen_move. */           x_check_fullscreen_move. */
8331        if (f->width != width || f->height != height)        if (FRAME_COLS (f) != width || FRAME_LINES (f) != height)
8332          {          {
8333            change_frame_size (f, height, width, 0, 1, 0);            change_frame_size (f, height, width, 0, 1, 0);
8334            SET_FRAME_GARBAGED (f);            SET_FRAME_GARBAGED (f);
8335            cancel_mouse_face (f);            cancel_mouse_face (f);
8336    
8337            /* Wait for the change of frame size to occur */            /* Wait for the change of frame size to occur */
8338            f->output_data.x->want_fullscreen |= FULLSCREEN_WAIT;            f->want_fullscreen |= FULLSCREEN_WAIT;
8339          }          }
8340      }      }
8341  }  }
# Line 8376  static void Line 8350  static void
8350  x_check_fullscreen_move (f)  x_check_fullscreen_move (f)
8351       struct frame *f;       struct frame *f;
8352  {  {
8353    if (f->output_data.x->want_fullscreen & FULLSCREEN_MOVE_WAIT)    if (f->want_fullscreen & FULLSCREEN_MOVE_WAIT)
8354    {    {
8355      int expect_top = f->output_data.x->top_pos;      int expect_top = f->top_pos;
8356      int expect_left = f->output_data.x->left_pos;      int expect_left = f->left_pos;
8357    
8358      if (f->output_data.x->want_fullscreen & FULLSCREEN_HEIGHT)      if (f->want_fullscreen & FULLSCREEN_HEIGHT)
8359        expect_top = 0;        expect_top = 0;
8360      if (f->output_data.x->want_fullscreen & FULLSCREEN_WIDTH)      if (f->want_fullscreen & FULLSCREEN_WIDTH)
8361        expect_left = 0;        expect_left = 0;
8362    
8363      if (expect_top != f->output_data.x->top_pos      if (expect_top != f->top_pos || expect_left != f->left_pos)
         || expect_left != f->output_data.x->left_pos)  
8364        x_set_offset (f, expect_left, expect_top, 1);        x_set_offset (f, expect_left, expect_top, 1);
8365    
8366      /* Just do this once */      /* Just do this once */
8367      f->output_data.x->want_fullscreen &= ~FULLSCREEN_MOVE_WAIT;      f->want_fullscreen &= ~FULLSCREEN_MOVE_WAIT;
8368    }    }
8369  }  }
8370    
# Line 8410  x_set_window_size_1 (f, change_gravity, Line 8383  x_set_window_size_1 (f, change_gravity,
8383    int pixelwidth, pixelheight;    int pixelwidth, pixelheight;
8384    
8385    check_frame_size (f, &rows, &cols);    check_frame_size (f, &rows, &cols);
8386    f->output_data.x->vertical_scroll_bar_extra    f->scroll_bar_actual_width
8387      = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f)      = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f)
8388         ? 0         ? 0
8389         : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0         : FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0
8390         ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f)         ? FRAME_CONFIG_SCROLL_BAR_WIDTH (f)
8391         : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.x->font)));         : (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)));
8392    
8393    compute_fringe_widths (f, 0);    compute_fringe_widths (f, 0);
8394    
8395    pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols);    pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols);
8396    pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows);    pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
8397    
8398    f->output_data.x->win_gravity = NorthWestGravity;    f->win_gravity = NorthWestGravity;
8399    x_wm_set_size_hint (f, (long) 0, 0);    x_wm_set_size_hint (f, (long) 0, 0);
8400    
8401    XSync (FRAME_X_DISPLAY (f), False);    XSync (FRAME_X_DISPLAY (f), False);
# Line 8443  x_set_window_size_1 (f, change_gravity, Line 8416  x_set_window_size_1 (f, change_gravity,
8416       We pass 1 for DELAY since we can't run Lisp code inside of       We pass 1 for DELAY since we can't run Lisp code inside of
8417       a BLOCK_INPUT.  */       a BLOCK_INPUT.  */
8418    change_frame_size (f, rows, cols, 0, 1, 0);    change_frame_size (f, rows, cols, 0, 1, 0);
8419    PIXEL_WIDTH (f) = pixelwidth;    FRAME_PIXEL_WIDTH (f) = pixelwidth;
8420    PIXEL_HEIGHT (f) = pixelheight;    FRAME_PIXEL_HEIGHT (f) = pixelheight;
8421    
8422    /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to    /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to
8423       receive in the ConfigureNotify event; if we get what we asked       receive in the ConfigureNotify event; if we get what we asked
# Line 8518  x_set_mouse_position (f, x, y) Line 8491  x_set_mouse_position (f, x, y)
8491  {  {
8492    int pix_x, pix_y;    int pix_x, pix_y;
8493    
8494    pix_x = CHAR_TO_PIXEL_COL (f, x) + FONT_WIDTH  (f->output_data.x->font) / 2;    pix_x = FRAME_COL_TO_PIXEL_X (f, x) + FRAME_COLUMN_WIDTH (f) / 2;
8495    pix_y = CHAR_TO_PIXEL_ROW (f, y) + f->output_data.x->line_height / 2;    pix_y = FRAME_LINE_TO_PIXEL_Y (f, y) + FRAME_LINE_HEIGHT (f) / 2;
8496    
8497    if (pix_x < 0) pix_x = 0;    if (pix_x < 0) pix_x = 0;
8498    if (pix_x > PIXEL_WIDTH (f)) pix_x = PIXEL_WIDTH (f);    if (pix_x > FRAME_PIXEL_WIDTH (f)) pix_x = FRAME_PIXEL_WIDTH (f);
8499    
8500    if (pix_y < 0) pix_y = 0;    if (pix_y < 0) pix_y = 0;
8501    if (pix_y > PIXEL_HEIGHT (f)) pix_y = PIXEL_HEIGHT (f);    if (pix_y > FRAME_PIXEL_HEIGHT (f)) pix_y = FRAME_PIXEL_HEIGHT (f);
8502    
8503    BLOCK_INPUT;    BLOCK_INPUT;
8504    
# Line 8652  x_make_frame_visible (f) Line 8625  x_make_frame_visible (f)
8625           before the window gets really visible.  */           before the window gets really visible.  */
8626        if (! FRAME_ICONIFIED_P (f)        if (! FRAME_ICONIFIED_P (f)
8627            && ! f->output_data.x->asked_for_visible)            && ! f->output_data.x->asked_for_visible)
8628          x_set_offset (f, f->output_data.x->left_pos, f->output_data.x->top_pos, 0);          x_set_offset (f, f->left_pos, f->top_pos, 0);
8629    
8630        f->output_data.x->asked_for_visible = 1;        f->output_data.x->asked_for_visible = 1;
8631    
# Line 8690  x_make_frame_visible (f) Line 8663  x_make_frame_visible (f)
8663         will set it when they are handled.  */         will set it when they are handled.  */
8664      int previously_visible = f->output_data.x->has_been_visible;      int previously_visible = f->output_data.x->has_been_visible;
8665    
8666      original_left = f->output_data.x->left_pos;      original_left = f->left_pos;
8667      original_top = f->output_data.x->top_pos;      original_top = f->top_pos;
8668    
8669      /* This must come after we set COUNT.  */      /* This must come after we set COUNT.  */
8670      UNBLOCK_INPUT;      UNBLOCK_INPUT;
# Line 8708  x_make_frame_visible (f) Line 8681  x_make_frame_visible (f)
8681         and we don't want to override it.  */         and we don't want to override it.  */
8682    
8683      if (! FRAME_VISIBLE_P (f) && ! FRAME_ICONIFIED_P (f)      if (! FRAME_VISIBLE_P (f) && ! FRAME_ICONIFIED_P (f)
8684          && f->output_data.x->win_gravity == NorthWestGravity          && f->win_gravity == NorthWestGravity
8685          && previously_visible)          && previously_visible)
8686        {        {
8687          Drawable rootw;          Drawable rootw;
# Line 8949  x_iconify_frame (f) Line 8922  x_iconify_frame (f)
8922    /* Make sure the X server knows where the window should be positioned,    /* Make sure the X server knows where the window should be positioned,
8923       in case the user deiconifies with the window manager.  */       in case the user deiconifies with the window manager.  */
8924    if (! FRAME_VISIBLE_P (f) && !FRAME_ICONIFIED_P (f))    if (! FRAME_VISIBLE_P (f) && !FRAME_ICONIFIED_P (f))
8925      x_set_offset (f, f->output_data.x->left_pos, f->output_data.x->top_pos, 0);      x_set_offset (f, f->left_pos, f->top_pos, 0);
8926    
8927    /* Since we don't know which revision of X we're running, we'll use both    /* Since we don't know which revision of X we're running, we'll use both
8928       the X11R3 and X11R4 techniques.  I don't know if this is a good idea.  */       the X11R3 and X11R4 techniques.  I don't know if this is a good idea.  */
# Line 9164  x_wm_set_size_hint (f, flags, user_posit Line 9137  x_wm_set_size_hint (f, flags, user_posit
9137    /* Setting PMaxSize caused various problems.  */    /* Setting PMaxSize caused various problems.  */
9138    size_hints.flags = PResizeInc | PMinSize /* | PMaxSize */;    size_hints.flags = PResizeInc | PMinSize /* | PMaxSize */;
9139    
9140    size_hints.x = f->output_data.x->left_pos;    size_hints.x = f->left_pos;
9141    size_hints.y = f->output_data.x->top_pos;    size_hints.y = f->top_pos;
9142    
9143  #ifdef USE_X_TOOLKIT  #ifdef USE_X_TOOLKIT
9144    XtSetArg (al[ac], XtNwidth, &widget_width); ac++;    XtSetArg (al[ac], XtNwidth, &widget_width); ac++;
# Line 9174  x_wm_set_size_hint (f, flags, user_posit Line 9147  x_wm_set_size_hint (f, flags, user_posit
9147    size_hints.height = widget_height;    size_hints.height = widget_height;
9148    size_hints.width = widget_width;    size_hints.width = widget_width;
9149  #else /* not USE_X_TOOLKIT */  #else /* not USE_X_TOOLKIT */
9150    size_hints.height = PIXEL_HEIGHT (f);    size_hints.height = FRAME_PIXEL_HEIGHT (f);
9151    size_hints.width = PIXEL_WIDTH (f);    size_hints.width = FRAME_PIXEL_WIDTH (f);
9152  #endif /* not USE_X_TOOLKIT */  #endif /* not USE_X_TOOLKIT */
9153    
9154    size_hints.width_inc = FONT_WIDTH (f->output_data.x->font);    size_hints.width_inc = FRAME_COLUMN_WIDTH (f);
9155    size_hints.height_inc = f->output_data.x->line_height;    size_hints.height_inc = FRAME_LINE_HEIGHT (f);
9156    size_hints.max_width    size_hints.max_width
9157      = FRAME_X_DISPLAY_INFO (f)->width - CHAR_TO_PIXEL_WIDTH (f, 0);      = FRAME_X_DISPLAY_INFO (f)->width - FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0);
9158    size_hints.max_height    size_hints.max_height
9159      = FRAME_X_DISPLAY_INFO (f)->height - CHAR_TO_PIXEL_HEIGHT (f, 0);      = FRAME_X_DISPLAY_INFO (f)->height - FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0);
9160    
9161    /* Calculate the base and minimum sizes.    /* Calculate the base and minimum sizes.
9162    
# Line 9194  x_wm_set_size_hint (f, flags, user_posit Line 9167  x_wm_set_size_hint (f, flags, user_posit
9167      int base_width, base_height;      int base_width, base_height;
9168      int min_rows = 0, min_cols = 0;      int min_rows = 0, min_cols = 0;
9169    
9170      base_width = CHAR_TO_PIXEL_WIDTH (f, 0);      base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0);
9171      base_height = CHAR_TO_PIXEL_HEIGHT (f, 0);      base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0);
9172    
9173      check_frame_size (f, &min_rows, &min_cols);      check_frame_size (f, &min_rows, &min_cols);
9174    
# Line 9270  x_wm_set_size_hint (f, flags, user_posit Line 9243  x_wm_set_size_hint (f, flags, user_posit
9243  #endif  #endif
9244    
9245  #ifdef PWinGravity  #ifdef PWinGravity
9246    size_hints.win_gravity = f->output_data.x->win_gravity;    size_hints.win_gravity = f->win_gravity;
9247    size_hints.flags |= PWinGravity;    size_hints.flags |= PWinGravity;
9248    
9249    if (user_position)    if (user_position)

Legend:
Removed from v.1.793  
changed lines
  Added in v.1.794

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26