diff options
| author | Dmitry Antipov | 2013-09-04 08:02:56 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-09-04 08:02:56 +0400 |
| commit | 6d6ed1af817d98f7e78a8be10f5fda14a41e18f6 (patch) | |
| tree | d25995b4b1c8535d42d62226f53a6d27f5d9aa0f /src | |
| parent | adf2fc4a01efe77d73cd52bc9173914ed56ff531 (diff) | |
| download | emacs-6d6ed1af817d98f7e78a8be10f5fda14a41e18f6.tar.gz emacs-6d6ed1af817d98f7e78a8be10f5fda14a41e18f6.zip | |
* 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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/xterm.c | 14 | ||||
| -rw-r--r-- | src/xterm.h | 3 |
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 @@ | |||
| 1 | 2013-09-04 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * xterm.h (struct x_display_info): Do not track X connection | ||
| 4 | fd separately because it is always available from Display. | ||
| 5 | * xterm.c (x_term_init, x_delete_terminal, x_delete_display): | ||
| 6 | Adjust users. | ||
| 7 | |||
| 1 | 2013-09-03 Dmitry Antipov <dmantipov@yandex.ru> | 8 | 2013-09-03 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 9 | ||
| 3 | * buffer.c (drop_overlay): | 10 | * 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) | |||
| 10170 | dpyinfo->x_dnd_atoms_size = 8; | 10170 | dpyinfo->x_dnd_atoms_size = 8; |
| 10171 | dpyinfo->x_dnd_atoms = xmalloc (sizeof *dpyinfo->x_dnd_atoms | 10171 | dpyinfo->x_dnd_atoms = xmalloc (sizeof *dpyinfo->x_dnd_atoms |
| 10172 | * dpyinfo->x_dnd_atoms_size); | 10172 | * dpyinfo->x_dnd_atoms_size); |
| 10173 | |||
| 10174 | connection = ConnectionNumber (dpyinfo->display); | ||
| 10175 | dpyinfo->connection = connection; | ||
| 10176 | dpyinfo->gray | 10173 | dpyinfo->gray |
| 10177 | = XCreatePixmapFromBitmapData (dpyinfo->display, dpyinfo->root_window, | 10174 | = XCreatePixmapFromBitmapData (dpyinfo->display, dpyinfo->root_window, |
| 10178 | gray_bits, gray_width, gray_height, | 10175 | gray_bits, gray_width, gray_height, |
| @@ -10184,6 +10181,8 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 10184 | 10181 | ||
| 10185 | xsettings_initialize (dpyinfo); | 10182 | xsettings_initialize (dpyinfo); |
| 10186 | 10183 | ||
| 10184 | connection = ConnectionNumber (dpyinfo->display); | ||
| 10185 | |||
| 10187 | /* This is only needed for distinguishing keyboard and process input. */ | 10186 | /* This is only needed for distinguishing keyboard and process input. */ |
| 10188 | if (connection != 0) | 10187 | if (connection != 0) |
| 10189 | add_keyboard_wait_descriptor (connection); | 10188 | add_keyboard_wait_descriptor (connection); |
| @@ -10284,8 +10283,6 @@ x_delete_display (struct x_display_info *dpyinfo) | |||
| 10284 | break; | 10283 | break; |
| 10285 | } | 10284 | } |
| 10286 | 10285 | ||
| 10287 | delete_keyboard_wait_descriptor (dpyinfo->connection); | ||
| 10288 | |||
| 10289 | /* Discard this display from x_display_name_list and x_display_list. | 10286 | /* Discard this display from x_display_name_list and x_display_list. |
| 10290 | We can't use Fdelq because that can quit. */ | 10287 | We can't use Fdelq because that can quit. */ |
| 10291 | if (! NILP (x_display_name_list) | 10288 | if (! NILP (x_display_name_list) |
| @@ -10413,6 +10410,7 @@ void | |||
| 10413 | x_delete_terminal (struct terminal *terminal) | 10410 | x_delete_terminal (struct terminal *terminal) |
| 10414 | { | 10411 | { |
| 10415 | struct x_display_info *dpyinfo = terminal->display_info.x; | 10412 | struct x_display_info *dpyinfo = terminal->display_info.x; |
| 10413 | int connection = -1; | ||
| 10416 | 10414 | ||
| 10417 | /* Protect against recursive calls. delete_frame in | 10415 | /* Protect against recursive calls. delete_frame in |
| 10418 | delete_terminal calls us back when it deletes our last frame. */ | 10416 | delete_terminal calls us back when it deletes our last frame. */ |
| @@ -10431,6 +10429,8 @@ x_delete_terminal (struct terminal *terminal) | |||
| 10431 | and dpyinfo->display was set to 0 to indicate that. */ | 10429 | and dpyinfo->display was set to 0 to indicate that. */ |
| 10432 | if (dpyinfo->display) | 10430 | if (dpyinfo->display) |
| 10433 | { | 10431 | { |
| 10432 | connection = ConnectionNumber (dpyinfo->display); | ||
| 10433 | |||
| 10434 | x_destroy_all_bitmaps (dpyinfo); | 10434 | x_destroy_all_bitmaps (dpyinfo); |
| 10435 | XSetCloseDownMode (dpyinfo->display, DestroyAll); | 10435 | XSetCloseDownMode (dpyinfo->display, DestroyAll); |
| 10436 | 10436 | ||
| @@ -10471,6 +10471,10 @@ x_delete_terminal (struct terminal *terminal) | |||
| 10471 | #endif /* ! USE_GTK */ | 10471 | #endif /* ! USE_GTK */ |
| 10472 | } | 10472 | } |
| 10473 | 10473 | ||
| 10474 | /* No more input on this descriptor. */ | ||
| 10475 | if (connection != -1) | ||
| 10476 | delete_keyboard_wait_descriptor (connection); | ||
| 10477 | |||
| 10474 | /* Mark as dead. */ | 10478 | /* Mark as dead. */ |
| 10475 | dpyinfo->display = NULL; | 10479 | dpyinfo->display = NULL; |
| 10476 | x_delete_display (dpyinfo); | 10480 | 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 | |||
| 138 | /* The generic display parameters corresponding to this X display. */ | 138 | /* The generic display parameters corresponding to this X display. */ |
| 139 | struct terminal *terminal; | 139 | struct terminal *terminal; |
| 140 | 140 | ||
| 141 | /* Connection number (normally a file descriptor number). */ | ||
| 142 | int connection; | ||
| 143 | |||
| 144 | /* This says how to access this display in Xlib. */ | 141 | /* This says how to access this display in Xlib. */ |
| 145 | Display *display; | 142 | Display *display; |
| 146 | 143 | ||