Re: Relieving memory pressure

2020-06-07 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for the hints - I'll look into the different ideas. Also thanks to Christos for his hints. Best regards, Gabriel smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do

Detect whether any app is fullscreen from shell script?

2020-06-07 Thread Gabriel Zachmann via Cocoa-dev
Is there a way to detect *from a shell script* whether any app on mac Mac is running in fullscreen mode? I don't really care which one it is, just whether any is in fullscreen. (Such as a video player, or a video in Safari playing in full-screen mode, or a PPT/Keynote presentation) I want to

Re: Relieving memory pressure

2020-06-07 Thread Gabriel Zachmann via Cocoa-dev
Good question. Well, some users want to feed my app with image files of 100 MB, even up to 400 MB (mostly jpeg compressed). Those images have resolutions of over 8k, sometimes over 10k. The slideshow app needs to be able to zoom into those images with at least a factor 2x scaling. So I

Relieving memory pressure

2020-06-07 Thread Gabriel Zachmann via Cocoa-dev
I am developing a slideshow app; one of its features is that it keeps a history of the last N images it has displayed. It keeps kind of a cache , where it stores, among other things, the image returned by CGImageSourceCreateThumbnailAtIndex(), because this is one of the expensive operations.

Re: NSPanel / NSTextView in Dark Mode

2020-06-05 Thread Gabriel Zachmann via Cocoa-dev
> Make sure the text color is set to a named color such as Label Color instead > of Black. If the text view doesn't contain text in the xib, it might not > remember the color. In the XIB, the NSTextView does not contain any text , just the usual placeholder "lore ipsum". > You might need to

NSPanel / NSTextView in Dark Mode

2020-06-05 Thread Gabriel Zachmann via Cocoa-dev
I have an NSPanel that contains just an NSTextView. The NSTextView is populated at init time using [helpView_ readRTFDFromFile: path]; I think, the NSPanel itself is created by all the XIB magic. Usually , the NSPanel is not visible; but when the user clicks a button, I present it using

Curious bug in oPanel under Mojave in screensaver

2020-05-28 Thread Gabriel Zachmann via Cocoa-dev
I have screensaver where the user can select a folder through the options sheet. In that sheet, I open an NSOpenPanel, make a few settings, runModal, let the user navigate and choose a folder, then get oPanel.URL. (Complete code below.) The curious thing is: The oPanel returns only the folder

Re: Is CGImage... thread-safe?

2020-05-27 Thread Gabriel Zachmann via Cocoa-dev
>> >> I've just had a crash in >> CGImageSourceCreateThumbnailAtIndex( new_image, 0, imageOpts ); > > We went through this quite a while ago in private emails. > CGImageSourceCreateThumbnailAtIndex is fine to use from any thread. Are you > sure the image source even has an image at index 0?

Is CGImage... thread-safe?

2020-05-26 Thread Gabriel Zachmann via Cocoa-dev
I've just had a crash in CGImageSourceCreateThumbnailAtIndex( new_image, 0, imageOpts ); The new_image and imageOpts were created/assigned just a few lines earlier in the code. (and in the debugger they appear to be non-null.) So I was wondering if CGImageSourceCreateThumbnailAtIndex() is

Re: Screensaver can capture mouse events under Catalina

2020-05-26 Thread Gabriel Zachmann via Cocoa-dev
> >> I can confirm: this is indeed critical. Otherwise, the .saver does not >> receive mouse events. >> >> Unfortunately, it seems that I still cannot get key events. > > If you are trying to get events from arrow or modifier keys, you have to use > keyDown and not keyUp. But you may not be

Re: Screensaver can capture mouse events under Catalina

2020-05-26 Thread Gabriel Zachmann via Cocoa-dev
>> Unfortunately, with -addGlobalMonitorForEventsMatchingMask: , >> the event is still passed on to the higher-up objects, so that makes the >> screensaver engine terminate the screensaver immediately. > > Does this mean you’re unable to set up a global event tap/monitor? If you > are able,

Re: Screensaver can capture mouse events under Catalina

2020-05-26 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response! Unfortunately, with -addGlobalMonitorForEventsMatchingMask: , the event is still passed on to the higher-up objects, so that makes the screensaver engine terminate the screensaver immediately. Best regards, Gabriel > On 26. May 2020, at 00:54, Sandor Szatmari

