@@ -58,7 +58,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
58
58
#include "font.h"
59
59
#include "xsettings.h"
60
60
#include "pgtkselect.h"
61
- #include "pgtkconn.h"
62
61
63
62
#define STORE_KEYSYM_FOR_DEBUG (keysym ) ((void)0)
64
63
@@ -96,7 +95,6 @@ static void pgtk_clip_to_row (struct window *w, struct glyph_row *row,
96
95
static struct frame *
97
96
pgtk_any_window_to_frame (GdkWindow * window );
98
97
99
-
100
98
static void evq_enqueue (union buffered_input_event * ev )
101
99
{
102
100
struct event_queue_t * evq = & event_q ;
@@ -4304,17 +4302,7 @@ pgtk_delete_terminal (struct terminal *terminal)
4304
4302
dpyinfo -> gdpy = NULL ;
4305
4303
}
4306
4304
4307
- /* ...but if called from x_connection_closed, the display may already
4308
- be closed and dpyinfo->display was set to 0 to indicate that. Since
4309
- X server is most likely gone, explicit close is the only reliable
4310
- way to continue and avoid Bug#19147. */
4311
- else if (dpyinfo -> connection >= 0 )
4312
- emacs_close (dpyinfo -> connection );
4313
-
4314
- /* No more input on this descriptor. */
4315
- delete_keyboard_wait_descriptor (dpyinfo -> connection );
4316
- /* Mark as dead. */
4317
- dpyinfo -> connection = -1 ;
4305
+ delete_keyboard_wait_descriptor (0 );
4318
4306
4319
4307
pgtk_delete_display (dpyinfo );
4320
4308
unblock_input ();
@@ -6124,7 +6112,6 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name)
6124
6112
static char * initial_display = NULL ;
6125
6113
char * dpy_name ;
6126
6114
Lisp_Object lisp_dpy_name = Qnil ;
6127
- int conn_fd ;
6128
6115
6129
6116
block_input ();
6130
6117
@@ -6140,11 +6127,6 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name)
6140
6127
++ x_initialized ;
6141
6128
}
6142
6129
6143
- #if 0
6144
- if (! x_display_ok (SSDATA (display_name )))
6145
- error ("Display %s can't be opened" , SSDATA (display_name ));
6146
- #endif
6147
-
6148
6130
dpy_name = SSDATA (display_name );
6149
6131
if (strlen (dpy_name ) == 0 && initial_display != NULL )
6150
6132
dpy_name = initial_display ;
@@ -6212,14 +6194,7 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name)
6212
6194
return 0 ;
6213
6195
}
6214
6196
6215
- conn_fd = pgtk_detect_connection (dpy );
6216
- if (conn_fd < 0 ) {
6217
- unblock_input ();
6218
- return 0 ;
6219
- }
6220
-
6221
6197
/* We have definitely succeeded. Record the new connection. */
6222
-
6223
6198
dpyinfo = xzalloc (sizeof * dpyinfo );
6224
6199
pgtk_initialize_display_info (dpyinfo );
6225
6200
terminal = pgtk_create_terminal (dpyinfo );
@@ -6251,7 +6226,6 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name)
6251
6226
6252
6227
dpyinfo -> name_list_element = Fcons (lisp_dpy_name , Qnil );
6253
6228
dpyinfo -> gdpy = dpy ;
6254
- dpyinfo -> connection = conn_fd ;
6255
6229
6256
6230
/* https://lists.gnu.org/r/emacs-devel/2015-11/msg00194.html */
6257
6231
dpyinfo -> smallest_font_height = 1 ;
@@ -6297,16 +6271,10 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name)
6297
6271
6298
6272
xsettings_initialize (dpyinfo );
6299
6273
6300
- /* This is only needed for distinguishing keyboard and process input. */
6301
- if (dpyinfo -> connection != 0 )
6302
- add_keyboard_wait_descriptor (dpyinfo -> connection );
6303
-
6304
- #ifdef F_SETOWN
6305
- fcntl (dpyinfo -> connection , F_SETOWN , getpid ());
6306
- #endif /* ! defined (F_SETOWN) */
6307
-
6308
- if (interrupt_input )
6309
- init_sigio (dpyinfo -> connection );
6274
+ /* According to w32term.c this will stop the emacs console handling
6275
+ code from handling keyboard input when we want gtk to do that for
6276
+ us */
6277
+ add_keyboard_wait_descriptor (0 );
6310
6278
6311
6279
pgtk_selection_init ();
6312
6280
0 commit comments