Bug 369330 - 'Window under cursor' assume wrongly that dialogs are always in the upper left corner
Summary: 'Window under cursor' assume wrongly that dialogs are always in the upper lef...
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-25 13:33 UTC by Achim Bohnet
Modified: 2016-10-13 00:12 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 16.12


Attachments
Result when clicking on the dialog: screenshot of upper left area with dimension of the dialog. Dialog itself is partially visible in the lower right area (56.82 KB, image/png)
2016-09-25 13:34 UTC, Achim Bohnet
Details
Real HW: Snapshot of spectable dialog with 'window under cursor' That shows 0.0 of the screen is used (42.39 KB, image/png)
2016-09-28 08:29 UTC, Achim Bohnet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Achim Bohnet 2016-09-25 13:33:19 UTC
When I tried to make a snapshot of dialogs,  spectable always captures they upper left area with the width and height of the dialog.  It not capture the dialog itself.

Reproduceable in virtualbox mit neon pkg from master and  PC with 4.7.4

Reproducible: Always

Steps to Reproduce:
1. open kate
2. Ctrl^O to open the 'open file' dialog.
3. Make sure the dialog is not in the upper left corner
4. Start spectable
5. select 'window under cursor' and click on the open file dialog of kate

Actual Results:  
spectable makes a screenshot of the upper left aera of the screen with the dimensions of the dialog (see screenshot)

Expected Results:  
spectable makes a screenshot of the dialog

A workaround for the bug is to move the dialog in the upper left corner and then take the screenshot.   :-)

Thx for the cool tools spectacle!
Achim
Comment 1 Achim Bohnet 2016-09-25 13:34:26 UTC
Created attachment 101283 [details]
Result when clicking on the dialog: screenshot of upper left area with dimension of the dialog.  Dialog itself is partially visible in the lower right area
Comment 2 Christoph Feck 2016-09-26 21:46:00 UTC
Isn't virtualbox basically _one_ big window?
Comment 3 Achim Bohnet 2016-09-27 06:47:30 UTC
The bug happened with Spectacle running in the guest system of virtualbox, not the host system.
Comment 4 Achim Bohnet 2016-09-28 08:27:20 UTC
HI, I've tried in a Mac Air with kde neon dev stable 16.08.* bugfix branch.   Same bug.  See screenschot for  versions used (in bg there's the pkg version).
Comment 5 Achim Bohnet 2016-09-28 08:29:02 UTC
Created attachment 101325 [details]
Real HW: Snapshot of spectable dialog with 'window under cursor'  That shows 0.0 of the screen is used
Comment 6 Peter Wu 2016-10-10 17:01:20 UTC
Confirmed, when calculating the area, the translated window position was not correctly taken into account. I've a local patch available (which depends on other cleanup tasks). Will propose for review when the series is complete.
Comment 7 Peter Wu 2016-10-13 00:12:49 UTC
Git commit aab52c83ba70e9867632e83bd81715fc4405ffcf by Peter Wu.
Committed on 13/10/2016 at 00:12.
Pushed by peterwu into branch 'master'.

Capture all windows for "Window under cursor"

Capture the correct area, not just the top-left one (bug 369330).
Capture all possible related windows, not just the top-level (or the
non-transient background window), this will correctly capture whole
applications including the open menus (bug 357223).

The last change also affects how windows with other overlapping ones are
captured, previously the hidden area is shown as if there was no popup.
For example, Kate would be captured and not its Open dialog.

Tested with Kate (Qt 5): Open File -> Add Places Entry -> Select Icon.
Verify that clicking all of these menus show the same screenshot and
that the non-overlapping parts are shown. Right-click to open a context
menu, this is also captured on the delayed screenshot.

Tested with heimdall-frontend and Hedgewars (Qt 4): open a menu, keep
the cursor on it. Verify that the menu and window are captured. Do the
same, but with the cursor outside the menu.

REVIEW: 129163
Related: bug 357223
FIXED-IN: 16.12

M  +37   -54   src/PlatformBackends/X11ImageGrabber.cpp
M  +1    -2    src/PlatformBackends/X11ImageGrabber.h

http://commits.kde.org/spectacle/aab52c83ba70e9867632e83bd81715fc4405ffcf