@@ -672,7 +672,7 @@ Napi::Number _highlight(const Napi::CallbackInfo &info)
672
672
Napi::Array _getWindows (const Napi::CallbackInfo &info) {
673
673
Napi::Env env = info.Env ();
674
674
675
- std::vector<int32_t > windowHandles = getWindows ();
675
+ std::vector<int64_t > windowHandles = getWindows ();
676
676
auto arr = Napi::Array::New (env, windowHandles.size ());
677
677
678
678
for (size_t idx = 0 ; idx < windowHandles.size (); ++idx) {
@@ -685,7 +685,7 @@ Napi::Array _getWindows(const Napi::CallbackInfo &info) {
685
685
Napi::Object _getWindowRect (const Napi::CallbackInfo &info) {
686
686
Napi::Env env = info.Env ();
687
687
688
- MMRect windowRect = getWindowRect (info[0 ].As <Napi::Number>().Int32Value ());
688
+ MMRect windowRect = getWindowRect (info[0 ].As <Napi::Number>().Int64Value ());
689
689
Napi::Object obj = Napi::Object::New (env);
690
690
obj.Set (Napi::String::New (env, " x" ), Napi::Number::New (env, windowRect.origin .x ));
691
691
obj.Set (Napi::String::New (env, " y" ), Napi::Number::New (env, windowRect.origin .y ));
@@ -695,6 +695,12 @@ Napi::Object _getWindowRect(const Napi::CallbackInfo &info) {
695
695
return obj;
696
696
}
697
697
698
+ Napi::String _getWindowTitle (const Napi::CallbackInfo &info) {
699
+ Napi::Env env = info.Env ();
700
+
701
+ return Napi::String::New (env, getWindowTitle (info[0 ].As <Napi::Number>().Int64Value ()));
702
+ }
703
+
698
704
Napi::Object _captureScreen (const Napi::CallbackInfo &info)
699
705
{
700
706
Napi::Env env = info.Env ();
@@ -778,6 +784,7 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) {
778
784
exports.Set (Napi::String::New (env, " highlight" ), Napi::Function::New (env, _highlight));
779
785
exports.Set (Napi::String::New (env, " getWindows" ), Napi::Function::New (env, _getWindows));
780
786
exports.Set (Napi::String::New (env, " getWindowRect" ), Napi::Function::New (env, _getWindowRect));
787
+ exports.Set (Napi::String::New (env, " getWindowTitle" ), Napi::Function::New (env, _getWindowTitle));
781
788
exports.Set (Napi::String::New (env, " captureScreen" ), Napi::Function::New (env, _captureScreen));
782
789
exports.Set (Napi::String::New (env, " getXDisplayName" ), Napi::Function::New (env, _getXDisplayName));
783
790
exports.Set (Napi::String::New (env, " setXDisplayName" ), Napi::Function::New (env, _setXDisplayName));
0 commit comments