Skip to content

Commit

Permalink
only try to use X11 display fd if windowing system is X11
Browse files Browse the repository at this point in the history
  • Loading branch information
lawremi committed May 15, 2018
1 parent 52d0c32 commit cfe8750
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion RGtk2/src/Rgtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#include <windows.h>
#else
#include <R_ext/eventloop.h>
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#endif
#include <unistd.h>
#include <stdint.h>
#define CSTACK_DEFNS
Expand Down Expand Up @@ -123,6 +125,7 @@ R_gtkInit(long *rargc, char **rargv, Rboolean *success)
{
int fds[2];

#ifdef GDK_WINDOWING_X11
if (!GDK_DISPLAY()) {
*success = FALSE;
return;
Expand All @@ -131,7 +134,7 @@ R_gtkInit(long *rargc, char **rargv, Rboolean *success)

addInputHandler(R_InputHandlers, ConnectionNumber(GDK_DISPLAY()),
R_gtk_eventHandler, -1);

#endif
/* Experimental timer-based piping to a file descriptor */
#ifdef G_THREADS_ENABLED
#ifndef __FreeBSD__
Expand Down

0 comments on commit cfe8750

Please sign in to comment.