After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 796121 - Cannot take a screenshot on Windows 10
Cannot take a screenshot on Windows 10
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
2.10.0
Other Windows
: Normal major
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on: 793722
Blocks:
 
 
Reported: 2018-05-14 22:46 UTC by Deon Ballard
Modified: 2018-05-15 23:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Print screen of my entire screen for comparison (2.90 MB, image/png)
2018-05-14 22:46 UTC, Deon Ballard
Details
Screenshot using the "select window" option (74.42 KB, image/png)
2018-05-14 22:48 UTC, Deon Ballard
Details
Screenshot using the "full screen" option (126.75 KB, image/png)
2018-05-14 22:48 UTC, Deon Ballard
Details
Screenshot using the "full screen" option with delay (439.59 KB, image/png)
2018-05-14 22:53 UTC, Deon Ballard
Details
Image that describe when the bug happan (61.14 KB, image/png)
2018-05-15 08:42 UTC, Gil Eliyahu
Details

Description Deon Ballard 2018-05-14 22:46:40 UTC
Created attachment 372039 [details]
Print screen of my entire screen for comparison

Hey. 

There is no way to get the screenshot tool (Create > From Screenshot > any option) to work. It takes pictures of random parts of the Gimp UI. 

I am attaching a print screen of my entire desktop (FWIW, Create > From Clipboard seems to work) to show what I should be getting. I've tried dragging the selector to the window (in this case, Microsoft Edge, though I tried some random programs just to check), adding a delay to make sure that the window was active, and taking a screenshot of the whole screen.
Comment 1 Deon Ballard 2018-05-14 22:48:04 UTC
Created attachment 372040 [details]
Screenshot using the "select window" option

I get the same result with or without a delay -- just a corner of the Gimp UI and not the window I selected and / or the active window.
Comment 2 Deon Ballard 2018-05-14 22:48:42 UTC
Created attachment 372041 [details]
Screenshot using the "full screen" option

A slightly larger portion of the Gimp UI.
Comment 3 Deon Ballard 2018-05-14 22:53:24 UTC
Created attachment 372042 [details]
Screenshot using the "full screen" option with delay

For this, I used a delay and minimized the gimp UI. It selected the same area of the screen, but got a corner of the file folder that I had open *behind* the gimp UI. 

I am on Windows 10.

Near as I can tell, Windows has some kind of tiling grid for the screen. Gimp will only select or recognize the tile area that the program seems to be in.
Comment 4 Gil Eliyahu 2018-05-15 08:42:30 UTC
Created attachment 372045 [details]
Image that describe when the bug happan

Bug confirmed and resolved.

The bug happens in Windows 10 and probably also in Windows 8, 8.1.
This happens when the display scaling is not 100%. look at the image I attached.

The solution is simple:
In file gimp\plug-ins\screenshot\screenshot-win32.c

Under function "InitInstance" - The first line in the function should be:
SetProcessDPIAware();

This will solve the bug.

I want to point out that I will include this solution in the patch I working on, for this bug report: 
https://bugzilla.gnome.org/show_bug.cgi?id=793722
I will submit the patch there. the patch will fix this bug also.


Thank you for the report.

Gil Eliyahu
Comment 5 Jehan 2018-05-15 11:06:25 UTC
Awesome. Thanks Gil!
Comment 6 Jehan 2018-05-15 23:14:41 UTC
Fixed together with bug 793722:

commit ae93b6db187cfc949d06f08a62effdf811199719
Author: Gil Eliyahu <gileli121@gmail.com>
Date:   Tue May 15 18:04:19 2018 +0300

    Plug-ins: fix screenshot bugs in windows.
    
    This fixes bugs 793722 and 796121.
    In particular it fixes:
    - Single-window screenshot when partly off-screen or covered by another
      window.
    - Screenshots when display scaling is not 100%.

 plug-ins/screenshot/magnification-api-win32.h | 154 ++++++++++++++++++++++++++++++++++++++++++
 plug-ins/screenshot/screenshot-win32.c        | 353 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------
 2 files changed, 464 insertions(+), 43 deletions(-)