Re: Screensaver can capture mouse events under Catalina

2020-05-25 Thread Gabriel Zachmann via Cocoa-dev
>> Also, I'm adding a NSTrackingArea (but not when the screensaver is in >> preview mode). I think this is critical to making it work, but can't say >> for certain. >> >> trackingArea = NSTrackingArea(rect:bounds, >> options:[NSTrackingArea.Options.activeAlways, >>

Re: How to save a window's position and size

2020-05-25 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for the response. > >[self.window setFrame:[[NSScreen mainScreen] frame] display:YES]; It sort of works, but the window still has borders. I tried this: [self.window toggleFullScreen: nil]; and it makes the app start in real full-screen (no window borders), but then it

Re: Screensaver can capture mouse events under Catalina

2020-05-25 Thread Gabriel Zachmann via Cocoa-dev
>> >> https://iscreensaver.com >> > > Looks like a macOS application with screen saver functionality. You could > download it and try it It's a "screensaver builder": you add a bunch of picture, "build" a screensaver, and that sits then in your System Preferences' Desktop & Screensavers

Screensaver can capture mouse events under Catalina

2020-05-25 Thread Gabriel Zachmann via Cocoa-dev
Here is a screensaver (actually, screensaver builder) that can capture mouse events: https://iscreensaver.com Does anyone have an idea how they might be able to do it? Best regards, Gabriel smime.p7s Description: S/MIME cryptographic signature

Re: How to save a window's position and size

2020-05-24 Thread Gabriel Zachmann via Cocoa-dev
>> >> No guarantees, but you could try moving your code into an AppDelegate method >> that gets invoked earlier: >> >> - (void)applicationWillFinishLaunching:(NSNotification *)notification; >> Sorry for bothering again. The above solutions works very well. Now I would like to make my app

Xcode Archive builds Debug version?

2020-05-24 Thread Gabriel Zachmann via Cocoa-dev
When I do Product / Archive , Xcode builds my app and shows it in the Organizer. However, it only creates /tmp/Debug, even though the Scheme has Build Configuration = Release in the Archive section. (I have set Derived Data to /tmp in the Locations tab in Xcode's preferences.) I am confused:

Re: How to save a window's position and size

2020-05-23 Thread Gabriel Zachmann via Cocoa-dev
Looks good! Thanks! > On 23. May 2020, at 21:59, Carl Hoefs wrote: > > No guarantees, but you could try moving your code into an AppDelegate method > that gets invoked earlier: > > - (void)applicationWillFinishLaunching:(NSNotification *)notification; > > -Carl > smime.p7s Description:

Re: How to save a window's position and size

2020-05-23 Thread Gabriel Zachmann via Cocoa-dev
Actually, after observing the new behavior for a while, I have to say it's "almost" perfect. The window still opens at some funny position with a smallish size (where is that stored?), but with no content, just grey inside, for a split second, then it snaps to the autosaved position/size.

Re: How to save a window's position and size

2020-05-23 Thread Gabriel Zachmann via Cocoa-dev
Seems to work like a charm! thanks a lot. (For the record: [self.window setDelegate: self]; has to be done before setFrameAutosaveName.) Best regards, Gabriel smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list

How to save a window's position and size

2020-05-22 Thread Gabriel Zachmann via Cocoa-dev
I am trying to follow these instructions: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/WinPanel/Tasks/SavingWindowPosition.html However, my app doesn't have a NSWindowController. It just has a NSViewController and an AppDelegate. So i thought I could stick the two

Finding memory leaks

2020-05-20 Thread Gabriel Zachmann via Cocoa-dev
I have a few stupid questions regarding (potential) memory leaks, so please bear with me. First of all, my code is ARC managed. I tried the Leaks tool of Instruments. It tells me, if i understand correctly, that I have a leak at this line of my code: CFDictionaryRef fileProps =

Re: Concurrent loading of images ?

2020-05-18 Thread Gabriel Zachmann via Cocoa-dev
> I’m not sure if you can create and manipulate a CALayer on a background > thread, all UI code must be run on main thread. Yes, that's what I was suspecting, too. Interestingly, when I create a layer in the background, and add it to the main layer *in the background thread* , it helps a

Re: Concurrent loading of images ?

2020-05-18 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response! I have tried the CILanczosScaleTransform filter for downsizing. I have computed the scale factor exactly such that the new image has an extent not larger than the view. (Below is my code) But the performance was worse, at least with the software renderer. With

Re: Concurrent loading of images ?

2020-05-14 Thread Gabriel Zachmann via Cocoa-dev
> > Ahh, there’s a jitter when moving. Right. Sometimes it's a really lengthy stutter. > > Try creating an async dispatch to a background thread in a block. I thought i'm doing that with this code: -animateOneframe: // essentially, this gets called when the next image is to be displayed

Re: Concurrent loading of images ?

2020-05-13 Thread Gabriel Zachmann via Cocoa-dev
> > Care to post a video on a Google drive so that we can see it? Good idea - here is the video: https://owncloud.informatik.uni-bremen.de/index.php/s/TTGG6bKCMFLqY4g (encoded in H265/HEVC for saving file size) I think, you can see clearly the stuttering. Sometimes it is more subtle,

Re: Concurrent loading of images ?

2020-05-13 Thread Gabriel Zachmann via Cocoa-dev
> > Actually, can’t you disable screen updating while you’re swapping images? Would that mean that the animations are not .. animating during that time? That would defeat the whole purpose of the exercise . If I am mistaken: how would I disable screen updates? Best regards, Gabriel

Re: Concurrent loading of images ?

2020-05-12 Thread Gabriel Zachmann via Cocoa-dev
Thanks a million to everyone who has shared insights, hints, and advice on this. I have restructured my code, so now I do the heavy lifting of loading images in a serial dispatch queue. However, there is still sometimes some stuttering visible in the animation of the images. Does anyone have an

Re: Concurrent loading of images ?

2020-05-09 Thread Gabriel Zachmann via Cocoa-dev
> Time to learn some more about the frameworks you’re using then :) :-) > People have long dealt with this on iOS by doing tricks like first drawing > that image to a 1x1 bitmap on a worker thread before sending it on to the UI. Would that really make the background (worker) thread execute all

Re: Concurrent loading of images ?

2020-05-09 Thread Gabriel Zachmann via Cocoa-dev
> > Try Instruments. Apple have written a measuring tool for a reason :) Thanks for the hint. I've done that. In the Heaviest Stack Trace, I am seeing functions like CA::Transcation::commit() CA::Render::copy_image(..) CI::recursive_tile(..) etc None of these functions seems to get invoked

