I’m trying to trigger the same thing that the system does when you click on “Detect Displays” in the “Displays” System Preferences pane. Is there a way to do this programmatically? My goal is to create a LaunchAgent that does this at login to reset the display resolution in case a user messes with it.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- back button text does not change
- How to create PNG images with more than 72dpi usin
- iOS (objective-c) compression_decode_buffer() retu
相关文章
- 现在使用swift开发ios应用好还是swift?
- Visual Studio Code, MAC OS X, OmniSharp server is
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- IntelliJ IDEA can't open projects or add SDK o
- Automator: How do I use the Choose from List actio
- Unable to process app at this time due to a genera
- How can I add media attachments to my push notific
Since the
CGDisplayIOServicePort
call has been deprecated in OS X 10.9 Mavericks, it may be better to acquire the IOFramebuffer service through an appropriate matching call like so:You will need to use a private CoreGraphics routine to get the list of all displays including inactive ones, and then request a rescan of the bus. Try it like this:
And link to ApplicationServices and IOKit.