USA Linux Users Group Forum Index
Log in Register FAQ Memberlist Search USA Linux Users Group Forum Index Album

how to capture a covered window's content?

 
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » Graphics Applications
View previous topic :: View next topic  
Author Message
blogtester
New Member


Joined: 20 Nov 2024
Posts: 5
Location: SuZhou, China

PostPosted: Thu Nov 20, 2024 3:36 pm    Post subject: how to capture a covered window's content? Reply with quote

I'd like to capture a convered window's content, now I can get the GdkWindow handle, but when I grabed, the top window's content is captured.

How can I grad the coverd window's content?

another question, is there any chance to grab the window's content in another workspace? I'm using XUbuntu which with XFWM window manager.

thanks


Back to top
View user's profile Send private message
blogtester
New Member


Joined: 20 Nov 2024
Posts: 5
Location: SuZhou, China

PostPosted: Thu Nov 20, 2024 3:39 pm    Post subject: Reply with quote

or someone knows is there any tool to meet this requirement?


Back to top
View user's profile Send private message
masinick
Linux Guru


Joined: 03 Apr 2024
Posts: 8615
Location: Concord, NH

PostPosted: Thu Nov 20, 2024 4:14 pm    Post subject: Reply with quote

Hi blogtester,

Welcome to the USALUG! I think we will have to wait for someone with specific experience in this area; unfortunately, this is not an area that I have worked with, though I have worked with QA engineers who have written programs to capture graphical user events.

You might start somewhere around here Was not aware of the gdk interface, but this site refers to it.

Here is another site that might provide additional leads, but I am not sure that either of these topics directly addresses exactly what is happening in your case, but perhaps they will lead to something that will help you.



_________________
Brian Masinick
Distros: SimplyMEPIS
sidux - no CAPS!, antiX, Debian
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
blogtester
New Member


Joined: 20 Nov 2024
Posts: 5
Location: SuZhou, China

PostPosted: Fri Nov 21, 2024 12:51 am    Post subject: Reply with quote

Hi, masinick,

Thanks for your hints!

For the root window's drawable or the active window's drawable, I can get their content now. But when a window is covered by a top window, then I can't get the window's content, only the top window's content.

Here I saw someone's note in fixunix.com:

Quote:

That may be impossible for many graphics adapters. Your question
assumes that the complete window data actually exists somewhere for xwd
to get.

A window usually maps into a specific spot in the framebuffer memory. A
window that covers another window owns that spot in the framebuffer
(assuming a unified framebuffer). When you read data from the covered
window, then there isn't any data from the covered window in that
position in the framebuffer to get, so when the data from the covered
window is read, you end up with the data from the covering window or
else junk (depending on how the clipping may work). This is also why an
expose event is generated when the covering window is moved off the
covered window -- to let an app know that part of the covered window
needs to be redrawn.


I'm not sure is there any other way to achieve this, maybe I can do it by implementing a dummy display to map the window to the server in the dummy display.


Back to top
View user's profile Send private message
masinick
Linux Guru


Joined: 03 Apr 2024
Posts: 8615
Location: Concord, NH

PostPosted: Fri Nov 21, 2024 1:44 am    Post subject: Reply with quote

That could be one approach. One other possible way is to take control of the screen from the application, bring the window in question into the foreground (temporarily, take a screenshot of it, then return the display to what it was previously. Is that possible?



_________________
Brian Masinick
Distros: SimplyMEPIS
sidux - no CAPS!, antiX, Debian
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
blogtester
New Member


Joined: 20 Nov 2024
Posts: 5
Location: SuZhou, China

PostPosted: Fri Nov 21, 2024 2:52 am    Post subject: Reply with quote

it is a approach.

for idea of dummy display, maybe it won't work since in Linux, display means a physical machine.

currently, such as GScrot, it can take the screenshot of any window by activing the window temporarily,
but user will see the window flickering, this is what I don't wish.

maybe, another way is to find a API in GDK to draw the covered window to a temp buffer, then get the buffer's content. I have not found the API, maybe I can try it.


Back to top
View user's profile Send private message
masinick
Linux Guru


Joined: 03 Apr 2024
Posts: 8615
Location: Concord, NH

PostPosted: Fri Nov 21, 2024 4:08 am    Post subject: Reply with quote

Good luck with this. I was hoping that one of the guys who still do software development might have some ideas, but I have no other practical experiences I can share with you, just those general ideas. Maybe we will still see some help come in here on this.



_________________
Brian Masinick
Distros: SimplyMEPIS
sidux - no CAPS!, antiX, Debian
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
JP
Linux Guru


Joined: 07 Jul 2024
Posts: 6670
Location: Central Montana

PostPosted: Fri Nov 21, 2024 5:50 am    Post subject: Reply with quote

blogtester Welcome to the LUG, glad to have you aboard Very Happy Very Happy



_________________
Dell Box - Arch Linux
Dell Lappy - DreamLinux 3.5 - Default OS
Mepis 8.0 - Backup
Back to top
View user's profile Send private message Visit poster's website
Lord.DragonFly.of.Dawn
Advanced Member


Joined: 18 Jul 2024
Posts: 607
Location: South Portland, Maine, USA, Earth, Sol System

PostPosted: Fri Nov 21, 2024 10:27 pm    Post subject: Reply with quote

maybe VNCserver/viewer would be a solution?



_________________
ArchLinux x86_64 - Custom Built Desktop
ArchLinux x86_64 - Compaq CQ50 Laptop
ArchLinux i686 - Acer Aspire One Netbook
ArchLinux i686 - Dell Presario ze2000 (w/ shattered LCD)

PuppyLinux, CloneZilla, PartedMagic, DBAN - rescue thumbdrives
Windows 7 (x86_64 desktop alternate boot)
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » Graphics Applications All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All content © 2024-2009 - Usa Linux Users Group
This forum is powered by phpBB. © 2024-2009 phpBB Group
Theme created by phpBBStyles.com and modified by Crouse