Re: Concurrent loading of images ?

2020-05-09 Thread Gabriel Zachmann via Cocoa-dev
Again, thanks a lot for all the helpful hints. Before restructuring my code, I did a few timings, using a set of test images ranging in size from 30 through 300 MB. I used mach_absolute_time() for this experiment. And now, I am confused. These are the execution times I have found for some of

Re: Concurrent loading of images ?

2020-05-09 Thread Gabriel Zachmann via Cocoa-dev
> Also, if you’re already getting a CGImageRef using > CGImageSourceCreateImageAtIndex, why not just set imgLayer.contents to the > CGImageRef? sorry, my previous response regarding this was incomplete. What I am doing is this, in order to get the EXIF orientation right: CIImage * image

Re: Concurrent loading of images ?

2020-05-09 Thread Gabriel Zachmann via Cocoa-dev
> > Also, if you’re already getting a CGImageRef using > CGImageSourceCreateImageAtIndex, why not just set imgLayer.contents to the > CGImageRef? Good point . What I am doing right now is: NSImage * nsimage = [self convertToNSImage: img withOrientation: img_orientation]; CALayer *

Re: Concurrent loading of images ?

2020-05-09 Thread Gabriel Zachmann via Cocoa-dev
> I would add, that for a long running process, open ended work, or task, I > would favor a thread. But for short and finite items I would favor > GCD/NSOperationQueue. > > Are you going to only load one image, the next image, in this concurrent > loading scenario? Or, will you be loading

Re: Concurrent loading of images ?

2020-05-08 Thread Gabriel Zachmann via Cocoa-dev
> Sure. Just be aware that if you're using NSImage, simply loading an NSImage > does not rasterize it; the class tries to be 'lazy' about doing work. So your > background task should explicitly render it, e.g. into an NSBitmapImageRep. I am using CGImageSourceCreateImageAtIndex and related

Re: Concurrent loading of images ?

