From 8183aecd905596f9a3f80269d6982e04af9a9835 Mon Sep 17 00:00:00 2001 From: witekfl Date: Wed, 6 Jul 2011 13:19:09 +0200 Subject: [PATCH] Do not try to use gpm in X11. X11 is detected by checking DISPLAY variable. Without this ELinks stopped on reading from /dev/gpmctl. --- src/network/socket.c | 2 +- src/osdep/unix/unix.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/network/socket.c b/src/network/socket.c index 23a04234..3dc2353e 100644 --- a/src/network/socket.c +++ b/src/network/socket.c @@ -81,7 +81,7 @@ struct socket_weak_ref { static INIT_LIST_OF(struct socket_weak_ref, socket_weak_refs); /* To enable logging of tranfers, for debugging purposes. */ -#if 0 +#if 1 #define DEBUG_TRANSFER_LOGFILE "/tmp/log" diff --git a/src/osdep/unix/unix.c b/src/osdep/unix/unix.c index 122d3346..c64063b9 100644 --- a/src/osdep/unix/unix.c +++ b/src/osdep/unix/unix.c @@ -10,6 +10,8 @@ #include #endif +#include + #include "elinks.h" #include "main/select.h" @@ -80,6 +82,9 @@ static int init_mouse(int cons, int suspend) { Gpm_Connect conn; + unsigned char *display = getenv("DISPLAY"); + + if (display && *display) return -1; /* We want to get even move events because of the wheels. */ conn.eventMask = suspend ? 0 : ~0;