summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog7
-rw-r--r--src/xterm.c14
-rw-r--r--src/xterm.h3
3 files changed, 16 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e0aa1ed577f..c355232482f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+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):
diff --git a/src/xterm.c b/src/xterm.c
index bd990014cea..c7bfbae9e46 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10170,9 +10170,6 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
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,
@@ -10184,6 +10181,8 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
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);
@@ -10284,8 +10283,6 @@ x_delete_display (struct x_display_info *dpyinfo)
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)
@@ -10413,6 +10410,7 @@ void
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. */
@@ -10431,6 +10429,8 @@ x_delete_terminal (struct terminal *terminal)
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);
@@ -10471,6 +10471,10 @@ x_delete_terminal (struct terminal *terminal)
#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);
diff --git a/src/xterm.h b/src/xterm.h
index c579d342215..883a249629d 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -138,9 +138,6 @@ struct x_display_info
/* The generic display parameters corresponding to this X display. */
struct terminal *terminal;
- /* Connection number (normally a file descriptor number). */
- int connection;
-
/* This says how to access this display in Xlib. */
Display *display;