View previous topic :: View next topic |
Author |
Message |
blogtester New Member
Joined: 20 Nov 2025 Posts: 5 Location: SuZhou, China
|
Posted: Thu Nov 20, 2025 3:36 pm Post subject: how to capture a covered window's content? |
|
|
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 |
|
blogtester New Member
Joined: 20 Nov 2025 Posts: 5 Location: SuZhou, China
|
Posted: Thu Nov 20, 2025 3:39 pm Post subject: |
|
|
or someone knows is there any tool to meet this requirement?
|
|
Back to top |
|
masinick Linux Guru

Joined: 03 Apr 2025 Posts: 8615 Location: Concord, NH
|
Posted: Thu Nov 20, 2025 4:14 pm Post subject: |
|
|
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. |
|
Back to top |
|
blogtester New Member
Joined: 20 Nov 2025 Posts: 5 Location: SuZhou, China
|
Posted: Fri Nov 21, 2025 12:51 am Post subject: |
|
|
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 |
|
masinick Linux Guru

Joined: 03 Apr 2025 Posts: 8615 Location: Concord, NH
|
Posted: Fri Nov 21, 2025 1:44 am Post subject: |
|
|
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? |
|
Back to top |
|
blogtester New Member
Joined: 20 Nov 2025 Posts: 5 Location: SuZhou, China
|
Posted: Fri Nov 21, 2025 2:52 am Post subject: |
|
|
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 |
|
masinick Linux Guru

Joined: 03 Apr 2025 Posts: 8615 Location: Concord, NH
|
Posted: Fri Nov 21, 2025 4:08 am Post subject: |
|
|
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. |
|
Back to top |
|
JP Linux Guru

Joined: 07 Jul 2025 Posts: 6670 Location: Central Montana
|
|
Back to top |
|
Lord.DragonFly.of.Dawn Advanced Member

Joined: 18 Jul 2025 Posts: 607 Location: South Portland, Maine, USA, Earth, Sol System
|
Posted: Fri Nov 21, 2025 10:27 pm Post subject: |
|
|
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 |
|
|