forked from pool/ncurses
44874ba07f
Copy from Base:System/ncurses based on submit request 24424 from user msmeissn OBS-URL: https://build.opensuse.org/request/show/24424 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ncurses?expand=0&rev=25
40 lines
1.2 KiB
Plaintext
40 lines
1.2 KiB
Plaintext
Index: ncurses/base/lib_mouse.c
|
|
===================================================================
|
|
--- ncurses/base/lib_mouse.c.orig
|
|
+++ ncurses/base/lib_mouse.c
|
|
@@ -359,6 +359,11 @@ enable_xterm_mouse(SCREEN *sp, int enabl
|
|
static int
|
|
allow_gpm_mouse(void)
|
|
{
|
|
+#ifdef weak_symbol
|
|
+ /* Danger Robinson: do not use dlopen for libgpm if already loaded */
|
|
+ if ((Gpm_Wgetch))
|
|
+ return FALSE;
|
|
+#endif
|
|
/* GPM does printf's without checking if stdout is a terminal */
|
|
if (isatty(fileno(stdout))) {
|
|
char *env = getenv("TERM");
|
|
@@ -366,7 +371,7 @@ allow_gpm_mouse(void)
|
|
* it should pass xterm events through. There is no real advantage
|
|
* in allowing GPM to do this.
|
|
*/
|
|
- if (env == 0 || strncmp(env, "xterm", 5))
|
|
+ if (env == 0 || strncmp(env, "linux", 5) == 0)
|
|
return TRUE;
|
|
}
|
|
return FALSE;
|
|
Index: ncurses/curses.priv.h
|
|
===================================================================
|
|
--- ncurses/curses.priv.h.orig
|
|
+++ ncurses/curses.priv.h
|
|
@@ -487,6 +487,9 @@ typedef struct {
|
|
#if USE_GPM_SUPPORT
|
|
#undef buttons /* term.h defines this, and gpm uses it! */
|
|
#include <gpm.h>
|
|
+#ifdef weak_symbol
|
|
+weak_symbol(Gpm_Wgetch);
|
|
+#endif
|
|
|
|
#ifdef HAVE_LIBDL
|
|
/* link dynamically to GPM */
|