diff --git a/.circleci/config.yml b/.circleci/config.yml index 4dbdc3b..b88fd25 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ jobs: docker: # using custom image, see .circleci/images/primary/Dockerfile # - image: govgo/robotgoci:1.10.3 - - image: golang:1.17.5 + - image: golang:1.17.6 working_directory: /gopath/src/github.com/go-vgo/robotgo steps: - checkout diff --git a/.circleci/images/primary/Dockerfile b/.circleci/images/primary/Dockerfile index 5b20e3d..e1bca46 100644 --- a/.circleci/images/primary/Dockerfile +++ b/.circleci/images/primary/Dockerfile @@ -1,5 +1,5 @@ # FROM golang:1.10.1 -FROM golang:1.17.5-stretch AS build +FROM golang:1.17.6-stretch AS build # FROM govgo/go:1.11.1 RUN apt update && apt install -y --no-install-recommends \ diff --git a/appveyor.yml b/appveyor.yml index 59ababd..8fe8495 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -34,7 +34,7 @@ environment: PATH: C:\msys64\mingw32\bin\;C:\Program Files (x86)\NSIS\;%PATH% # - COMPILER: MINGW_W64 # ARCHITECTURE: x64 - GOVERSION: 1.17.5 + GOVERSION: 1.17.6 # GOPATH: c:\gopath # scripts that run after cloning repository diff --git a/window/pub.h b/window/pub.h index 2cf99d2..a781491 100644 --- a/window/pub.h +++ b/window/pub.h @@ -135,6 +135,7 @@ typedef struct _Bounds Bounds; // Reinstate old handler XSetErrorHandler(mOld); + XCloseDisplay(rDisplay); } // Definitions @@ -182,6 +183,7 @@ typedef struct _Bounds Bounds; WM_ACTIVE = XInternAtom(rDisplay, "_NET_ACTIVE_WINDOW", True); WM_HINTS = XInternAtom(rDisplay, "_MOTIF_WM_HINTS", True); WM_EXTENTS = XInternAtom(rDisplay, "_NET_FRAME_EXTENTS", True); + XCloseDisplay(rDisplay); } @@ -219,6 +221,7 @@ typedef struct _Bounds Bounds; XFree (result); } + XCloseDisplay(rDisplay); return NULL; } @@ -262,6 +265,7 @@ typedef struct _Bounds Bounds; XFree(desktop); } } + XCloseDisplay(rDisplay); } static Bounds GetFrame(MData win){ diff --git a/window/win_sys.h b/window/win_sys.h index 23abb1f..0a7cbe6 100644 --- a/window/win_sys.h +++ b/window/win_sys.h @@ -224,6 +224,8 @@ Bounds get_client(uintptr pid, uintptr isHwnd){ bounds.Y = y; bounds.W = attr.width; bounds.H = attr.height; + XCloseDisplay(rDisplay); + return bounds; #elif defined(IS_WINDOWS) diff --git a/window/window.h b/window/window.h index fcf1a6e..a8cba40 100644 --- a/window/window.h +++ b/window/window.h @@ -41,7 +41,7 @@ void initWindow(uintptr handle){ } mData.XWin = 0; - + XCloseDisplay(rDisplay); #elif defined(IS_WINDOWS) mData.HWnd = 0; #endif @@ -125,6 +125,7 @@ bool IsValid(){ // Free result and return true XFree(result); + XCloseDisplay(rDisplay); return true; #elif defined(IS_WINDOWS) @@ -412,7 +413,7 @@ void SetActive(const MData win){ XSetInputFocus(rDisplay, win.XWin, RevertToParent, CurrentTime); } - + XCloseDisplay(rDisplay); #elif defined(IS_WINDOWS) if (IsMinimized()) { @@ -502,6 +503,7 @@ MData GetActive(void){ Window window = None; int revert = RevertToNone; XGetInputFocus(rDisplay, &window, &revert); + XCloseDisplay(rDisplay); // Return foreground window result.XWin = window; @@ -590,7 +592,7 @@ void close_window_by_Id(MData m_data){ // Close the window XDestroyWindow(rDisplay, m_data.XWin); - + XCloseDisplay(rDisplay); #elif defined(IS_WINDOWS) PostMessage(m_data.HWnd, WM_CLOSE, 0, 0);