Lazarus OS X Timer issue ¿Nap? lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- redbarcelona · 2016-07-01 10:42 Hi. I'm new programming in Lazarus for Mac, but not for Windows. I have a little application in Windows that uses a Timer to handle the time I spent programing or doing other things. I have ported it to OS X, but there is an annoying issue. The Timer in the app works well and do the job when I look it, but when gone to taskbar and returns after a while the time is not correct. I have been searching about it, and found information about Nap , but it's not possible to mark it to prevent Nap, because no checkbox exist. Does anyone has idea of how to prevent this. Thank you. ---------------------------------------------------------------------- redbarcelona · 2016-07-01 17:01 I've found that: https://www.ihash.eu/2014/12/disable-app-nap-system- wide-os-x-yosemite/., works for El Capitan too, but no more napping on the rest of apps. This resolves the problem through the Mac preferences, but, do you know if is there a way to mark "Prevent Nap" on a Lazarus App? ---------------------------------------------------------------------- felipemdc · 2016-07-01 19:21 first we need ti figure out what to do, maybe the answer here: http://stackoverflow.com/questions/19847293/disable-app-nap-in- macos-10-9-mavericks-application then convert it to pascal. look at the code at lazarus/lcl/interfaces/cocoa/*.pas to see how objective pascal works. ---------------------------------------------------------------------- felipemdc · 2016-07-01 19:28 looks like you can write this in the bundle: https://forum.xojo.com/10898-mavericks-is-putting-my-app-to-sleep/0 ---------------------------------------------------------------------- redbarcelona · 2016-07-02 09:52 Thank you. This is currently working for me. 1.- Create the bundle from Lazarus->Project->Project options. 2.- Move to theapp.app and edit Info.plist with Textwrangler, changing only the string com.company.programname to com.mycompany.myprogramname. 3.- I've deleted the link to the app in Contents/MacOS and replaced it with the real app 4.- I've copied the program.app to the /Applications folder. 5.- Using the terminal I've used this command: defaults write com.mycompany.myprogramname NSAppSleepDisabled -bool YES Despite of I can't see the checkbox "Prevent Nap", using Activity Monitor the app never naps.