Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window thumbnails only show parts of the window that are on-screen #110

Closed
lwouis opened this issue Jan 4, 2020 · 5 comments
Closed

Window thumbnails only show parts of the window that are on-screen #110

lwouis opened this issue Jan 4, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@lwouis
Copy link
Owner

lwouis commented Jan 4, 2020

It seems that the screenshot API doesn't show offscreen content

@lwouis lwouis added the bug Something isn't working label Jan 4, 2020
@lwouis
Copy link
Owner Author

lwouis commented Jan 4, 2020

I compared the 3 known screenshot APIs:

  • (private) CGSHWCaptureWindowList: doesn't show offscreen content
  • (private) CGSCaptureWindowsContentsToRectWithOptions: doesn't show offscreen content
  • (public) CGWindowListCreateImage: : does show offscreen content

The issue being that the only API that shows offscreen content is by far the slowest

@lwouis lwouis mentioned this issue Jan 5, 2020
6 tasks
@rbnis
Copy link
Contributor

rbnis commented Jan 5, 2020

A possible solution for this would be to check if the GRect of a window is in the GRect of the screen and if this is not the case taking the screenshot with CGWindowListCreateImage.
I have briefly tested this and it seems to work not to bad. Having multiple displays is a performance hit, here would be more logic required than I currently have in place.

@lwouis If you like I can make a PR for this.

@lwouis
Copy link
Owner Author

lwouis commented Jan 5, 2020

I actually already thought about doing that, but I'm not convinced it's actually an improvement:

  • The trade-off here is speed vs accuracy. Different people will prefer one over the other.
  • Some users may have lots of windows partially off-screen. These users will think the app is slow
  • One could argue that the window being cut are a better representation for the user when they are browsing the list of thumbnails. If my window was half off-screen, maybe I'll locate it faster in the list of thumbnails if it's showing the visible half there. I'm not convinced by this argument btw, but I thought it's interesting to think about

We could:

  • Add another preference for that
  • "Vote" somehow on which way should prevail
  • Let the "market" decide by waiting for complaints and change the status quo if people complain enough

Overall I would say because our time is limited, let's keep the status quo until people actually complain by upvoting the ticket I opened

@lwouis
Copy link
Owner Author

lwouis commented May 11, 2020

For some reason I don't understand, it seems that the windows are shown entirely now, at least on my machine. I can put them partially off-screen, and they show entirely in AltTab.

Should I close this ticket? It is happening for anyone else?

@lwouis
Copy link
Owner Author

lwouis commented May 21, 2020

Closing this ticket as it seems the cropping stopped at some point.

@lwouis lwouis closed this as completed May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants