+2013-09-04 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * xterm.h (struct x_display_info): Do not track X connection
+ fd separately because it is always available from Display.
+ * xterm.c (x_term_init, x_delete_terminal, x_delete_display):
+ Adjust users.
+
2013-09-03 Dmitry Antipov <dmantipov@yandex.ru>
* buffer.c (drop_overlay):
dpyinfo->x_dnd_atoms_size = 8;
dpyinfo->x_dnd_atoms = xmalloc (sizeof *dpyinfo->x_dnd_atoms
* dpyinfo->x_dnd_atoms_size);
-
- connection = ConnectionNumber (dpyinfo->display);
- dpyinfo->connection = connection;
dpyinfo->gray
= XCreatePixmapFromBitmapData (dpyinfo->display, dpyinfo->root_window,
gray_bits, gray_width, gray_height,
xsettings_initialize (dpyinfo);
+ connection = ConnectionNumber (dpyinfo->display);
+
/* This is only needed for distinguishing keyboard and process input. */
if (connection != 0)
add_keyboard_wait_descriptor (connection);
break;
}
- delete_keyboard_wait_descriptor (dpyinfo->connection);
-
/* Discard this display from x_display_name_list and x_display_list.
We can't use Fdelq because that can quit. */
if (! NILP (x_display_name_list)
x_delete_terminal (struct terminal *terminal)
{
struct x_display_info *dpyinfo = terminal->display_info.x;
+ int connection = -1;
/* Protect against recursive calls. delete_frame in
delete_terminal calls us back when it deletes our last frame. */
and dpyinfo->display was set to 0 to indicate that. */
if (dpyinfo->display)
{
+ connection = ConnectionNumber (dpyinfo->display);
+
x_destroy_all_bitmaps (dpyinfo);
XSetCloseDownMode (dpyinfo->display, DestroyAll);
#endif /* ! USE_GTK */
}
+ /* No more input on this descriptor. */
+ if (connection != -1)
+ delete_keyboard_wait_descriptor (connection);
+
/* Mark as dead. */
dpyinfo->display = NULL;
x_delete_display (dpyinfo);