entered into RCS
[bpt/emacs.git] / src / widget.c
index aabd63a..df146b6 100644 (file)
@@ -169,7 +169,7 @@ get_default_char_pixel_size (ew, pixel_width, pixel_height)
 {
   struct frame* f = ew->emacs_frame.frame;
   *pixel_width = FONT_WIDTH (f->display.x->font);
-  *pixel_height = FONT_HEIGHT (f->display.x->font);
+  *pixel_height = f->display.x->line_height;
 }
 
 static void
@@ -307,10 +307,12 @@ set_frame_size (ew)
   Widget wmshell = get_wm_shell ((Widget) ew);
   Widget app_shell = XtParent ((Widget) wmshell);
   
-  
   if (! XtIsSubclass (wmshell, shellWidgetClass)) abort ();
   if (! XtIsSubclass (app_shell, shellWidgetClass)) abort ();
 
+  /* We don't need this for the momment. The geometry is computed in 
+     xfns.c.  */
+#if 0
   /* If the EmacsFrame doesn't have a geometry but the shell does,
      treat that as the geometry of the frame.  (Is this bogus?
      I'm not sure.) */
@@ -413,7 +415,7 @@ set_frame_size (ew)
          flags |= (app_flags & (WidthValue | HeightValue));
        }
     }
-
+#endif /* 0 */
   {
     struct frame* frame = ew->emacs_frame.frame;
     Dimension pixel_width, pixel_height;
@@ -431,7 +433,7 @@ set_frame_size (ew)
     ew->core.width = pixel_width;
     ew->core.height = pixel_height;
 
-
+#if 0 /* xfns.c takes care of this now.  */
     /* If a position was specified, assign it to the shell widget.
        (Else WM won't do anything with it.)
      */
@@ -468,6 +470,7 @@ set_frame_size (ew)
     /* Also assign the iconic status of the frame to the Shell, so that
        the WM sees it. */
     XtVaSetValues (wmshell, XtNiconic, ew->emacs_frame.iconic, 0);
+#endif /* 0 */
   }
 }
 
@@ -872,13 +875,12 @@ EmacsFrameSetCharSize (widget, columns, rows)
   Dimension pixel_width, pixel_height, granted_width, granted_height;
   XtGeometryResult result;
   struct frame *f = ew->emacs_frame.frame;
-
+  Arg al[2];
+  int ac = 0;
+  
   if (columns < 3) columns = 3;  /* no way buddy */
   if (rows < 3) rows = 3;
 
-  f->display.x->left_pos = f->display.x->widget->core.x;
-  f->display.x->top_pos = f->display.x->widget->core.y;
-
   check_frame_size (f, &rows, &columns);
   f->display.x->vertical_scroll_bar_extra
     = (FRAME_HAS_VERTICAL_SCROLL_BARS (f)
@@ -886,40 +888,23 @@ EmacsFrameSetCharSize (widget, columns, rows)
        : 0);
   char_to_pixel_size (ew, columns, rows, &pixel_width, &pixel_height);
 
-/* Dont call XtMakeResize Request. This appears to not work for all
-   the cases.
-   Use XtVaSetValues instead.  */
-#if 0
-result = XtMakeResizeRequest ((Widget)ew,
-                               pixel_width, pixel_height,
-                               &granted_width, &granted_height);
-  if (result == XtGeometryAlmost)
-    XtMakeResizeRequest ((Widget) ew, granted_width, granted_height,
-                        NULL, NULL);
-#endif
   /* Recompute the entire geometry management.  */
   if (ew->core.width != pixel_width || ew->core.height != pixel_height)
     {
       int hdelta = pixel_height - ew->core.height;
       int column_widget_height = f->display.x->column_widget->core.height;
-      Arg al[2];
-      int ac = 0;
-
       XawPanedSetRefigureMode (f->display.x->column_widget, False);
 
+      ac = 0;
       XtSetArg (al[ac], XtNheight, pixel_height); ac++;
       XtSetArg (al[ac], XtNwidth, pixel_width); ac++;
       XtSetValues ((Widget) ew, al, ac);
-#if 0
-      XtVaSetValues ((Widget) ew, 
-                         XtNheight, pixel_height,
-                         XtNwidth, pixel_width,
-                         0);
-#endif
-      XtVaSetValues (f->display.x->column_widget,
-                         XtNwidth, pixel_width,
-                         XtNheight, column_widget_height + hdelta, 
-                         0);
+      ac = 0;
+      XtSetArg (al[ac], XtNheight, column_widget_height + hdelta); ac++;
+      XtSetArg (al[ac], XtNwidth, pixel_width); ac++;
+      XtSetValues (f->display.x->column_widget, al, ac);
+
       XawPanedSetRefigureMode (f->display.x->column_widget, True);
     }
 
@@ -928,11 +913,4 @@ result = XtMakeResizeRequest ((Widget)ew,
      for, then the event won't cause the screen to become garbaged, so
      we have to make sure to do it here.  */
   SET_FRAME_GARBAGED (f);
-
-  /* Coordinates of the toplevel widget seem to have been lost.
-     So set it to the rignt values.  */
-  XtVaSetValues (f->display.x->widget, 
-               XtNx, f->display.x->left_pos,
-               XtNy, f->display.x->top_pos,
-               0);
 }