Screenshot of non active window

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












7















How to take a screen shot of non active window? If I have 2 windows, I want to capture the screenshot of the one which is running in the background.










share|improve this question
























  • Interesting, I'm not sure if that's possible.

    – phunehehe
    May 21 '13 at 16:20






  • 1





    I think you should improve your question by making clear what is meant by "non active". Is this window, presumably not the one in focus, totally visible or partly visible or not visible at all because the active window covers part or all of it?

    – user15760
    May 21 '13 at 16:54















7















How to take a screen shot of non active window? If I have 2 windows, I want to capture the screenshot of the one which is running in the background.










share|improve this question
























  • Interesting, I'm not sure if that's possible.

    – phunehehe
    May 21 '13 at 16:20






  • 1





    I think you should improve your question by making clear what is meant by "non active". Is this window, presumably not the one in focus, totally visible or partly visible or not visible at all because the active window covers part or all of it?

    – user15760
    May 21 '13 at 16:54













7












7








7


2






How to take a screen shot of non active window? If I have 2 windows, I want to capture the screenshot of the one which is running in the background.










share|improve this question
















How to take a screen shot of non active window? If I have 2 windows, I want to capture the screenshot of the one which is running in the background.







command-line x11 screenshot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 3 '14 at 23:44









Gilles

531k12810631591




531k12810631591










asked May 21 '13 at 16:05









spendyalaspendyala

7126




7126












  • Interesting, I'm not sure if that's possible.

    – phunehehe
    May 21 '13 at 16:20






  • 1





    I think you should improve your question by making clear what is meant by "non active". Is this window, presumably not the one in focus, totally visible or partly visible or not visible at all because the active window covers part or all of it?

    – user15760
    May 21 '13 at 16:54

















  • Interesting, I'm not sure if that's possible.

    – phunehehe
    May 21 '13 at 16:20






  • 1





    I think you should improve your question by making clear what is meant by "non active". Is this window, presumably not the one in focus, totally visible or partly visible or not visible at all because the active window covers part or all of it?

    – user15760
    May 21 '13 at 16:54
















Interesting, I'm not sure if that's possible.

– phunehehe
May 21 '13 at 16:20





Interesting, I'm not sure if that's possible.

– phunehehe
May 21 '13 at 16:20




1




1





I think you should improve your question by making clear what is meant by "non active". Is this window, presumably not the one in focus, totally visible or partly visible or not visible at all because the active window covers part or all of it?

– user15760
May 21 '13 at 16:54





I think you should improve your question by making clear what is meant by "non active". Is this window, presumably not the one in focus, totally visible or partly visible or not visible at all because the active window covers part or all of it?

– user15760
May 21 '13 at 16:54










3 Answers
3






active

oldest

votes


















6














To elaborate a bit on previous answers and comments, the ability to capture a screenshot of a non active window (as in fully or partially hidden) seems to depend on the window manager.



Using the following (already given) command :



import -window <windowid> image.png


or



xwd -id <windowid> | convert xwd:- image.png


(the - of convert is for using standard input from the pipe, xwd: tells the format of the input) one seems to be able under Enlightenment (e17, tested with Fedora 19) to capture a screenshot of :



  • fully or partially hidden windows ;

  • minimized windows ;

  • windows on other workspaces.

I checked with Openbox (same configuration) and KDE (with an old Scientific Linux 4.8 and latest version of ImageMagick (yes, incredibly it compiled…)) and in both cases screenshots show only what is on top of the display layers — that is, only what is already visible on screen.



The point is that the import command checks for the map_state field returned by XGetWindowAttributes to be IsViewable, and if not it returns an error. One can check map_state e.g. using :



xwininfo -id <windowid> | grep 'Map State'


It seems to be always IsViewable under e17, while it's IsUnMapped under openbox and KDE as soon as the window is minimized or whatever.



Not sure though why the screenshot is always clean with e17 while it's mixed with other windows when the window is partially recovered with other WMs, but obviously it also has to do with the way the WM handles the display.



Anyway, clearly it's a matter of WM. It would be nice to have a list of WMs able vs unable to do screenshots of hidden windows — I'm not doing it.






share|improve this answer

























  • Interesting to know: You get the window id if you do xwininfo | grep -i 'window id' and click on the window in question.

    – erik
    Jun 3 '16 at 18:01











  • does not work if the window is fully invisible (in another workspace, not the active one)

    – AnonymousLurker
    Apr 29 '18 at 8:06











  • For me, both commands work fine... unless the window is minimized (I'm using Peppermint Linux).

    – Stefan Reich
    Dec 27 '18 at 19:35


















2














What do you mean by "non active"? "Not having the focus" or "hidden by some other window"? In the first case, gimp will do it without any problems (File -> Create -> Screenshot). In the second case, it's more difficult (if it's possible at all).






