Screenshots with custom cursors in Ventura/Sonama show cursor wrong color and size

My app in Xojo uses several custom cursors. From Mohave to Monterey the screen shot (with shift-cmd-3) shows them exactly as on the screen, but in Ventura and Sonoma they are still correct on the screen but shown wrong color and size in a screen shot. Don’t know any fix and assume it ia problem with whatever OS X software that adds the cursor into a screenshot. Seems unlikely to be a Xojo issue.

Has anyone else had a similar problem with OS X screenshots?

The photo below shows the screen dump at the top and the screen image below it — the custom arrow is rendered in the wrong colors in the screen dump.

It would help if you could post screenshots and not photos made with your iPhone. OS X has been macOS for a couple of years now.

The photo was to show the actual screen and the screen shot of it together.

Here are png screen shots of the same window under Ventura and Monterey.


Monterey Screen Dump - Cursor correct

My custom cursors (Xojo image with the usual 3 resolutions) work fine in my app in macOS from Mohave to Sonoma (and In Windows). The Mac screen dumps using SHIFT-OPTION-3 are correct up to Monterey but false as shown in Ventura and Sonoma. There is no difference between dumps from Retina and non-Retina screens (except in the png resoltion).

I assume that this is a problem in the way that macOS inserts a cursor image into a screen dump that is different from the way it inserts it into the screen buffer. I have not reported it as a Xojo problem, but was interested to know if others using custom cursors had found the same problem.

ps if you think there is the slightest chance that it could be a Xojo issue, I would be happy to extract my cursors and code to whip up a quick project that would make it easy to test.

I just tried with an app of mine, and the behaviour I get is slightly different than your: the mouse cursor is completely hidden in the screen shots.

Well, it could be a Xojo issue, like if the cursor is being created using a legacy/deprecated API. I have the feeling that a missing cursor issue would have been spotted (no pun intended) and fixed if this was in the OS :man_shrugging:.

Thanks Arnaud, one needs to set the screen capture options (using SHIFT-COMMAND-5) to capture the cursor else it will not be inserted. The only slight evidence I have that it might be a Xojo issue is that other apps with custom cursors, such as Word, have their cursors captured correctly. I could not find another app with colored cursors but believe others have done so in Xojo — would be good to test one.

I have posted the source of a small custom cursor demo to tracker.xojo.com (#74752) which allows several custom cursors to be shown and captured through SHIFT-COMMAND-3, so that testers may analyse what is happening.

I have also used the same demo to report another cursor problem, that the cursor cannot be changed in Windows 11 when the mouse is down — there is no problem under macOS. On Windows this means that one cannot change the cursor to indicate, for example, that it is over graphic object in a drag. That may be a Windows issue, or it may be the Xojo code.

On the positive side, png-based custom cursors now work in exactly the same way in macOS and Windows — however, the manual has not been updated, still saying that one must use the ancient Windows cursor format.

The bug report is missing screenshots about what you mean with “rendered incorrectly”. I tried your example but I don’t see anything wrong with the cursor in the screenshot:

Hi Beatrix, your screen shot does not show the doubling of size of the cursor that I get with Ventura and Sonoma — what OS were you using? Also, the dark green color does not get distorted, only the fawn color of the pointer cursors — it gets rendered as turquoise in the screen shots. I am running on a first generation Mac Studio under Sonoma.

Ah yes, there are now two shortcuts to take screenshots.

While testing with ⌘⇧5, I found an interesting behaviour: when taking a screenshot, the mouse cursor is indeed missing (even using a 5 seconds timer to make sure the mouse is located at the right place) but when taking a video, the mouse cursor is there and looks normal.

Sonoma latest Beta, Xojo also latest beta.

When testing the screenshots I must have activated doing a screen recording. I noticed that free space was getting lower and lower. With Find Any File I found a 40 GB video!!! I don’t know what I clicked to make such a video. Shouldn’t I have seen something in the menubar that macOS is recording the screen? I also wasn’t able to find a way to stop screen recording. After a restart everything was okay again.

Press the same keystroke again and there is a stop button (Square) that will end the video recording. Also, consider the size of the screen with a retina it’s 4 times larger than it seems, which doesn’t help with sizes. You can choose an area of the screen to record, rather than the whole screen, which can help.

1 Like

Arnaud, I tried the video recording and, yes, the cursors are correct color and size — they are still twice the size and the light fawn is captured as turquoise for a simple screen shot.

Beatrix, it is interesting that the latest betas do not show the problem — mayb it was introduced in Ventura, propagated to Sonoma, but now fixed. CTL-CMD-ESC terminates video recording.

No-one has confirmed the distortion in screen shots with the released Ventura or Sonoma, so it is possible it is a corruption in my Mac Studio. It was present in Ventura and continued in Sonoma when I updated - on 14.1 now.

Ouch. I must have clicked on Record after doing Cmd-shift-5. The new button in the menubar is really unobtrusive.

1 Like

Yes, it’s not obvious, but then do you really want a big flashing icon in your videos. :slight_smile:

No, but I confirmed my cursors are hidden, which is probably the same issue.

Great tip, thanks!

I investigated whether the problem is only on my M1 Mac Studio by installing Sonoma 14.1.1 on a Mac Book 2018 that is empty except for the Apple-installed programs. It showed the enlarged with cursor with incorrect color fill. I also created a new volume on my Mac Studio and installed Sonoma 14.1.1 with the same result.

Arnaud, I checked the web and the problem of screen dumps not including the cursor even if requested is reported, with the recommendation to use the terminal screencapure command instead.

For example screencapture -C -m -P -T5 captures the cursor on the main screen and displays it in Preview allowing a 5sec delay so that one can can activate the application and show the cursor there. It is a very powerful command can capture a specified rectangle in any display and put it in the clip, a file or a specified application.

I put screencapture in a shell in my app to dump my top window in the clip when SnapZ Pro was no longer available and it worked well in capturing the cursor pre Ventura. I also have my old Mac Pro still running Mojave so that I can use SnapZ Pro when that is more convenient.

Robin Lauryssen-Mitchell send me an email noting that he could not replicate point 1 under 14.2 beta — I updated my MacBook Pro 2018 to 14.2 beta and the screen dumps (with CTL-CMD-3 which also works OK) are exact replicas of the screen, size and color are both correct. So it appears that Apple fixed the problem for an upcoming release.

Thanks to everyone who helped with this issue.

1 Like

@Dr_Brian_R_Gaines You might want to mark your last post as the solution for this topic. :slight_smile: