Merge pull request #439 from go-vgo/bitmap-pr

Close window X11 display and update CI
This commit is contained in:
Evans 2022-01-19 12:46:29 -04:00 committed by GitHub
commit b81aad6085
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 6 deletions

View File

@ -5,7 +5,7 @@ jobs:
docker: docker:
# using custom image, see .circleci/images/primary/Dockerfile # using custom image, see .circleci/images/primary/Dockerfile
# - image: govgo/robotgoci:1.10.3 # - 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 working_directory: /gopath/src/github.com/go-vgo/robotgo
steps: steps:
- checkout - checkout

View File

@ -1,5 +1,5 @@
# FROM golang:1.10.1 # 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 # FROM govgo/go:1.11.1
RUN apt update && apt install -y --no-install-recommends \ RUN apt update && apt install -y --no-install-recommends \

View File

@ -34,7 +34,7 @@ environment:
PATH: C:\msys64\mingw32\bin\;C:\Program Files (x86)\NSIS\;%PATH% PATH: C:\msys64\mingw32\bin\;C:\Program Files (x86)\NSIS\;%PATH%
# - COMPILER: MINGW_W64 # - COMPILER: MINGW_W64
# ARCHITECTURE: x64 # ARCHITECTURE: x64
GOVERSION: 1.17.5 GOVERSION: 1.17.6
# GOPATH: c:\gopath # GOPATH: c:\gopath
# scripts that run after cloning repository # scripts that run after cloning repository

View File

@ -135,6 +135,7 @@ typedef struct _Bounds Bounds;
// Reinstate old handler // Reinstate old handler
XSetErrorHandler(mOld); XSetErrorHandler(mOld);
XCloseDisplay(rDisplay);
} }
// Definitions // Definitions
@ -182,6 +183,7 @@ typedef struct _Bounds Bounds;
WM_ACTIVE = XInternAtom(rDisplay, "_NET_ACTIVE_WINDOW", True); WM_ACTIVE = XInternAtom(rDisplay, "_NET_ACTIVE_WINDOW", True);
WM_HINTS = XInternAtom(rDisplay, "_MOTIF_WM_HINTS", True); WM_HINTS = XInternAtom(rDisplay, "_MOTIF_WM_HINTS", True);
WM_EXTENTS = XInternAtom(rDisplay, "_NET_FRAME_EXTENTS", True); WM_EXTENTS = XInternAtom(rDisplay, "_NET_FRAME_EXTENTS", True);
XCloseDisplay(rDisplay);
} }
@ -219,6 +221,7 @@ typedef struct _Bounds Bounds;
XFree (result); XFree (result);
} }
XCloseDisplay(rDisplay);
return NULL; return NULL;
} }
@ -262,6 +265,7 @@ typedef struct _Bounds Bounds;
XFree(desktop); XFree(desktop);
} }
} }
XCloseDisplay(rDisplay);
} }
static Bounds GetFrame(MData win){ static Bounds GetFrame(MData win){

View File

@ -224,6 +224,8 @@ Bounds get_client(uintptr pid, uintptr isHwnd){
bounds.Y = y; bounds.Y = y;
bounds.W = attr.width; bounds.W = attr.width;
bounds.H = attr.height; bounds.H = attr.height;
XCloseDisplay(rDisplay);
return bounds; return bounds;
#elif defined(IS_WINDOWS) #elif defined(IS_WINDOWS)

View File

@ -41,7 +41,7 @@ void initWindow(uintptr handle){
} }
mData.XWin = 0; mData.XWin = 0;
XCloseDisplay(rDisplay);
#elif defined(IS_WINDOWS) #elif defined(IS_WINDOWS)
mData.HWnd = 0; mData.HWnd = 0;
#endif #endif
@ -125,6 +125,7 @@ bool IsValid(){
// Free result and return true // Free result and return true
XFree(result); XFree(result);
XCloseDisplay(rDisplay);
return true; return true;
#elif defined(IS_WINDOWS) #elif defined(IS_WINDOWS)
@ -412,7 +413,7 @@ void SetActive(const MData win){
XSetInputFocus(rDisplay, win.XWin, XSetInputFocus(rDisplay, win.XWin,
RevertToParent, CurrentTime); RevertToParent, CurrentTime);
} }
XCloseDisplay(rDisplay);
#elif defined(IS_WINDOWS) #elif defined(IS_WINDOWS)
if (IsMinimized()) { if (IsMinimized()) {
@ -502,6 +503,7 @@ MData GetActive(void){
Window window = None; Window window = None;
int revert = RevertToNone; int revert = RevertToNone;
XGetInputFocus(rDisplay, &window, &revert); XGetInputFocus(rDisplay, &window, &revert);
XCloseDisplay(rDisplay);
// Return foreground window // Return foreground window
result.XWin = window; result.XWin = window;
@ -590,7 +592,7 @@ void close_window_by_Id(MData m_data){
// Close the window // Close the window
XDestroyWindow(rDisplay, m_data.XWin); XDestroyWindow(rDisplay, m_data.XWin);
XCloseDisplay(rDisplay);
#elif defined(IS_WINDOWS) #elif defined(IS_WINDOWS)
PostMessage(m_data.HWnd, WM_CLOSE, 0, 0); PostMessage(m_data.HWnd, WM_CLOSE, 0, 0);