Skip to content

Commit 3e5b10f

Browse files
committed
Add: export XClose main display function
1 parent cb51e2a commit 3e5b10f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

robotgo.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,11 @@ func GetXDisplayName() string {
457457
return gname
458458
}
459459

460+
// CloseMainDisplay close the main X11 display
461+
func CloseMainDisplay() {
462+
C.close_main_display()
463+
}
464+
460465
// Deprecated: use the ScaledF(),
461466
//
462467
// ScaleX get the primary display horizontal DPI scale factor, drop

screen/goScreen.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ char* get_XDisplay_name() {
7979
#endif
8080
}
8181

82+
void close_main_display() {
83+
#if defined(USE_X11)
84+
XCloseMainDisplay();
85+
#else
86+
//
87+
#endif
88+
}
89+
8290
uint32_t get_num_displays() {
8391
#if defined(IS_MACOSX)
8492
uint32_t count = 0;

0 commit comments

Comments
 (0)