8/15/2023 0 Comments Hiddenme proYou can work around this by getting CGRect for each Desktop and looking at CGRect for each screen. If there are multiple physical monitors with the same size, the class can get confused on which Desktop goes with which monitor. Images.append(NSImage(cgImage: cgImage!, size: NSMakeSize(CGFloat(cgImage!.width), CGFloat(cgImage!.height)))) Let cgImage = CGWindowListCreateImage(CGRect.null, CGWindowListOption(arrayLiteral: CGWindowListOption.optionIncludingWindow), index, CGWindowImageOption.nominalResolution) (self, selector: #selector(self.doHide), name: NSNotification.Name("doHide"), object: nil) // get notified when user hits Hide/Show Desktop Icons button just told us to hide the icons so why would they add some now? it is good that clicking on the fake desktop does activate the Finder. the only downside is if the user drags and tries to drop on the Desktop, it won't work (it's not the Desktop!), however its sort of consistent since they a further trick of setting window.level will make expose and mission control not see these windows. for efficiency we'll only create the number of windows as there are (physical) screens, but we'll force those windows to go onto all Spaces. here we'll use some Core Graphics tricks (see DesktopPictures extension to NSImage at end of file). the hard bit here is getting the picture of the Desktop(s). they haven't, we're just hiding them behind the pictures of the Desktop(s) and put those pictures in windows just above the actual Desktop. we're not going to do any such thing (we're not allowed to in a sandboxed app anyway). we're going to do some 'magic' here and let the user *think* we've hidden the Desktop Icons it appears to do the same thing as HiddenMe. I made a simple class in swift that simply watches for notification to either hide or unhide the desktop icons.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |