PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED libglade-2.0)
PKG_CHECK_MODULES(SHELL_CORE, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED gnome-vfs-2.0 libglade-2.0 gconf-2.0 gnome-keyring-1 >= $KEYRING_REQUIRED)
+BACKEND_CFLAGS="$BACKEND_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
+AC_SUBST(BACKEND_CFLAGS)
+
GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
AC_SUBST(GLIB_GENMARSHAL)
AC_DEFINE_UNQUOTED(DBUS_VERSION, $DBUS_VERSION, [DBUS version.])
fi
-SHELL_CFLAGS="$SHELL_CORE_CFLAGS $DBUS_CFLAGS"
+SHELL_CFLAGS="$SHELL_CORE_CFLAGS $DBUS_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
SHELL_LIBS="$SHELL_CORE_LIBS $DBUS_LIBS -lz"
AC_SUBST(SHELL_CFLAGS)
AC_SUBST(SHELL_LIBS)
char *argv[NUM_ARGS], *dir, *gv_env, *gs_path;
char **gs_args, **alpha_args = NULL;
+ char **gv_env_vars = NULL;
int argc = 0, i;
LOG ("Start the interpreter");
return -1;
}
- gv_env = g_strdup_printf ("GHOSTVIEW=%ld %ld",
+ gv_env = g_strdup_printf ("GHOSTVIEW=%ld %ld;DISPLAY=%s",
gdk_x11_drawable_get_xid (gs->pstarget),
- gdk_x11_drawable_get_xid (gs->bpixmap));
+ gdk_x11_drawable_get_xid (gs->bpixmap),
+ gdk_display_get_name (gdk_drawable_get_display (gs->pstarget)));
LOG ("Launching ghostview with env %s", gv_env);
gs->interpreter_pid = fork ();
}
}
- putenv(gv_env);
+ gv_env_vars = g_strsplit (gv_env, ";", -1);
+ g_free (gv_env);
+ for (i = 0; gv_env_vars[i]; i++) {
+ putenv (gv_env_vars[i]);
+ }
/* change to directory where the input file is. This helps
* with postscript-files which include other files using
/* Notify error */
g_critical ("Unable to execute [%s]\n", argv[0]);
g_strfreev (gs_args);
- g_free (gv_env);
g_strfreev (alpha_args);
+ g_strfreev (gv_env_vars);
_exit (1);
break;
default: /* parent */
static gboolean
ps_document_next_page (PSDocument *gs)
{
- XEvent event;
+ XEvent event;
+ GdkScreen *screen;
+ GdkDisplay *display;
+ Display *dpy;
LOG ("Make ghostscript render next page");
gs->busy = TRUE;
+ screen = gtk_window_get_screen (GTK_WINDOW (gs->target_window));
+ display = gdk_screen_get_display (screen);
+ dpy = gdk_x11_display_get_xdisplay (display);
+
event.xclient.type = ClientMessage;
- event.xclient.display = gdk_display;
+ event.xclient.display = dpy;
event.xclient.window = gs->message_window;
- event.xclient.message_type = gdk_x11_atom_to_xatom(gs_class->next_atom);
+ event.xclient.message_type =
+ gdk_x11_atom_to_xatom_for_display (display,
+ gs_class->next_atom);
event.xclient.format = 32;
gdk_error_trap_push ();
- XSendEvent (gdk_display, gs->message_window, FALSE, 0, &event);
+ XSendEvent (dpy, gs->message_window, FALSE, 0, &event);
gdk_flush ();
gdk_error_trap_pop ();