File tree Expand file tree Collapse file tree 3 files changed +22
-6
lines changed
Expand file tree Collapse file tree 3 files changed +22
-6
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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+
8290uint32_t get_num_displays () {
8391 #if defined(IS_MACOSX )
8492 uint32_t count = 0 ;
Original file line number Diff line number Diff line change 2424 dispatch_semaphore_signal (semaphore );
2525 return ;
2626 }
27+
2728 SCDisplay * target = nil ;
2829 for (SCDisplay * display in content .displays ) {
2930 if (display .displayID == id ) {
4142 config .sourceRect = diIntersectDisplayLocal ;
4243 config .width = diIntersectDisplayLocal .size .width ;
4344 config .height = diIntersectDisplayLocal .size .height ;
45+
4446 [SCScreenshotManager captureImageWithFilter :filter
45- configuration :config
46- completionHandler :^(CGImageRef img , NSError * error ) {
47- if (!error ) {
48- image1 = CGImageCreateCopyWithColorSpace (img , colorSpace );
49- }
50- dispatch_semaphore_signal (semaphore );
47+ configuration :config
48+ completionHandler :^(CGImageRef img , NSError * error ) {
49+ if (!error ) {
50+ image1 = CGImageCreateCopyWithColorSpace (img , colorSpace );
51+ }
52+ dispatch_semaphore_signal (semaphore );
5153 }];
5254 }
5355 }];
56+
5457 dispatch_semaphore_wait (semaphore , DISPATCH_TIME_FOREVER );
5558 dispatch_release (semaphore );
5659 return image1 ;
You can’t perform that action at this time.
0 commit comments