2020-05-08 Thread Gabriel Zachmann via Cocoa-dev
> I second the use of GCD. Its also considerably simpler than NSThread, > NSOperationQueue/NSOperation et al. This is the kind of operation that GCD > was invented for. Thanks a lot for your response(s). To me a queue suggests that you have lots and lots of tasks arriving from the

Re: Concurrent loading of images ?

2020-05-08 Thread Gabriel Zachmann via Cocoa-dev
Thanks for the question: MacOS. > > iOS or MacOS? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Concurrent loading of images ?

2020-05-08 Thread Gabriel Zachmann via Cocoa-dev
I have kind of a slide-show app. Sometimes, when it switches from one image to the next, there is a noticeable lag when the file size of the next image is very big, say, 50 MB or more. Sometimes, it seems that loading the image takes 1-2 seconds. So, I was thinking, maybe it helps to load the

Re: Cocoa-dev Digest, Vol 17, Issue 62

2020-05-07 Thread Gabriel Zachmann via Cocoa-dev
>> >> Well, in my own -startAnimation, I do >> [super startAnimation]; > > Which could be doing all sorts of things that assume it's running in a known > screensaver environment. True. Should I skip this statement in case -startAnimation has been compiled into the app? Best regards,

Re: Minimizing my app kills timer ?

2020-05-05 Thread Gabriel Zachmann via Cocoa-dev
>> >> That is what I'm doing. >> I start my own timer, which periodically calls -animateOneFrame. >> I call -stopAnimation when the app is hidden, etc. > > Are you calling the base class' startAnimation or stopAnimation methods? Or > do you override those and never call the base class? I

Re: Minimizing my app kills timer ?

2020-05-04 Thread Gabriel Zachmann via Cocoa-dev
> The screensaver animation in macOS is reliant on the engine that drives it. > Recently that changed from an older engine to what we can only guess is a > newer one, but some of them still run in what is known as a newly named > legacyScreenSaver, yet ScreenSaverEngine still fits in there

Re: Minimizing my app kills timer ?

2020-05-04 Thread Gabriel Zachmann via Cocoa-dev
> >> On May 2, 2020, at 09:15, Gabriel Zachmann via Cocoa-dev >> wrote: >> >> ?I've got an app that makes heavy use of ScreenSaverView (i.e., creates an >> instance of a subclass). > > ScreenSaverView is for screensavers, not apps. It?s behavior

Re: Customizing the Notarization Workflow fails

2020-05-03 Thread Gabriel Zachmann via Cocoa-dev
Thanks a million to everybody for responding to my question! I have been following Joao's instructions at https://stackoverflow.com/questions/53101626/how-to-notarize-an-app-bundle-containing-helpers-embedded-in-it/56799591#56799591

Minimizing my app kills timer ?

2020-05-02 Thread Gabriel Zachmann via Cocoa-dev
I've got an app that makes heavy use of ScreenSaverView (i.e., creates an instance of a subclass). In that view, I am creating some CALayers with animations, which I exchange occasionally in method - (void) animateOneFrame of my class. All works fine, except when I minimize my app (using the

Re: Inconsistent fullscreen modes

2020-05-01 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response! I apologize for bothering you (and anybody else), because I have already found a solution myself. For the record, I am currently using [window_ toggleFullScreen: nil]; where window_ is what I get as parameter in - (void) viewWillMoveToWindow:

Inconsistent fullscreen modes

2020-05-01 Thread Gabriel Zachmann via Cocoa-dev
In my app, I defined a key that switches the window/view to fullscreen mode and back. Essentially, I use these commands: [self enterFullScreenMode: [NSScreen mainScreen] withOptions: nil]; and [self exitFullScreenModeWithOptions: nil]; where self is an NSView. This seems

Re: Customizing the Notarization Workflow fails

