开发者

CGDisplayHideCursor, CGDisplayShowCursor and CGWindowListCreateImage problem when screen is zoomed

开发者 https://www.devze.com 2023-02-12 22:12 出处:网络
I am developing a Desktop application in which I am reading the screen buffer data and create image out of it. I use the call glReadPixels to read the screen data.

I am developing a Desktop application in which I am reading the screen buffer data and create image out of it. I use the call glReadPixels to read the screen data.

  1. If I do not want to show the cursor in the image created from screen buffer, I hide the cursor using the call CGDisplayHideCursor before creating the image from screen buffer.

  2. If I want to show the cursor in the image created from screen buffer, I enable use the开发者_StackOverflow中文版 call CGDisplayShowCursor before creating the image from screen buffer.

This works fine in normal scenario. But, if I try this when the screen is zoomed:

  1. Cursor is shown in the image created from the screen even if I hide it.
  2. Two cursors are shown in the image created from the screen even if I show the cursor.

What is the problem here?


I could solve it using CGCursorIsDrawnInFramebuffer which tells if the cursor is included in the buffer or not.

0

精彩评论

暂无评论...
验证码 换一张
取 消