/* Functions for the X window system.
- Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation.
+ Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996 Free Software Foundation.
This file is part of GNU Emacs.
/* On some systems, the character-composition stuff is broken in X11R5. */
#if defined (HAVE_X11R5) && ! defined (HAVE_X11R6)
#ifdef X11R5_INHIBIT_I18N
-#undef HAVE_X_I18N
+#define X_I18N_INHIBITED
#endif
#endif
/* Don't die if just one of these was set. */
if (EQ (width, Qunbound))
- XSETINT (width, FRAME_WIDTH (f));
+ {
+ if (FRAME_NEW_WIDTH (f))
+ XSETINT (width, FRAME_NEW_WIDTH (f));
+ else
+ XSETINT (width, FRAME_WIDTH (f));
+ }
if (EQ (height, Qunbound))
- XSETINT (height, FRAME_HEIGHT (f));
+ {
+ if (FRAME_NEW_HEIGHT (f))
+ XSETINT (height, FRAME_NEW_HEIGHT (f));
+ else
+ XSETINT (height, FRAME_HEIGHT (f));
+ }
/* Don't set these parameters unless they've been explicitly
specified. The window might be mapped or resized while we're in
XSETFRAME (frame, f);
if ((NUMBERP (width) && XINT (width) != FRAME_WIDTH (f))
- || (NUMBERP (height) && XINT (height) != FRAME_HEIGHT (f)))
+ || (NUMBERP (height) && XINT (height) != FRAME_HEIGHT (f))
+ || FRAME_NEW_HEIGHT (f) || FRAME_NEW_WIDTH (f))
Fset_frame_size (frame, width, height);
if ((!NILP (left) || !NILP (top))
XQueryTree (FRAME_X_DISPLAY (f), outer, &tmp_root_window,
&f->output_data.x->parent_desc,
&tmp_children, &tmp_nchildren);
- XFree (tmp_children);
+ XFree ((char *) tmp_children);
win_x = win_y = 0;
* ((color_def->blue >> 8) - (cells[x].blue >> 8))));
if (trial_delta < nearest_delta)
{
- nearest = x;
- nearest_delta = trial_delta;
+ XColor temp;
+ temp.red = cells[x].red;
+ temp.green = cells[x].green;
+ temp.blue = cells[x].blue;
+ status = XAllocColor (display, screen_colormap, &temp);
+ if (status)
+ {
+ nearest = x;
+ nearest_delta = trial_delta;
+ }
}
}
color_def->red = cells[nearest].red;
XSetClassHint (FRAME_X_DISPLAY (f), XtWindow (shell_widget), &class_hints);
#ifdef HAVE_X_I18N
+#ifndef X_I18N_INHIBITED
{
XIM xim;
XIC xic = NULL;
NULL);
if (xic == 0)
- XCloseIM (xim);
+ {
+ XCloseIM (xim);
+ xim = NULL;
+ }
}
+ FRAME_XIM (f) = xim;
FRAME_XIC (f) = xic;
}
-#endif
+#else /* X_I18N_INHIBITED */
+ FRAME_XIM (f) = 0;
+ FRAME_XIC (f) = 0;
+#endif /* X_I18N_INHIBITED */
+#endif /* HAVE_X_I18N */
f->output_data.x->wm_hints.input = True;
f->output_data.x->wm_hints.flags |= InputHint;
FRAME_X_DISPLAY_INFO (f)->visual,
attribute_mask, &attributes);
#ifdef HAVE_X_I18N
+#ifndef X_I18N_INHIBITED
{
XIM xim;
XIC xic = NULL;
NULL);
if (!xic)
- XCloseIM (xim);
+ {
+ XCloseIM (xim);
+ xim = NULL;
+ }
}
+ FRAME_XIM (f) = xim;
FRAME_XIC (f) = xic;
}
-#endif
+#else /* X_I18N_INHIBITED */
+ FRAME_XIM (f) = 0;
+ FRAME_XIC (f) = 0;
+#endif /* X_I18N_INHIBITED */
+#endif /* HAVE_X_I18N */
validate_x_resource_name ();
f->output_data.x->wm_hints.flags |= InputHint;
XSetWMHints (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
&f->output_data.x->wm_hints);
+ f->output_data.x->wm_hints.icon_pixmap = None;
/* Request "save yourself" and "delete window" commands from wm. */
{
x_default_parameter (f, parms, Qbuffer_predicate, Qnil,
"bufferPredicate", "BufferPredicate", symbol);
x_default_parameter (f, parms, Qtitle, Qnil,
- "title", "Title", symbol);
+ "title", "Title", string);
f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window;
window_prompting = x_figure_window_size (f, parms);
{
XFontStruct *thisinfo;
- thisinfo = XLoadQueryFont (FRAME_X_DISPLAY (f),
+ x_catch_errors (FRAME_X_DISPLAY (f));
+
+ thisinfo = XLoadQueryFont (FRAME_X_DISPLAY (f),
XSTRING (XCONS (tem)->car)->data);
- if (thisinfo && same_size_fonts (thisinfo, size_ref))
+ x_check_errors (FRAME_X_DISPLAY (f), "XLoadQueryFont failure: %s");
+ x_uncatch_errors (FRAME_X_DISPLAY (f));
+
+ if (thisinfo && same_size_fonts (thisinfo, size_ref))
newlist = Fcons (XCONS (tem)->car, newlist);
if (thisinfo != 0)
BLOCK_INPUT;
+ x_catch_errors (FRAME_X_DISPLAY (f));
+
/* Solaris 2.3 has a bug in XListFontsWithInfo. */
#ifndef BROKEN_XLISTFONTSWITHINFO
if (size_ref)
2000, /* maxnames */
&num_fonts); /* count_return */
+ x_check_errors (FRAME_X_DISPLAY (f), "XListFonts failure: %s");
+ x_uncatch_errors (FRAME_X_DISPLAY (f));
+
UNBLOCK_INPUT;
list = Qnil;
XFontStruct *thisinfo;
BLOCK_INPUT;
+
+ x_catch_errors (FRAME_X_DISPLAY (f));
thisinfo = XLoadQueryFont (FRAME_X_DISPLAY (f), names[i]);
+ x_check_errors (FRAME_X_DISPLAY (f),
+ "XLoadQueryFont failure: %s");
+ x_uncatch_errors (FRAME_X_DISPLAY (f));
+
UNBLOCK_INPUT;
keeper = thisinfo && same_size_fonts (thisinfo, size_ref);
+ BLOCK_INPUT;
+ if (thisinfo && ! keeper)
+ XFreeFont (FRAME_X_DISPLAY (f), thisinfo);
+ else if (thisinfo)
+ XFreeFontInfo (NULL, thisinfo, 1);
+ UNBLOCK_INPUT;
#else
keeper = same_size_fonts (&info[i], size_ref);
#endif