Skip to content

Commit 2fe3355

Browse files
author
Yuuki Harano
authored
Merge pull request emacs-mirror#11 from masm11/revert-10-pgtk-no-conn
Revert "Revert pgtkconn removal"
2 parents 234779f + 4784a89 commit 2fe3355

File tree

5 files changed

+6
-170
lines changed

5 files changed

+6
-170
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2822,7 +2822,7 @@ LIBS=$OLD_LIBS
28222822
PGTK_OBJ=
28232823
PGTK_LIBS=
28242824
if test "$window_system" = "pgtk"; then
2825-
PGTK_OBJ="pgtkconn.o pgtkfns.o pgtkterm.o pgtkselect.o pgtkmenu.o pgtkim.o xsettings.o"
2825+
PGTK_OBJ="pgtkfns.o pgtkterm.o pgtkselect.o pgtkmenu.o pgtkim.o xsettings.o"
28262826
PGTK_LIBS="$GTK_LIBS -ldl"
28272827
AC_DEFINE([HAVE_PGTK], 1, [Define to 1 if you have pure Gtk+-3.])
28282828
fi

src/pgtkconn.c

Lines changed: 0 additions & 103 deletions
This file was deleted.

src/pgtkconn.h

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/pgtkterm.c

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
5858
#include "font.h"
5959
#include "xsettings.h"
6060
#include "pgtkselect.h"
61-
#include "pgtkconn.h"
6261

6362
#define STORE_KEYSYM_FOR_DEBUG(keysym) ((void)0)
6463

@@ -96,7 +95,6 @@ static void pgtk_clip_to_row (struct window *w, struct glyph_row *row,
9695
static struct frame *
9796
pgtk_any_window_to_frame (GdkWindow *window);
9897

99-
10098
static void evq_enqueue(union buffered_input_event *ev)
10199
{
102100
struct event_queue_t *evq = &event_q;
@@ -4304,17 +4302,7 @@ pgtk_delete_terminal (struct terminal *terminal)
43044302
dpyinfo->gdpy = NULL;
43054303
}
43064304

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);
43184306

43194307
pgtk_delete_display (dpyinfo);
43204308
unblock_input ();
@@ -6124,7 +6112,6 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name)
61246112
static char *initial_display = NULL;
61256113
char *dpy_name;
61266114
Lisp_Object lisp_dpy_name = Qnil;
6127-
int conn_fd;
61286115

61296116
block_input ();
61306117

@@ -6140,11 +6127,6 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name)
61406127
++x_initialized;
61416128
}
61426129

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-
61486130
dpy_name = SSDATA (display_name);
61496131
if (strlen(dpy_name) == 0 && initial_display != NULL)
61506132
dpy_name = initial_display;
@@ -6212,14 +6194,7 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name)
62126194
return 0;
62136195
}
62146196

6215-
conn_fd = pgtk_detect_connection(dpy);
6216-
if (conn_fd < 0) {
6217-
unblock_input();
6218-
return 0;
6219-
}
6220-
62216197
/* We have definitely succeeded. Record the new connection. */
6222-
62236198
dpyinfo = xzalloc (sizeof *dpyinfo);
62246199
pgtk_initialize_display_info (dpyinfo);
62256200
terminal = pgtk_create_terminal (dpyinfo);
@@ -6251,7 +6226,6 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name)
62516226

62526227
dpyinfo->name_list_element = Fcons (lisp_dpy_name, Qnil);
62536228
dpyinfo->gdpy = dpy;
6254-
dpyinfo->connection = conn_fd;
62556229

62566230
/* https://lists.gnu.org/r/emacs-devel/2015-11/msg00194.html */
62576231
dpyinfo->smallest_font_height = 1;
@@ -6297,16 +6271,10 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name)
62976271

62986272
xsettings_initialize (dpyinfo);
62996273

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);
63106278

63116279
pgtk_selection_init();
63126280

src/pgtkterm.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ struct pgtk_display_info
131131
/* This says how to access this display in Gdk. */
132132
GdkDisplay *gdpy;
133133

134-
/* A connection number (file descriptor) for the display. */
135-
int connection;
136-
137134
/* This is a cons cell of the form (NAME . FONT-LIST-CACHE). */
138135
Lisp_Object name_list_element;
139136

0 commit comments

Comments
 (0)