happen when toolkit scroll bars are used and a window is split.
Reconfiguring the scroll bar will generate an expose for a newly
created window. */
- if (w->current_matrix == NULL)
+ if (w->current_matrix == NULL || w == updated_window)
return;
TRACE ((stderr, "expose_window (%d, %d, %d, %d)\n",
clear_mouse_face (dpyinfo)
struct x_display_info *dpyinfo;
{
- if (tip_frame)
+ if (!NILP (tip_frame))
return;
if (! NILP (dpyinfo->mouse_face_window))
UNBLOCK_INPUT;
#endif /* not USE_X_TOOLKIT */
}
+
\f
-/* Destroy the X window of frame F. */
+/* Free X resources of frame F. */
void
-x_destroy_window (f)
+x_free_frame_resources (f)
struct frame *f;
{
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
/* If a display connection is dead, don't try sending more
commands to the X server. */
- if (dpyinfo->display != 0)
+ if (dpyinfo->display)
{
- if (f->output_data.x->icon_desc != 0)
+ if (f->output_data.x->icon_desc)
XDestroyWindow (FRAME_X_DISPLAY (f), f->output_data.x->icon_desc);
+
#ifdef HAVE_X_I18N
if (FRAME_XIC (f))
free_frame_xic (f);
#endif
+
if (FRAME_X_WINDOW (f))
- {
- XDestroyWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
- FRAME_X_WINDOW (f) = 0;
- }
+ XDestroyWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
+
#ifdef USE_X_TOOLKIT
if (f->output_data.x->widget)
XtDestroyWidget (f->output_data.x->widget);
unload_color (f, f->output_data.x->cursor_foreground_pixel);
unload_color (f, f->output_data.x->border_pixel);
unload_color (f, f->output_data.x->mouse_pixel);
+
if (f->output_data.x->scroll_bar_background_pixel != -1)
unload_color (f, f->output_data.x->scroll_bar_background_pixel);
if (f->output_data.x->scroll_bar_foreground_pixel != -1)
unload_color (f, f->output_data.x->white_relief.pixel);
if (f->output_data.x->black_relief.allocated_p)
unload_color (f, f->output_data.x->black_relief.pixel);
+
+ if (FRAME_FACE_CACHE (f))
+ free_frame_faces (f);
- free_frame_faces (f);
+ x_free_gcs (f);
XFlush (FRAME_X_DISPLAY (f));
}
xfree (f->output_data.x->saved_menu_event);
xfree (f->output_data.x);
- f->output_data.x = 0;
+ f->output_data.x = NULL;
+
if (f == dpyinfo->x_focus_frame)
dpyinfo->x_focus_frame = 0;
if (f == dpyinfo->x_focus_event_frame)
if (f == dpyinfo->x_highlight_frame)
dpyinfo->x_highlight_frame = 0;
- dpyinfo->reference_count--;
-
if (f == dpyinfo->mouse_face_mouse_frame)
{
dpyinfo->mouse_face_beg_row
UNBLOCK_INPUT;
}
+
+
+/* Destroy the X window of frame F. */
+
+void
+x_destroy_window (f)
+ struct frame *f;
+{
+ struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+
+ /* If a display connection is dead, don't try sending more
+ commands to the X server. */
+ if (dpyinfo->display != 0)
+ x_free_frame_resources (f);
+
+ dpyinfo->reference_count--;
+}
+
\f
/* Setting window manager hints. */
fontp->size = font->max_bounds.width;
fontp->height = FONT_HEIGHT (font);
- {
- /* For some font, ascent and descent in max_bounds field is
- larger than the above value. */
- int max_height = font->max_bounds.ascent + font->max_bounds.descent;
- if (max_height > fontp->height)
- fontp->height = max_height;
- }
if (NILP (font_names))
{
{
extern int gray_bitmap_width, gray_bitmap_height;
- extern unsigned char *gray_bitmap_bits;
+ extern char *gray_bitmap_bits;
dpyinfo->gray
= XCreatePixmapFromBitmapData (dpyinfo->display, dpyinfo->root_window,
gray_bitmap_bits,