Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a way to specify the X11 display in Linux #206

Merged
merged 6 commits into from
Jun 19, 2016
Rate limit · GitHub

Access has been restricted

You have triggered a rate limit.

Please wait a few minutes before you try again;
in some cases this may take up to an hour.

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix os compatibility
jub3i authored and illegalprime committed Jun 1, 2016
commit 91cd9ce9ef54575d1ef80724eea94bfce1d73e15
16 changes: 13 additions & 3 deletions src/robotjs.cc
Original file line number Diff line number Diff line change
@@ -10,7 +10,9 @@
#include "MMBitmap.h"
#include "snprintf.h"
#include "microsleep.h"
#include "xdisplay.h"
#if defined(USE_X11)
#include "xdisplay.h"
#endif

using namespace v8;

@@ -682,17 +684,25 @@ NAN_METHOD(getScreenSize)
NAN_METHOD(getXDisplayName)
{
NanScope();

#if defined(USE_X11)
NanReturnValue(NanNew<String>(getXDisplay()));
#else
NanThrowError("getXDisplayName is only supported on Linux");
#endif
}

NAN_METHOD(setXDisplayName)
{
NanScope();

#if defined(USE_X11)
NanUtf8String name(args[0]);
setXDisplay(*name);

NanReturnUndefined();
NanReturnValue(NanNew("1"));
#else
NanThrowError("setXDisplayName is only supported on Linux");
#endif
}

NAN_METHOD(captureScreen)