share|improve this answer























  • Yes, non active means not having the focus. We can take screenshot of focused one. Can we make the window which is not having focus to be focused using command line. If so how can be do that.

    – spendyala
    May 21 '13 at 16:21











  • I want to do in commandline, to automate the process.

    – spendyala
    May 21 '13 at 16:23






  • 3





    I just checked that import (from the ImageMagick suite) has a -window id option. If you know the window identifier that should work, even on the command line. You can get the window identifier using xwininfo, but for that you'll have to use the mouse at least once.

    – Uwe
    May 21 '13 at 16:24












  • Can I extract for fixed height and width using import along with window id. I am also checking that.

    – spendyala
    May 21 '13 at 17:08


















1














for i in `xprop -root|grep "_NET_CLIENT_LIST_STACKING(WINDOW): window id" |tr '#' ','|tr ',' 'n'| grep 0x`;do xwininfo -id $i|grep "Window id" ;done


Using the above I was able to get the windows id. and using


xwininfo
able to find the label or name or title of the window.

Hope this helps someone.






share|improve this answer


















  • 2





    import -window <window_ID> screenshot.png

    – spendyala
    May 22 '13 at 16:36











  • This is the last step to automate the process. This is an interesting one for me.

    – spendyala
    Jun 7 '13 at 13:25










Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f76599%2fscreenshot-of-non-active-window%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









6














To elaborate a bit on previous answers and comments, the ability to capture a screenshot of a non active window (as in fully or partially hidden) seems to depend on the window manager.



Using the following (already given) command :



import -window <windowid> image.png


or



xwd -id <windowid> | convert xwd:- image.png


(the - of convert is for using standard input from the pipe, xwd: tells the format of the input) one seems to be able under Enlightenment (e17, tested with Fedora 19) to capture a screenshot of :



  • fully or partially hidden windows ;

  • minimized windows ;

  • windows on other workspaces.

I checked with Openbox (same configuration) and KDE (with an old Scientific Linux 4.8 and latest version of ImageMagick (yes, incredibly it compiled…)) and in both cases screenshots show only what is on top of the display layers — that is, only what is already visible on screen.



The point is that the import command checks for the map_state field returned by XGetWindowAttributes to be IsViewable, and if not it returns an error. One can check map_state e.g. using :



xwininfo -id <windowid> | grep 'Map State'


It seems to be always IsViewable under e17, while it's IsUnMapped under openbox and KDE as soon as the window is minimized or whatever.



Not sure though why the screenshot is always clean with e17 while it's mixed with other windows when the window is partially recovered with other WMs, but obviously it also has to do with the way the WM handles the display.



Anyway, clearly it's a matter of WM. It would be nice to have a list of WMs able vs unable to do screenshots of hidden windows — I'm not doing it.






