@@ -20,6 +20,7 @@ pub use crate::geometry::{CGPoint, CGRect, CGSize};
20
20
use crate :: image:: CGImage ;
21
21
use core_foundation:: base:: { CFRetain , TCFType } ;
22
22
use core_foundation:: string:: { CFString , CFStringRef } ;
23
+ use core_graphics_types:: base:: kCGErrorSuccess;
23
24
use foreign_types:: { foreign_type, ForeignType } ;
24
25
25
26
pub type CGDirectDisplayID = u32 ;
@@ -185,7 +186,7 @@ impl CGDisplay {
185
186
let result = unsafe {
186
187
CGGetDisplaysWithPoint ( point, 0 , ptr:: null_mut ( ) , & mut matching_display_count)
187
188
} ;
188
- if result == 0 {
189
+ if result == kCGErrorSuccess {
189
190
Ok ( matching_display_count)
190
191
} else {
191
192
Err ( result)
@@ -213,7 +214,7 @@ impl CGDisplay {
213
214
)
214
215
} ;
215
216
216
- if result == 0 {
217
+ if result == kCGErrorSuccess {
217
218
Ok ( ( displays, matching_display_count) )
218
219
} else {
219
220
Err ( result)
@@ -227,7 +228,7 @@ impl CGDisplay {
227
228
let mut matching_display_count: u32 = 0 ;
228
229
let result =
229
230
unsafe { CGGetDisplaysWithRect ( rect, 0 , ptr:: null_mut ( ) , & mut matching_display_count) } ;
230
- if result == 0 {
231
+ if result == kCGErrorSuccess {
231
232
Ok ( matching_display_count)
232
233
} else {
233
234
Err ( result)
@@ -254,7 +255,7 @@ impl CGDisplay {
254
255
)
255
256
} ;
256
257
257
- if result == 0 {
258
+ if result == kCGErrorSuccess {
258
259
Ok ( ( displays, matching_display_count) )
259
260
} else {
260
261
Err ( result)
0 commit comments