2020-04-25 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response. > I’m not sure how you would script the export, but if you go to menu option > Window -> Organizer, you can see your archives. Yes, I can see them. But when I do "Show in Finder", then "Show package contents", they contain nothing (except for an empty Products

Customizing the Notarization Workflow fails

2020-04-25 Thread Gabriel Zachmann via Cocoa-dev
I am trying to follow these instructions: https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow?language=objc However, I can't even achieve the first step ("Export a Package for Notarization"). As per the

Notarization: basic questions

2020-04-25 Thread Gabriel Zachmann via Cocoa-dev
This whole notarization business is still pretty new to me. I would like to notarize my screen saver, and distribute it outside the app store. I tried to read up on it as much as I can, but I still have a few very basic questions. As far as I understand, I need to enroll in the apple

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-23 Thread Gabriel Zachmann via Cocoa-dev
> > I believe that is why you are supposed to staple notarization tickets to your > apps. > Then, why would it "phone home" in case there is an internet connection? Best regards, Gabriel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-23 Thread Gabriel Zachmann via Cocoa-dev
> > It appears the problem is not with a local service, but that Apple > actually ?phones home? when a program asks for display name. > > I don?t know if this is common knowledge, but with notarization, Apple > now validates executables on your system before they are executed, and > it does

Re: Open a panel in secondary thread?

2020-03-23 Thread Gabriel Zachmann via Cocoa-dev
> > Yes, understood. Does the user have to ask for this process to begin, or > does it start automatically? The user starts the process by opening a directory. Then, when the process hits an alias pointing to some other directory, the process will ask the user again to open that directory.

Re: Open a panel in secondary thread?

2020-03-23 Thread Gabriel Zachmann via Cocoa-dev
>>> I would not do this. It is widely documented that AppKit API that produce >>> UI elements, like NSOpenPanel, are _not_ thread safe. >> >> Right, and that is why I have to execute any UI code in the main thread, >> or so I thought. >> As far as I understand, the dispatch_get_main_queue is

Re: Open a panel in secondary thread?

2020-03-23 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response. > I would not do this. It is widely documented that AppKit API that produce UI > elements, like NSOpenPanel, are _not_ thread safe. Right, and that is why I have to execute any UI code in the main thread, or so I thought. As far as I understand, the

Re: Open a panel in secondary thread?

2020-03-22 Thread Gabriel Zachmann via Cocoa-dev
> > Don't know if this helps you but you can look into dispatch_sync > and dispatch_async. > Thanks a lot! That made things very easy. I am opening the panel now with this piece of code: __block NSURL * user_permitted_url; __block long int result;

Open a panel in secondary thread?

2020-03-21 Thread Gabriel Zachmann via Cocoa-dev
Is it possible to open an NSOpenPanel in a secondary thread? I create the thread like this: directoryScanThread_ = [[NSThread alloc] initWithTarget: self selector: @selector(scanDirectory:)

How to ask user to grant access ?

2020-03-13 Thread Gabriel Zachmann via Cocoa-dev
PS: So far, I am not even getting permissions within the same app invocation. What I have tried is, when I hit an alias that is also a directory, I open an NSOpenPanel with setDirectoryURL: resolved URL of the alias. The user hits OK, then I try to set up an enumerator with that URL. However,

How to ask user to grant access ?

2020-03-13 Thread Gabriel Zachmann via Cocoa-dev
I am doing a directory enumeration , collecting a list of files for accessing them later. When I encounter aliases / symlinks, I would like to follow them. As far as I understand, in a sandboxed app, I need to ask the user to grant my app access to the directories the aliases point to. I guess

Re: Can't delete file on external disk

2020-03-12 Thread Gabriel Zachmann via Cocoa-dev
> > Are you using startAccessingSecurityScopedResource? Sorry I forgot to mention: yes, I do startAccessingSecurityScopedResource. Also, reading the files works just fine. (Haven't tried writing on them, because that is of no concern in my app. Just reading or deleting.) Best regards,

Can't delete file on external disk

2020-03-12 Thread Gabriel Zachmann via Cocoa-dev
In my app, I collect lists of files that reside on an external disk. When the user opens the directory of the files, I create a security-scoped bookmark like this: directoryBookmark_ = [dir bookmarkDataWithOptions: NSURLBookmarkCreationWithSecurityScope

ScreenSaverView does not get resized

2020-03-10 Thread Gabriel Zachmann via Cocoa-dev
I have a ScreenSaverView instantiated and added to a window of a stand-alone app like this: In MasterViewController: - (void) viewDidLoad { [super viewDidLoad]; saver_ = [[ArtSaverView alloc] initWithFrame: self.view.frame isPreview: NO ]; [self.view addSubview: saver_];

Re: applicationDidFinishLaunching not being called

2020-03-09 Thread Gabriel Zachmann via Cocoa-dev
ill look and see the individual classes, but I need this in an older > format to even open it. : / > >> On Mar 9, 2020, at 6:55 PM, Gabriel Zachmann via Cocoa-dev >> mailto:cocoa-dev@lists.apple.com>> wrote: >> >> I must have done something very stupid, acci

applicationDidFinishLaunching not being called

2020-03-09 Thread Gabriel Zachmann via Cocoa-dev
I must have done something very stupid, accidentally, but the method applicationDidFinishLaunching in my AppDelegate is not being called any more. I have googled and tried a few things, of course, to no avail. Does anyone have an idea what it might be? Maybe, some kind soul can take a quick

Sharing NIB/XIB between different apps?

2020-03-06 Thread Gabriel Zachmann via Cocoa-dev
Is it possible to share one NIB/XIB between two different apps? If yes, what would be the best approach for development: different Xcode projects, or different targets within the same Xcode project? More specifically, I have a screensaver with a relatively big configuration options sheet. All

Getting rid of "cannot check for malicious software"

2020-03-05 Thread Gabriel Zachmann via Cocoa-dev
When installing my screensaver (i.e., downloading and double-clicking), some people get a funny warning saying "cannot check for malicious software". In my Xcode project, I have "Automatically manage signing" switched on, with the signing certificate "Development". Is there anything I can do to

Re: Security scoped bookmarks example?

2020-03-05 Thread Gabriel Zachmann via Cocoa-dev
> > So, you created a security scoped bookmark, then what did you do with it? You > should store it in user defaults, then load it from user defaults the next > time your code starts up, reconstitute it back into a security scoped URL, > and then use *that* URL (literally that object, not a

Re: Image GPS Properties Question

2020-03-04 Thread Gabriel Zachmann via Cocoa-dev
> > Given a URL to an image I currently do this to grab image properties > (ignoring error handling to simplify the example code) > > let imgRef = CGImageSourceCreateWithURL(url as CFURL, nil) > let imgProps = CGImageSourceCopyPropertiesAtIndex(imgRef, 0, nil) as > NSDictionary? > let

Re: Security scoped bookmarks example?

2020-03-04 Thread Gabriel Zachmann via Cocoa-dev
I am still having problems in my screensaver to access files that are stored on an external disk. The disk is just a simple hard disk connected to my Macbook via USB. (It is an important use case, since a lot of people like to keep there huge image collections on external hard disks.) I can

Re: Embedded binary is not signed with the same certificate as the parent app

2020-03-03 Thread Gabriel Zachmann via Cocoa-dev
> > Why are you copying that app you are trying to build? > OK, I could just use the app bundle under /tmp/Release , I give you that. But I would also like to *understand* why things are not working (if they are not working). So, why would copying the app bundle to some other place (using in

Re: Embedded binary is not signed with the same certificate as the parent app

2020-03-03 Thread Gabriel Zachmann via Cocoa-dev
lex Zavatone mailto:z...@mac.com>> > wrote: > > Please send a screenshot of your copy files phase so we can clearly see what > you are trying. > > Thanks. > > Sent from my iPhone > >> On Mar 2, 2020, at 7:12 PM, Gabriel Zachmann via Cocoa-dev >> mai

Embedded binary is not signed with the same certificate as the parent app

2020-03-02 Thread Gabriel Zachmann via Cocoa-dev
I have a naked macOS app (created with Xcode's template "App"). I get this funny error message Embedded binary is not signed with the same certificate as the parent app but only, when I switch to Release *and* when I add a Copy Files phase with Destination = Absolute Path and Name =

Re: Sharing code between screensaver and regular app

2020-03-02 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response! > > File/New Project - Select MacOS and then “App” (from the New Project Dialog). That is what I did: see this screen recording: https://owncloud.informatik.uni-bremen.de/index.php/s/br8rN3HGYfj9w3d

Sharing code between screensaver and regular app

2020-03-02 Thread Gabriel Zachmann via Cocoa-dev
I am trying to replicate what this guy suggests: https://medium.com/better-programming/how-to-make-a-custom-screensaver-for-mac-os-x-7e1650c13bd8 under section "Additional Debugging". The idea is to create a standalone app that shares as much code with the screensaver as possible. I am

Re: Confusion about screen resolution

2020-02-22 Thread Gabriel Zachmann via Cocoa-dev
> For Retina displays, the backing store's size is always 2x the size in points > that Cocoa reports. The backing store is then scaled to the display's > physical resolution. > > Also, even if though the default point-size-to-display-physical-pixels used > to be 2x, remember that other

Re: Confusion about screen resolution

2020-02-22 Thread Gabriel Zachmann via Cocoa-dev
> > Does it make sense that starting at 1.7 gives you a 0.3 headroom for ‘zoom’ > without having to upsample? You mean the accessibility zoom? No, it does not make sense to me. First of all, I can zoom in much more, so why waste 0.3 headroom although most people don't even know about it?

Re: Confusion about screen resolution

2020-02-22 Thread Gabriel Zachmann via Cocoa-dev
> > No, the default on recent Macs is scaled to slightly under 2x. > It is about ~ 1.7 . this means that every view has to be scaled by this odd factor, before writing its contents into the frame buffer. I am curious as to why that doesn't cause any aliasing artefacts, or anti-aliasing

Re: Confusion about screen resolution

2020-02-22 Thread Gabriel Zachmann via Cocoa-dev
> > What have you set in System Preferences > Displays > Resolution. On a Retina > MacBook most I have set it to "Default for display" - shouldn't that set the resolution to the native one? Best regards, Gabriel ___ Cocoa-dev mailing list

Confusion about screen resolution

2020-02-22 Thread Gabriel Zachmann via Cocoa-dev
When my screensaver gets invoked by the screensaver engine, it calls - (id) initWithFrame: (NSRect) frameRect isPreview: (BOOL) preview Funny thing is, when I print the frameRect to the log, I get 1680 x 1050. But my laptop screen really has 2880 x 1800! (That's what I get from "About this

Re: Still problems accessing files from my screensaver

2020-02-18 Thread Gabriel Zachmann via Cocoa-dev
> And that?s exactly why you need to store SSBs. You only have permission to an > NSOpenPanel-gotten file for the current run or your program. Once it quits, > that permission goes away. I understand that - but how can I store SSBs, if the app (legacyScreenSaver) does not have the

Still problems accessing files from my screensaver

2020-02-18 Thread Gabriel Zachmann via Cocoa-dev
Sorry for bothering again. I would like to obtain some clarification regarding the problems I am having when my screensaver tries to load images that reside on an external disk. I have read the dev docs on sandboxing (

Re: More fun with CGImageSourceCreateWithURL

2020-02-17 Thread Gabriel Zachmann via Cocoa-dev
>> >> NSURL * url = [NSURL fileURLWithPath: [self absolutePathFor: filename_] >> isDirectory: NO]; >> if ( url == NULL ) >> { >> ... // never happened so far >> } >> CGImageSourceRef sourceRef = CGImageSourceCreateWithURL( (CFURLRef) url, >> NULL ); >> if ( sourceRef == NULL )

More fun with CGImageSourceCreateWithURL

2020-02-17 Thread Gabriel Zachmann via Cocoa-dev
One of my users (maybe, they others don't bother) told me that occasionally, they get an error message that must originate from this piece of code in my screensaver: NSURL * url = [NSURL fileURLWithPath: [self absolutePathFor: filename_] isDirectory: NO]; if ( url == NULL ) {

kCGImageStatusInvalidData

2020-02-17 Thread Gabriel Zachmann via Cocoa-dev
[From the mailing list, I have received an empty mail, so I am going to try again] In my screensaver , I am loading images using this piece of code: CGImageSourceRef sourceRef = CGImageSourceCreateWithURL( (CFURLRef) url, NULL ); if ( sourceRef == NULL ) { ... }

kCGImageStatusInvalidData

2020-02-16 Thread Gabriel Zachmann via Cocoa-dev
___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription:

Re: Handling of paths through sandbox

2020-02-12 Thread Gabriel Zachmann via Cocoa-dev
>> >> The problem is that the path names can get very long. >> And I am going to show them to the user. > > There is support in AppKit for displaying file paths to the user. > Unfortunately it's been I guess I should have said that I display the paths as a simple text overlay in my

Re: Handling of paths through sandbox

2020-02-12 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response. >> Problem is that I can't just do >> >> [ array_with_all_images addObject: [path substringFromIndex: ([dir_to_scan >> length] + 1)] ]; > > What is this supposed to be an array of? File names? Partial paths underneath > ~/Pictures? Exactly. The problem is

Catching keystrokes in my screensaver under Catalina

2020-02-11 Thread Gabriel Zachmann via Cocoa-dev
I used to be able to catch keystrokes in my screensaver under Mojave by defining my own methods -keyDown: and/or -processKey: This does not work any more under Catalina, it seems. My screensaver gets killed (stopped) right away. Not even -(void)stopAnimation is called any more! Does

Re: Sorting an array

2020-02-11 Thread Gabriel Zachmann via Cocoa-dev
Great! Thanks a lot. (Just for the record: it's called sortUsingSelector: ) Best regards, Gabriel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at

Handling of paths through sandbox

2020-02-11 Thread Gabriel Zachmann via Cocoa-dev
I have a question regarding the proper handling of paths under Catalina, some of which go through the Container, some don't. More specifically, I get the Pictures folder using this line of code: dir_to_scan = [NSHomeDirectory() stringByAppendingPathComponent: @"Pictures/"] This gives me a

Sorting an array

2020-02-11 Thread Gabriel Zachmann via Cocoa-dev
I have some trivial questions regarding sorting a simple array of strings. I used to use this code: NSSortDescriptor *sd = [[NSSortDescriptor alloc] initWithKey: nil ascending: YES];//TODO: raus [imagefiles_ sortUsingDescriptors: @[sd] ]; where imagefiles_ is an NSMutableArray* . Now,

Xcode can't launch System Preferences any more

2020-02-11 Thread Gabriel Zachmann via Cocoa-dev
XCode used to be able to launch SystemPreferences under Mojave. In the active scheme used for building, under Run / Info / Executable, I have SystemPreferences.app selected. "Launch" is set to "automatically". Now, after Xcode has (successfully) built my screensaver, I get this error message:

Re: Questions about sandboxing under Catalina

2020-01-10 Thread Gabriel Zachmann via Cocoa-dev
>> >> So, is .../Containers/.../Data/Pictures linked to ~/Pictures automatically? > No. The user has to give your app permission to see the contents of > ~/Pictures. > >

Re: Questions about sandboxing under Catalina

2020-01-10 Thread Gabriel Zachmann via Cocoa-dev
Steve, thanks a lot for your response! >> >> In my screensaver, I try to search the Pictures directory in the user's home. >> It is OK - for now - if my app cannot access any .photoslibrary, but I'd >> like to pick up >> any other images in ~/Pictures. >> >> I get the path using this line of

Questions about sandboxing under Catalina

2020-01-08 Thread Gabriel Zachmann via Cocoa-dev
I have two questions regarding sandboxing. 1. In my screensaver, I try to search the Pictures directory in the user's home. It is OK - for now - if my app cannot access any .photoslibrary, but I'd like to pick up any other images in ~/Pictures. I get the path using this line of code:

Re: How to check whether directory tree has changed?

2019-12-21 Thread Gabriel Zachmann via Cocoa-dev
> Are you looking to detect changes that happen in between launches of your > app? If so you’d have to save state and compare that saved state to the dir > contents each time the app is launched. Right. I was hoping there is an easy way to do this. Something like a recursive check sum over

Re: How to check whether directory tree has changed?

2019-12-21 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot! Does it really watch subfolders, too? Also, it seems to me like it works only while the program is running. I am mostly interested in changes that happen "behind the program's back", i.e., while it is *not* running. Does your code really handle that? Best regards, Gabriel >

How to check whether directory tree has changed?

2019-12-21 Thread Gabriel Zachmann via Cocoa-dev
Is there a quick and easy way to check whether or not a directory tree has changed? I am only interested in file additions or deletions, somewhere beneath a specific root directory, e.g., ~/Data/some_directory. However, I am interested in such changes between different invocations of my

Re: Future of Cocoa #2

2019-12-11 Thread Gabriel Zachmann via Cocoa-dev
> QT is probably the most viable cross-platform tool, but steep learning > curve and mediocre GUI. Will it survive if Cocoa is deprecated? Good question - I have no idea. But I suggest you reach out to the support, or ask on Qt's forums about roadmaps, or meet them in person at an

Re: Future of Cocoa

2019-11-21 Thread Gabriel Zachmann via Cocoa-dev
> > If someone can afford days/weeks to do watch WWDC sessions consistently > every year it's great. That's not a luxury all of us can afford and it's > ridiculous to think this should be a requirement. > But then, I am wondering, how does your company ensure your programmers stay

<    1   2   3   4   >