share|improve this answer

























  • Interesting to know: You get the window id if you do xwininfo | grep -i 'window id' and click on the window in question.

    – erik
    Jun 3 '16 at 18:01











  • does not work if the window is fully invisible (in another workspace, not the active one)

    – AnonymousLurker
    Apr 29 '18 at 8:06











  • For me, both commands work fine... unless the window is minimized (I'm using Peppermint Linux).

    – Stefan Reich
    Dec 27 '18 at 19:35















6














To elaborate a bit on previous answers and comments, the ability to capture a screenshot of a non active window (as in fully or partially hidden) seems to depend on the window manager.



Using the following (already given) command :



import -window <windowid> image.png


or



xwd -id <windowid> | convert xwd:- image.png


(the - of convert is for using standard input from the pipe, xwd: tells the format of the input) one seems to be able under Enlightenment (e17, tested with Fedora 19) to capture a screenshot of :



  • fully or partially hidden windows ;

  • minimized windows ;

  • windows on other workspaces.

I checked with Openbox (same configuration) and KDE (with an old Scientific Linux 4.8 and latest version of ImageMagick (yes, incredibly it compiled…)) and in both cases screenshots show only what is on top of the display layers — that is, only what is already visible on screen.



The point is that the import command checks for the map_state field returned by XGetWindowAttributes to be IsViewable, and if not it returns an error. One can check map_state e.g. using :



xwininfo -id <windowid> | grep 'Map State'


It seems to be always IsViewable under e17, while it's IsUnMapped under openbox and KDE as soon as the window is minimized or whatever.



Not sure though why the screenshot is always clean with e17 while it's mixed with other windows when the window is partially recovered with other WMs, but obviously it also has to do with the way the WM handles the display.



Anyway, clearly it's a matter of WM. It would be nice to have a list of WMs able vs unable to do screenshots of hidden windows — I'm not doing it.






share|improve this answer

























  • Interesting to know: You get the window id if you do xwininfo | grep -i 'window id' and click on the window in question.

    – erik
    Jun 3 '16 at 18:01











  • does not work if the window is fully invisible (in another workspace, not the active one)

    – AnonymousLurker
    Apr 29 '18 at 8:06











  • For me, both commands work fine... unless the window is minimized (I'm using Peppermint Linux).

    – Stefan Reich
    Dec 27 '18 at 19:35













6












6








6







To elaborate a bit on previous answers and comments, the ability to capture a screenshot of a non active window (as in fully or partially hidden) seems to depend on the window manager.



Using the following (already given) command :



import -window <windowid> image.png


or



xwd -id <windowid> | convert xwd:- image.png


(the - of convert is for using standard input from the pipe, xwd: tells the format of the input) one seems to be able under Enlightenment (e17, tested with Fedora 19) to capture a screenshot of :



  • fully or partially hidden windows ;

  • minimized windows ;

  • windows on other workspaces.

I checked with Openbox (same configuration) and KDE (with an old Scientific Linux 4.8 and latest version of ImageMagick (yes, incredibly it compiled…)) and in both cases screenshots show only what is on top of the display layers — that is, only what is already visible on screen.



The point is that the import command checks for the map_state field returned by XGetWindowAttributes to be IsViewable, and if not it returns an error. One can check map_state e.g. using :



xwininfo -id <windowid> | grep 'Map State'


It seems to be always IsViewable under e17, while it's IsUnMapped under openbox and KDE as soon as the window is minimized or whatever.



Not sure though why the screenshot is always clean with e17 while it's mixed with other windows when the window is partially recovered with other WMs, but obviously it also has to do with the way the WM handles the display.



Anyway, clearly it's a matter of WM. It would be nice to have a list of WMs able vs unable to do screenshots of hidden windows — I'm not doing it.






share|improve this answer















To elaborate a bit on previous answers and comments, the ability to capture a screenshot of a non active window (as in fully or partially hidden) seems to depend on the window manager.



Using the following (already given) command :



import -window <windowid> image.png


or



xwd -id <windowid> | convert xwd:- image.png


(the - of convert is for using standard input from the pipe, xwd: tells the format of the input) one seems to be able under Enlightenment (e17, tested with Fedora 19) to capture a screenshot of :



  • fully or partially hidden windows ;

  • minimized windows ;

  • windows on other workspaces.

I checked with Openbox (same configuration) and KDE (with an old Scientific Linux 4.8 and latest version of ImageMagick (yes, incredibly it compiled…)) and in both cases screenshots show only what is on top of the display layers — that is, only what is already visible on screen.



The point is that the import command checks for the map_state field returned by XGetWindowAttributes to be IsViewable, and if not it returns an error. One can check map_state e.g. using :



xwininfo -id <windowid> | grep 'Map State'


It seems to be always IsViewable under e17, while it's IsUnMapped under openbox and KDE as soon as the window is minimized or whatever.



Not sure though why the screenshot is always clean with e17 while it's mixed with other windows when the window is partially recovered with other WMs, but obviously it also has to do with the way the WM handles the display.



Anyway, clearly it's a matter of WM. It would be nice to have a list of WMs able vs unable to do screenshots of hidden windows — I'm not doing it.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 1 at 20:17









aksh1618

8710




8710










answered Oct 1 '13 at 12:08









Skippy le Grand GourouSkippy le Grand Gourou

1,0421121




1,0421121












  • Interesting to know: You get the window id if you do xwininfo | grep -i 'window id' and click on the window in question.

    – erik
    Jun 3 '16 at 18:01











  • does not work if the window is fully invisible (in another workspace, not the active one)

    – AnonymousLurker
    Apr 29 '18 at 8:06











  • For me, both commands work fine... unless the window is minimized (I'm using Peppermint Linux).

    – Stefan Reich
    Dec 27 '18 at 19:35

















  • Interesting to know: You get the window id if you do xwininfo | grep -i 'window id' and click on the window in question.

    – erik
    Jun 3 '16 at 18:01











  • does not work if the window is fully invisible (in another workspace, not the active one)

    – AnonymousLurker
    Apr 29 '18 at 8:06











  • For me, both commands work fine... unless the window is minimized (I'm using Peppermint Linux).

    – Stefan Reich
    Dec 27 '18 at 19:35
















Interesting to know: You get the window id if you do xwininfo | grep -i 'window id' and click on the window in question.

– erik
Jun 3 '16 at 18:01





Interesting to know: You get the window id if you do xwininfo | grep -i 'window id' and click on the window in question.

– erik
Jun 3 '16 at 18:01













does not work if the window is fully invisible (in another workspace, not the active one)

– AnonymousLurker
Apr 29 '18 at 8:06





does not work if the window is fully invisible (in another workspace, not the active one)

– AnonymousLurker
Apr 29 '18 at 8:06













For me, both commands work fine... unless the window is minimized (I'm using Peppermint Linux).

– Stefan Reich
Dec 27 '18 at 19:35





For me, both commands work fine... unless the window is minimized (I'm using Peppermint Linux).

– Stefan Reich
Dec 27 '18 at 19:35













2














What do you mean by "non active"? "Not having the focus" or "hidden by some other window"? In the first case, gimp will do it without any problems (File -> Create -> Screenshot). In the second case, it's more difficult (if it's possible at all).






share|improve this answer























  • Yes, non active means not having the focus. We can take screenshot of focused one. Can we make the window which is not having focus to be focused using command line. If so how can be do that.

    – spendyala
    May 21 '13 at 16:21











  • I want to do in commandline, to automate the process.

    – spendyala
    May 21 '13 at 16:23






  • 3





    I just checked that import (from the ImageMagick suite) has a -window id option. If you know the window identifier that should work, even on the command line. You can get the window identifier using xwininfo, but for that you'll have to use the mouse at least once.

    – Uwe
    May 21 '13 at 16:24












  • Can I extract for fixed height and width using import along with window id. I am also checking that.

    – spendyala
    May 21 '13 at 17:08















2














What do you mean by "non active"? "Not having the focus" or "hidden by some other window"? In the first case, gimp will do it without any problems (File -> Create -> Screenshot). In the second case, it's more difficult (if it's possible at all).






share|improve this answer























  • Yes, non active means not having the focus. We can take screenshot of focused one. Can we make the window which is not having focus to be focused using command line. If so how can be do that.

    – spendyala
    May 21 '13 at 16:21











  • I want to do in commandline, to automate the process.

    – spendyala
    May 21 '13 at 16:23






  • 3





    I just checked that import (from the ImageMagick suite) has a -window id option. If you know the window identifier that should work, even on the command line. You can get the window identifier using xwininfo, but for that you'll have to use the mouse at least once.

    – Uwe
    May 21 '13 at 16:24












  • Can I extract for fixed height and width using import along with window id. I am also checking that.

    – spendyala
    May 21 '13 at 17:08













2












2








2







What do you mean by "non active"? "Not having the focus" or "hidden by some other window"? In the first case, gimp will do it without any problems (File -> Create -> Screenshot). In the second case, it's more difficult (if it's possible at all).






share|improve this answer













What do you mean by "non active"? "Not having the focus" or "hidden by some other window"? In the first case, gimp will do it without any problems (File -> Create -> Screenshot). In the second case, it's more difficult (if it's possible at all).







share|improve this answer












share|improve this answer



share|improve this answer










answered May 21 '13 at 16:14









UweUwe

3,0171217




3,0171217












  • Yes, non active means not having the focus. We can take screenshot of focused one. Can we make the window which is not having focus to be focused using command line. If so how can be do that.

    – spendyala
    May 21 '13 at 16:21











  • I want to do in commandline, to automate the process.

    – spendyala
    May 21 '13 at 16:23






  • 3





    I just checked that import (from the ImageMagick suite) has a -window id option. If you know the window identifier that should work, even on the command line. You can get the window identifier using xwininfo, but for that you'll have to use the mouse at least once.

    – Uwe
    May 21 '13 at 16:24












  • Can I extract for fixed height and width using import along with window id. I am also checking that.

    – spendyala
    May 21 '13 at 17:08

















  • Yes, non active means not having the focus. We can take screenshot of focused one. Can we make the window which is not having focus to be focused using command line. If so how can be do that.

    – spendyala
    May 21 '13 at 16:21











  • I want to do in commandline, to automate the process.

    – spendyala
    May 21 '13 at 16:23






  • 3





    I just checked that import (from the ImageMagick suite) has a -window id option. If you know the window identifier that should work, even on the command line. You can get the window identifier using xwininfo, but for that you'll have to use the mouse at least once.

    – Uwe
    May 21 '13 at 16:24












  • Can I extract for fixed height and width using import along with window id. I am also checking that.

    – spendyala
    May 21 '13 at 17:08
















Yes, non active means not having the focus. We can take screenshot of focused one. Can we make the window which is not having focus to be focused using command line. If so how can be do that.

– spendyala
May 21 '13 at 16:21





Yes, non active means not having the focus. We can take screenshot of focused one. Can we make the window which is not having focus to be focused using command line. If so how can be do that.

– spendyala
May 21 '13 at 16:21













I want to do in commandline, to automate the process.

– spendyala
May 21 '13 at 16:23





I want to do in commandline, to automate the process.

– spendyala
May 21 '13 at 16:23




3




3





I just checked that import (from the ImageMagick suite) has a -window id option. If you know the window identifier that should work, even on the command line. You can get the window identifier using xwininfo, but for that you'll have to use the mouse at least once.

– Uwe
May 21 '13 at 16:24






I just checked that import (from the ImageMagick suite) has a -window id option. If you know the window identifier that should work, even on the command line. You can get the window identifier using xwininfo, but for that you'll have to use the mouse at least once.

– Uwe
May 21 '13 at 16:24














Can I extract for fixed height and width using import along with window id. I am also checking that.

– spendyala
May 21 '13 at 17:08





Can I extract for fixed height and width using import along with window id. I am also checking that.

– spendyala
May 21 '13 at 17:08











1














for i in `xprop -root|grep "_NET_CLIENT_LIST_STACKING(WINDOW): window id" |tr '#' ','|tr ',' 'n'| grep 0x`;do xwininfo -id $i|grep "Window id" ;done


Using the above I was able to get the windows id. and using


xwininfo
able to find the label or name or title of the window.

Hope this helps someone.






share|improve this answer


















  • 2





    import -window <window_ID> screenshot.png

    – spendyala
    May 22 '13 at 16:36











  • This is the last step to automate the process. This is an interesting one for me.

    – spendyala
    Jun 7 '13 at 13:25















1














for i in `xprop -root|grep "_NET_CLIENT_LIST_STACKING(WINDOW): window id" |tr '#' ','|tr ',' 'n'| grep 0x`;do xwininfo -id $i|grep "Window id" ;done


Using the above I was able to get the windows id. and using


xwininfo
able to find the label or name or title of the window.

Hope this helps someone.






share|improve this answer


















  • 2





    import -window <window_ID> screenshot.png

    – spendyala
    May 22 '13 at 16:36











  • This is the last step to automate the process. This is an interesting one for me.

    – spendyala
    Jun 7 '13 at 13:25













1












1








1







for i in `xprop -root|grep "_NET_CLIENT_LIST_STACKING(WINDOW): window id" |tr '#' ','|tr ',' 'n'| grep 0x`;do xwininfo -id $i|grep "Window id" ;done


Using the above I was able to get the windows id. and using


xwininfo
able to find the label or name or title of the window.

Hope this helps someone.






share|improve this answer













for i in `xprop -root|grep "_NET_CLIENT_LIST_STACKING(WINDOW): window id" |tr '#' ','|tr ',' 'n'| grep 0x`;do xwininfo -id $i|grep "Window id" ;done


Using the above I was able to get the windows id. and using


xwininfo
able to find the label or name or title of the window.

Hope this helps someone.







share|improve this answer












share|improve this answer



share|improve this answer










answered May 22 '13 at 4:28









spendyalaspendyala

7126




7126







  • 2





    import -window <window_ID> screenshot.png

    – spendyala
    May 22 '13 at 16:36











  • This is the last step to automate the process. This is an interesting one for me.

    – spendyala
    Jun 7 '13 at 13:25












  • 2





    import -window <window_ID> screenshot.png

    – spendyala
    May 22 '13 at 16:36











  • This is the last step to automate the process. This is an interesting one for me.

    – spendyala
    Jun 7 '13 at 13:25







2




2





import -window <window_ID> screenshot.png

– spendyala
May 22 '13 at 16:36





import -window <window_ID> screenshot.png

– spendyala
May 22 '13 at 16:36













This is the last step to automate the process. This is an interesting one for me.

– spendyala
Jun 7 '13 at 13:25





This is the last step to automate the process. This is an interesting one for me.

– spendyala
Jun 7 '13 at 13:25

















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f76599%2fscreenshot-of-non-active-window%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?