How to take a screenshot when you are using screen sharing I am accessing a mac using screen sharing. 

If I try to take a screenshot of a window using the built-in screenshot tool, I find that the screenshot consists of white background with shadow border as below.

Can anyone point out how to take screenshot while using screen sharing?

Edit-


The mac that is accessing through screen sharing is running macOS Mojave (10.14.6)
I am using TigerVNC client software running on Linux to access the mac.


Edit 2-

I find that taking a screenshot of a window using the built-in screenshot tool works if it meets the following conditions-


The window of which you are taking the screenshot should be the currently active window. 
The screenshot should be on a timer. After you click on capture and select a window, a countdown timer appears. You select the window one more time so that it becomes the active window and then wait for the screenshot 
to be taken
The window should be recently redrawn (or refreshed, I do not know the correct word). Try to scroll up/down in the window or do anything so that the window gets redrawn.
I use LaunchBar to start the ScreenCapture app (it used to be called Grab) so you can search for that as well. Spotlight or any other launcher should work.

Take the screen shot locally on the Mac is my advice and then save it to a cloud sync folder or otherwise get it to your remote is my advice. You get the standard keys and best resolution / drop shadow, correct key shortcuts this way.


https://support.apple.com/en-us/HT201361


LaunchBar is designed to Keep your hands on the keyboard. Well worth the cost for me - especially when I screen share in from Windows / Linux / iOS / iPadOS and even other Macs.


https://obdev.at/products/launchbar/index.html