Fixed windows warning and x11 error

This commit is contained in:
vcaesar 2022-01-22 12:46:46 -04:00
parent 477a7b473c
commit 63f914ae62
4 changed files with 12 additions and 11 deletions

View File

@ -60,4 +60,12 @@
#endif
#endif
#ifdef RobotGo_64
typedef int64_t intptr;
typedef uint64_t uintptr;
#else
typedef int32_t intptr;
typedef uint32_t uintptr; // Unsigned pointer integer
#endif
#endif /* OS_H */

View File

@ -15,6 +15,7 @@ package robotgo
import (
"errors"
"fmt"
"log"
"github.com/robotn/xgb"
@ -185,11 +186,11 @@ func Alert(title, msg string, args ...string) bool {
` -title ` + title + ` -buttons ` + defaultBtn + ":0," + cancelBtn + ":1" + ` -default Ok`
out, err := Run(c)
if err != nil {
fmt.Println("Alert: ", err, ". ", strint(out))
fmt.Println("Alert: ", err, ". ", string(out))
return false
}
if strint(out) == "1" {
if string(out) == "1" {
return false
}
return true

View File

@ -95,7 +95,7 @@ MMBitmapRef copyMMBitmapFromDisplayInRect(MMRectInt32 rect, int32_t display_id)
if (display_id == -1) {
screen = GetDC(NULL); /* Get entire screen */
} else {
screen = GetDC((HWND) display_id);
screen = GetDC((HWND) (uintptr) display_id);
}
if (screen == NULL) { return NULL; }

View File

@ -15,14 +15,6 @@
#include <X11/Xatom.h>
#endif
#ifdef RobotGo_64
typedef int64_t intptr;
typedef uint64_t uintptr;
#else
typedef int32_t intptr;
typedef uint32_t uintptr; // Unsigned pointer integer
#endif
struct _MData{
#if defined(IS_MACOSX)
CGWindowID CgID; // Handle to a CGWindowID