From: ellson Date: Fri, 21 Jul 2006 17:37:09 +0000 (+0000) Subject: use simple fork of "firefox" from -Txlib for URLs to avoid gnome dependencies. X-Git-Tag: LAST_LIBGRAPH~32^2~6058 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4bfd634400880b80fe6f49ad1ec32e039495acb2;p=graphviz use simple fork of "firefox" from -Txlib for URLs to avoid gnome dependencies. - disadvantage is hardcoded "firefox" --- diff --git a/plugin/xlib/Makefile.am b/plugin/xlib/Makefile.am index a0484f78f..e448da14b 100644 --- a/plugin/xlib/Makefile.am +++ b/plugin/xlib/Makefile.am @@ -8,7 +8,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/gvc \ -I$(top_srcdir)/lib/graph \ -I$(top_srcdir)/lib/cdt \ - $(GNOMEUI_CFLAGS) $(PANGOCAIRO_CFLAGS) + $(PANGOCAIRO_CFLAGS) if WITH_PANGOCAIRO if WITH_X diff --git a/plugin/xlib/gvdevice_xlib.c b/plugin/xlib/gvdevice_xlib.c index e5d0cf391..c78bddc0c 100644 --- a/plugin/xlib/gvdevice_xlib.c +++ b/plugin/xlib/gvdevice_xlib.c @@ -46,9 +46,7 @@ #ifdef HAVE_ERRNO_H #include #endif -#ifdef HAVE_GNOMEUI -#include -#endif + #include #include #include @@ -56,6 +54,20 @@ #include "gvplugin_device.h" +/* Don't load up the xlib plugin with all that gnome stuff */ +/* - OTOH now we are dependent on a firefox installation */ +/* */ +/* This undef must follow gvplugin_device.h because */ +/* config.h is reincluded via: */ +/* types.h->cdt.h->ast_common.h */ +/* FIXME */ +#undef HAVE_GNOMEUI +#define BROWSER "firefox" + +#ifdef HAVE_GNOMEUI +#include +#endif + typedef struct window_xlib_s { Window win; unsigned long event_mask; @@ -148,8 +160,8 @@ static void browser_show(GVJ_t *job) #ifdef HAVE_GNOMEUI gnome_url_show(job->selected_href, NULL); #else -#if defined HAVE_SYS_TYPES_H && defined HAVE_UNISTD_Y && defined HAVE_ERRNO_H - char *exec_argv[3] = {"firefox", NULL, NULL}; +#if defined HAVE_SYS_TYPES_H && defined HAVE_UNISTD_H && defined HAVE_ERRNO_H + char *exec_argv[3] = {BROWSER, NULL, NULL}; pid_t pid; int err; @@ -191,17 +203,19 @@ static int handle_xlib_events (GVJ_t *firstjob, Display *dpy) rc++; break; case MotionNotify: - pointer.x = (double)xev.xbutton.x; - pointer.y = (double)xev.xbutton.y; - (job->callbacks->motion)(job, pointer); - rc++; + if (job->button) { /* only interested while a button is pressed */ + pointer.x = (double)xev.xbutton.x; + pointer.y = (double)xev.xbutton.y; + (job->callbacks->motion)(job, pointer); + rc++; + } break; case ButtonRelease: pointer.x = (double)xev.xbutton.x; pointer.y = (double)xev.xbutton.y; (job->callbacks->button_release)(job, xev.xbutton.button, pointer); -// if (job->selected_href && job->selected_href[0]) -// browser_show(job); + if (job->selected_href && job->selected_href[0] && xev.xbutton.button == 1) + browser_show(job); rc++; break; case KeyPress: