diff --git a/robotgo.go b/robotgo.go index 7c79bd4c..5ac065a6 100644 --- a/robotgo.go +++ b/robotgo.go @@ -457,6 +457,11 @@ func GetXDisplayName() string { return gname } +// CloseMainDisplay close the main X11 display +func CloseMainDisplay() { + C.close_main_display() +} + // Deprecated: use the ScaledF(), // // ScaleX get the primary display horizontal DPI scale factor, drop diff --git a/screen/goScreen.h b/screen/goScreen.h index 24321bf6..d4349a5a 100644 --- a/screen/goScreen.h +++ b/screen/goScreen.h @@ -79,6 +79,14 @@ char* get_XDisplay_name() { #endif } +void close_main_display() { + #if defined(USE_X11) + XCloseMainDisplay(); + #else + // + #endif +} + uint32_t get_num_displays() { #if defined(IS_MACOSX) uint32_t count = 0;