Commit 91cd9ce 1 parent 9257211 commit 91cd9ce Copy full SHA for 91cd9ce
File tree 1 file changed +13
-3
lines changed
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 10
10
#include " MMBitmap.h"
11
11
#include " snprintf.h"
12
12
#include " microsleep.h"
13
- #include " xdisplay.h"
13
+ #if defined(USE_X11)
14
+ #include " xdisplay.h"
15
+ #endif
14
16
15
17
using namespace v8 ;
16
18
@@ -682,17 +684,25 @@ NAN_METHOD(getScreenSize)
682
684
NAN_METHOD (getXDisplayName)
683
685
{
684
686
NanScope ();
687
+
688
+ #if defined(USE_X11)
685
689
NanReturnValue (NanNew<String>(getXDisplay ()));
690
+ #else
691
+ NanThrowError (" getXDisplayName is only supported on Linux" );
692
+ #endif
686
693
}
687
694
688
695
NAN_METHOD (setXDisplayName)
689
696
{
690
697
NanScope ();
691
698
699
+ #if defined(USE_X11)
692
700
NanUtf8String name (args[0 ]);
693
701
setXDisplay (*name);
694
-
695
- NanReturnUndefined ();
702
+ NanReturnValue (NanNew (" 1" ));
703
+ #else
704
+ NanThrowError (" setXDisplayName is only supported on Linux" );
705
+ #endif
696
706
}
697
707
698
708
NAN_METHOD (captureScreen)
You can’t perform that action at this time.
0 commit comments