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

ImageGrab.grab() doesn't ignore windows layered on top (tooltip, pop-ups, etc.) #8456

Open
a-alak opened this issue Oct 10, 2024 · 2 comments

Comments

@a-alak
Copy link

a-alak commented Oct 10, 2024

What did you do?

Run PIL.ImageGrab.grab() without arguments.

What did you expect to happen?

Until now this has not included pop-ups and tooltips in the screenshot.
I just updated to windows 11.
I can see in issue #2569 that it is the expected behavior to not include layered windows, and that the option to include them was added, but not as a default.

I suppose the underlying API has changed in windows 11.
Anyone that can share some knowledge about this?

What are your OS, Python and Pillow versions?

  • OS: Windows 11
  • Python: 3.10.5
  • Pillow: 10.4.0
--------------------------------------------------------------------
Pillow 10.4.0
Python 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)]
--------------------------------------------------------------------
Python executable is C:\Users\Public\SPEDA\env\Scripts\python.exe
Environment Python files loaded from C:\Users\Public\SPEDA\env
System Python files loaded from C:\Program Files\Python310
--------------------------------------------------------------------
Python Pillow modules loaded from C:\Users\Public\SPEDA\env\lib\site-packages\PIL
Binary Pillow modules loaded from C:\Users\Public\SPEDA\env\lib\site-packages\PIL
--------------------------------------------------------------------
--- PIL CORE support ok, compiled for 10.4.0
--- TKINTER support ok, loaded 8.6
--- FREETYPE2 support ok, loaded 2.13.2
--- LITTLECMS2 support ok, loaded 2.16
--- WEBP support ok, loaded 1.4.0
--- WEBP Transparency support ok
--- WEBPMUX support ok
--- WEBP Animation support ok
--- JPEG support ok, compiled for libjpeg-turbo 3.0.3
--- OPENJPEG (JPEG2000) support ok, loaded 2.5.2
--- ZLIB (PNG/ZIP) support ok, loaded 1.3.1
--- LIBTIFF support ok, loaded 4.6.0
*** RAQM (Bidirectional Text) support not installed
*** LIBIMAGEQUANT (Quantization method) support not installed
*** XCB (X protocol) support not installed
--------------------------------------------------------------------
@radarhere radarhere changed the title PIL.ImageGrab.grab() doesn't ignore windows layered on top (tooltip, pop-ups, etc.) ImageGrab.grab() doesn't ignore windows layered on top (tooltip, pop-ups, etc.) Oct 10, 2024
@radarhere
Copy link
Member

Could you attach an image to show what you're seeing?

@a-alak
Copy link
Author

a-alak commented Oct 10, 2024

Yeah sorry, what i tested on was sensitive data, so i could not share.
But here is an alternative example with the file explorer.
Example 1 shows a tooltip with the url of the Outlook shortcut.
Usually i would have expected the tooltip not to show in the screenshot like example 2.

exmple1
example2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants